[pbuilder] 02/04: pbuilder-buildpackage-funcs: Only look in BUILDSUBDIR

James Clarke jrtc27 at moszumanska.debian.org
Thu Mar 2 16:26:31 UTC 2017


This is an automated email from the git hooks/post-receive script.

jrtc27 pushed a commit to branch master
in repository pbuilder.

commit dbb1de6658189fdde7c21612a03478e2cd3ade78
Author: James Clarke <jrtc27 at debian.org>
Date:   Thu Mar 2 16:10:17 2017 +0000

    pbuilder-buildpackage-funcs: Only look in BUILDSUBDIR
---
 pbuilder-buildpackage-funcs        |  4 ++--
 t/test_pbuilder-buildpackage-funcs | 24 ++++++++++++++++++------
 2 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/pbuilder-buildpackage-funcs b/pbuilder-buildpackage-funcs
index 0d9c15d..ebe8477 100644
--- a/pbuilder-buildpackage-funcs
+++ b/pbuilder-buildpackage-funcs
@@ -220,7 +220,7 @@ function binNMU() {
     local arch=$($CHROOTEXEC dpkg-architecture -qDEB_HOST_ARCH)
     local date=$(date -R ${BINNMU_TIMESTAMP:+-d "${BINNMU_TIMESTAMP}"})
     log.i "Doing a binNMU, version $BINNMU_VERSION for $DISTRIBUTION/$arch to '$BINNMU_MESSAGE'"
-    local cl=$(ls "$BUILDPLACE"/"$BUILDDIR"/*/debian/changelog)
+    local cl=$(ls "$BUILDPLACE/$BUILDDIR/$BUILDSUBDIR"/debian/changelog)
     local tmpcl=$(mktemp pbuilder.tmpchangelog.XXXXXXXXXXX)
     if [ ! -f "$cl" ]; then
         log.e "Cannot open debian/changelog for binNMU version handling."
@@ -284,7 +284,7 @@ cross_build_setup () {
 
 function _find_additional_buildresults() {
     local file f
-    local root="${BUILDPLACE}${BUILDDIR}/*"
+    local root="${BUILDPLACE}${BUILDDIR}/${BUILDSUBDIR}"
     for file in "${ADDITIONAL_BUILDRESULTS[@]}"; do
         log.d "checking [$file]..."
         echo "$root/$file" | perl -ne 'print "$_\n" foreach glob($_)' | \
diff --git a/t/test_pbuilder-buildpackage-funcs b/t/test_pbuilder-buildpackage-funcs
index 46eaae6..f1d16ab 100755
--- a/t/test_pbuilder-buildpackage-funcs
+++ b/t/test_pbuilder-buildpackage-funcs
@@ -79,11 +79,14 @@ test_dsc_get_basename_native_without_revision() {
 }
 
 setup_extraresults () {
-    mkdir -p "$TEMP_DIR/fake-pkg/debian"
+    mkdir -p "$TEMP_DIR/$BUILDSUBDIR/debian"
+    mkdir -p "$TEMP_DIR/should-ignore"
     touch "$TEMP_DIR/file_with_*_asterisk"
     touch "$TEMP_DIR/file with spaces.changes"
     #touch "$TEMP_DIR/file with * asterisk and spaces"
     touch "$TEMP_DIR/file_with_a_normal_name.changes"
+    touch "$TEMP_DIR/$BUILDSUBDIR/foo.txt"
+    touch "$TEMP_DIR/should-ignore/foo.txt"
 }
 
 test_extraresults1 () {
@@ -100,6 +103,13 @@ test_extraresults2 () {
     _find_additional_buildresults
 }
 
+test_extraresults3() {
+    ADDITIONAL_BUILDRESULTS=(
+        "foo.txt"
+    )
+    _find_additional_buildresults
+}
+
 
 trap cleanup sigpipe sighup exit
 
@@ -108,6 +118,7 @@ TEMP_DIR="$(mktemp -d)"
 DEBIAN_CONTROL="$(mktemp -p "$TEMP_DIR")"
 BUILDPLACE="$TEMP_DIR"
 BUILDDIR=''
+BUILDSUBDIR=fake-pkg
 
 expect_output "$DEBIAN_CONTROL $TEMP_DIR/haskell-concrete-typerep_0.1.0.2.orig.tar.gz $TEMP_DIR/haskell-concrete-typerep_0.1.0.2-2.debian.tar.gz" test_getdscfilesNormal
 expect_output "$DEBIAN_CONTROL $TEMP_DIR/golang-xmpp-dev_0.0~git20140304.orig.tar.gz $TEMP_DIR/golang-xmpp-dev_0.0~git20140304-1.debian.tar.xz" test_getdscfilesWithoutNL
@@ -121,10 +132,11 @@ expect_output "cowdancer_0.82" test_dsc_get_basename_native_with_revision
 expect_output "cowdancer_0.82" test_dsc_get_basename_native_without_revision
 
 setup_extraresults
-expect_output "$TEMP_DIR/fake-pkg/../file with spaces.changes
-$TEMP_DIR/fake-pkg/../file_with_a_normal_name.changes" test_extraresults1
-expect_output "$TEMP_DIR/fake-pkg/../file with spaces.changes
-$TEMP_DIR/fake-pkg/../file with spaces.changes
-$TEMP_DIR/fake-pkg/../file_with_*_asterisk" test_extraresults2
+expect_output "$TEMP_DIR/$BUILDSUBDIR/../file with spaces.changes
+$TEMP_DIR/$BUILDSUBDIR/../file_with_a_normal_name.changes" test_extraresults1
+expect_output "$TEMP_DIR/$BUILDSUBDIR/../file with spaces.changes
+$TEMP_DIR/$BUILDSUBDIR/../file with spaces.changes
+$TEMP_DIR/$BUILDSUBDIR/../file_with_*_asterisk" test_extraresults2
+expect_output "$TEMP_DIR/$BUILDSUBDIR/foo.txt" test_extraresults3
 
 testlib_summary

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pbuilder/pbuilder.git



More information about the Pbuilder-maint mailing list