aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunichi Uekawa <dancer@netfort.gr.jp>2009-12-14 23:05:38 +0900
committerJunichi Uekawa <dancer@netfort.gr.jp>2009-12-14 23:05:38 +0900
commit71c3d0facb7d81e8a2807901e4e75df368c38661 (patch)
tree3983f58c42579924d1a4a925e19aa4b31e74daf5
parent7d9fde5c3870e22e2f11970b49dde02497b787da (diff)
parent5c38080a60d4565a8dd45f8eade565b9dffe1425 (diff)
downloadpbuilder-71c3d0facb7d81e8a2807901e4e75df368c38661.tar
pbuilder-71c3d0facb7d81e8a2807901e4e75df368c38661.tar.gz
Merge branch 'master' of ssh://git.debian.org/git/pbuilder/pbuilder
-rwxr-xr-xpbuilder-buildpackage2
-rwxr-xr-xpbuilder-checkparams2
-rw-r--r--pdebuild-internal3
-rw-r--r--pdebuild-uml-checkparams3
-rwxr-xr-xtest_pbuilder-checkparams24
5 files changed, 30 insertions, 4 deletions
diff --git a/pbuilder-buildpackage b/pbuilder-buildpackage
index 18678af..293eecf 100755
--- a/pbuilder-buildpackage
+++ b/pbuilder-buildpackage
@@ -33,7 +33,7 @@ fi;
if [ -n "$BUILDUSERNAME" -a -n "$BUILDUSERID" ]; then
SUTOUSER="env LOGNAME=$BUILDUSERNAME su -p $BUILDUSERNAME"
- DEBBUILDOPTS="$DEBBUILDOPTS -rfakeroot"
+ DEBBUILDOPTS="${DEBBUILDOPTS:+$DEBBUILDOPTS }-rfakeroot"
EXTRAPACKAGES="${EXTRAPACKAGES} fakeroot"
log "I: using fakeroot in build."
else
diff --git a/pbuilder-checkparams b/pbuilder-checkparams
index 289ae38..37b8f42 100755
--- a/pbuilder-checkparams
+++ b/pbuilder-checkparams
@@ -143,7 +143,7 @@ while [ -n "$1" ]; do
;;
--debbuildopts)
# append to DEBBUILDOPTS or reset to empty if $2 isn't set
- DEBBUILDOPTS="${2:+$DEBBUILDOPTS $2}";
+ DEBBUILDOPTS="${2:+${DEBBUILDOPTS:+$DEBBUILDOPTS }$2}";
shift; shift;
;;
--logfile)
diff --git a/pdebuild-internal b/pdebuild-internal
index 46511dc..4d07a48 100644
--- a/pdebuild-internal
+++ b/pdebuild-internal
@@ -46,7 +46,8 @@ function log() {
while [ -n "$1" ]; do
case "$1" in
--debbuildopts)
- DEBBUILDOPTS="${2:+$DEBBUILDOPTS $2}";
+ # append to DEBBUILDOPTS or reset to empty if $2 isn't set
+ DEBBUILDOPTS="${2:+${DEBBUILDOPTS:+$DEBBUILDOPTS }$2}";
log "I: Setting DEBBUILDOPTS=$DEBBUILDOPTS"
shift; shift;
;;
diff --git a/pdebuild-uml-checkparams b/pdebuild-uml-checkparams
index ea428a6..b78ae29 100644
--- a/pdebuild-uml-checkparams
+++ b/pdebuild-uml-checkparams
@@ -65,7 +65,8 @@ while [ -n "$1" ] ; do
shift;
;;
--debbuildopts)
- DEBBUILDOPTS="${2:+$DEBBUILDOPTS $2}";
+ # append to DEBBUILDOPTS or reset to empty if $2 isn't set
+ DEBBUILDOPTS="${2:+${DEBBUILDOPTS:+$DEBBUILDOPTS }$2}";
shift; shift;
;;
--buildresult)
diff --git a/test_pbuilder-checkparams b/test_pbuilder-checkparams
new file mode 100755
index 0000000..17392d4
--- /dev/null
+++ b/test_pbuilder-checkparams
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+. ./testlib.sh
+
+# testsuite for pbuilder-checkparams
+
+test_debuildopts() {
+ # stderr is redirected to /dev/null to avoid failing if ~/.pbuilderrc is
+ # missing (this outputs a warning which is not expected in the output)
+ . ./pbuilder-checkparams 2>/dev/null
+ echo "$DEBBUILDOPTS"
+}
+expect_output "" \
+ test_debuildopts foo.dsc
+expect_output "" \
+ test_debuildopts --debbuildopts "" foo.dsc
+expect_output "-v1.0 -efoo" \
+ test_debuildopts --debbuildopts "-v1.0 -efoo" foo.dsc
+expect_output "-v1.0 -efoo" \
+ test_debuildopts --debbuildopts -v1.0 --debbuildopts -efoo foo.dsc
+expect_output "-efoo" \
+ test_debuildopts --debbuildopts -v1.0 --debbuildopts "" --debbuildopts -efoo foo.dsc
+
+testlib_summary