Skip to content

Commit

Permalink
Merge debian/ instead of replace with unnecessary files.
Browse files Browse the repository at this point in the history
  • Loading branch information
alee-ntap committed Nov 21, 2023
1 parent bd1185d commit 3aae546
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions container/bin/build_source
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,6 @@ main() (
apt_source "$source"
fi

# if debian_source defined: remove debian folder from source and replace with debian folder from debian_source
if [ -n "$debian_source" ]; then
mkdir debian_src
cd debian_src
if [[ "$debian_source" = "git+"* ]]; then
git_source "${debian_source#git+}"
else
apt_source "$debian_source"
fi
rm -rf ../src/debian
mv src/debian ../src/
cd ..
rm -rf debian_src
fi

cd src
apply_patches /input

Expand Down Expand Up @@ -66,6 +51,10 @@ apt_source() (
debian=(*.debian.tar.*)
dsc=(*.dsc)
auto_decompress "$orig" > orig.tar
if [ -d /input/debian ]; then
echo "### Override debian folder with own content"
rsync -a /input/debian src/
fi
mkdir src
tar -C src -x --strip-components 1 < orig.tar
auto_decompress "$debian" | tar -C src -xv
Expand All @@ -75,6 +64,10 @@ apt_source() (
git_source() (
IFS='#' read -r url ref <<< "$1"
git clone --bare --branch "$ref" --depth 1 "$url" src.git
if [ -d /input/debian ]; then
echo "### Replace debian folder with own content"
rsync -a /input/debian src/
fi
GIT_DIR=src.git git archive --prefix src/ "$ref" > orig.tar
rm -rf src.git
tar -x < orig.tar
Expand Down

0 comments on commit 3aae546

Please sign in to comment.