diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2012-07-04 08:09:21 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2012-07-04 08:09:21 +0200 |
commit | 15245c4a0eb62b0e1bcbac5063391e0d57a53799 (patch) | |
tree | 1d0adbb753f4db0d83388b6e99bbfabaa56ee77f | |
parent | cb66c9f9e4107e38498457bffcfa70650f9d14f4 (diff) | |
download | alpine-conf-15245c4a0eb62b0e1bcbac5063391e0d57a53799.zip |
lbu: do not use xargs
xargs will execute the command twice if the buffer becomes long enough.
This will break tar.
We also use -z instead of piping via gzip while here.
ref #1240
-rw-r--r-- | lbu.in | 14 |
1 files changed, 4 insertions, 10 deletions
@@ -281,10 +281,6 @@ _gen_filelist() { apk audit --backup --quiet --recursive } -_gen_filelist_0() { - _gen_filelist | tr '\n' '\0' -} - cmd_package() { local pkg="$1" local rc=0 @@ -311,7 +307,7 @@ cmd_package() { tmppkg="$tmpdir/$(basename $pkg)" - local tar_create="tar -c --no-recursion" + local tar_create="tar -c --no-recursion -T -" cd "${ROOT:-/}" # remove old package.list @@ -325,19 +321,17 @@ cmd_package() { echo "Archiving the following files:" >&2 # we dont want to mess the tar output with the # password prompt. Lets get the tar output first. - _gen_filelist_0 | xargs -0 $tar_create -v > /dev/null + _gen_filelist | $tar_create -v > /dev/null rc=$? fi if [ $rc -eq 0 ]; then if [ -z "$ENCRYPTION" ]; then - _gen_filelist_0 | xargs -0 $tar_create \ - | gzip -c >"$tmppkg" + _gen_filelist | $tar_create -z >"$tmppkg" rc=$? else set -- enc "-$ENCRYPTION" -salt [ -n "$PASSWORD" ] && set -- "$@" -pass pass:"$PASSWORD" - _gen_filelist_0 | xargs -0 $tar_create \ - | gzip -c \ + _gen_filelist | $tar_create -z \ | $OPENSSL "$@" > "$tmppkg" rc=$? fi |