summaryrefslogtreecommitdiff
path: root/lbu.in
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2011-08-11 06:28:16 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2011-08-11 06:29:23 +0000
commit8d795d1760f28bedfe605515c7c770389768b5fb (patch)
treeccfe507247ff890bea67c6f6566e7a2fd16025ae /lbu.in
parentcbd706597ffc9f231f28eca51ccc1b949f045ba2 (diff)
downloadalpine-conf-8d795d1760f28bedfe605515c7c770389768b5fb.zip
lbu: do not edit users config
Cope with empty lines in include/exclude without editing the file ref #713
Diffstat (limited to 'lbu.in')
-rw-r--r--lbu.in16
1 files changed, 13 insertions, 3 deletions
diff --git a/lbu.in b/lbu.in
index a84e569..5d74b3d 100644
--- a/lbu.in
+++ b/lbu.in
@@ -265,7 +265,7 @@ cmd_package() {
local rc=0
local owd="$PWD"
local suff="apkovl.tar.gz"
- local tmpdir tmppkg
+ local tmpdir tmppkg tmpexclude tmpinclude
check_openssl
init_tmpdir tmpdir
@@ -284,6 +284,8 @@ cmd_package() {
fi
tmppkg="$tmpdir/$(basename $pkg)"
+ tmpexclude="$tmpdir"/exclude
+ tmpinclude="$tmpdir"/include
cd "${ROOT:-/}"
# remove old package.list
@@ -293,8 +295,16 @@ cmd_package() {
rm -f etc/lbu/packages.list
fi
# create tar archive
- [ -f "$EXCLUDE_LIST" ] && sed -i '/^$/d' "$EXCLUDE_LIST" && excl="-X $EXCLUDE_LIST"
- [ -f "$INCLUDE_LIST" ] && sed -i '/^$/d' "$INCLUDE_LIST" && incl="-T $INCLUDE_LIST"
+ if [ -f "$EXCLUDE_LIST" ]; then
+ # strip empty lines and lines with only whitespace
+ sed -e '/^[[:space:]]*$/d' "$EXCLUDE_LIST" > $tmpexclude
+ excl="-X $tmpexclude"
+ fi
+ if [ -f "$INCLUDE_LIST" ]; then
+ # strip empty lines and lines with only whitespace
+ sed -e '/^[[:space:]]*$/d' "$INCLUDE_LIST" > $tmpinclude
+ incl="-T $tmpinclude"
+ fi
if [ -n "$VERBOSE" ]; then
echo "Archiving the following files:" >&2
# we dont want to mess the tar output with the