[devscripts] 02/02: test_package_lifecycle: Fix expected output when run as root

James McCoy jamessan at debian.org
Mon Aug 28 00:32:30 UTC 2017


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

jamessan pushed a commit to branch master
in repository devscripts.

commit 0ffac3712059bb8999fde4fcf5cdf0d0004559c8
Author: James McCoy <jamessan at debian.org>
Date:   Sun Aug 27 18:04:09 2017 -0400

    test_package_lifecycle: Fix expected output when run as root
    
    Signed-off-by: James McCoy <jamessan at debian.org>
---
 debian/changelog            |  2 ++
 test/test_package_lifecycle | 18 ++++++++++++------
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index c82a037..2fb5b2d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -23,6 +23,8 @@ devscripts (2.17.10) UNRELEASED; urgency=medium
   * Add hardening-check script.
   * debuild:
     + Add "--" in --help output for debian/rules mode.
+  * test_package_lifecycle:
+    + Fix expected output when run as root.
 
   [ Daniel Shahaf ]
   * bts:
diff --git a/test/test_package_lifecycle b/test/test_package_lifecycle
index f3c768f..93a0f5f 100755
--- a/test/test_package_lifecycle
+++ b/test/test_package_lifecycle
@@ -30,6 +30,12 @@ fi
 
 GPGHOME=$(mktemp -d -p /tmp gpg.XXXXX)
 
+if [ $(id -u) -eq 0 ]; then
+  FAKEROOT=
+else
+  FAKEROOT="fakeroot "
+fi
+
 oneTimeSetUp () {
 	GPG=gpg
 	if ! command -v $GPG >/dev/null 2>&1;then
@@ -126,7 +132,7 @@ test_debuild() {
 	dpkg-buildpackage: source changed by Testophilus Testownik <tester at testity.org>
 	 dpkg-source --before-build test
 	dpkg-buildpackage: host architecture ${_ARCH}
-	 fakeroot debian/rules clean
+	 ${FAKEROOT}debian/rules clean
 	dh clean
 	 dpkg-source -b test
 	dpkg-source: info: using source format '3.0 (quilt)'
@@ -135,7 +141,7 @@ test_debuild() {
 	dpkg-source: info: building test in test_1.0-1.dsc
 	 debian/rules build
 	dh build
-	 fakeroot debian/rules binary
+	 ${FAKEROOT}debian/rules binary
 	dh binary
 	dpkg-deb: building package 'test' in '../test_1.0-1_all.deb'.
 	 dpkg-genchanges  >../test_1.0-1_${_ARCH}.changes
@@ -270,7 +276,7 @@ test_debuild2() {
 	dpkg-buildpackage: source changed by Testophilus Testownik <tester at testity.org>
 	 dpkg-source --before-build test
 	dpkg-buildpackage: host architecture ${_ARCH}
-	 fakeroot debian/rules clean
+	 ${FAKEROOT}debian/rules clean
 	dh clean
 	 dpkg-source -b test
 	dpkg-source: info: using source format '3.0 (quilt)'
@@ -279,7 +285,7 @@ test_debuild2() {
 	dpkg-source: info: building test in test_1.0-2.dsc
 	 debian/rules build
 	dh build
-	 fakeroot debian/rules binary
+	 ${FAKEROOT}debian/rules binary
 	dh binary
 	dpkg-deb: building package 'test' in '../test_1.0-2_all.deb'.
 	 dpkg-genchanges  >../test_1.0-2_${_ARCH}.changes
@@ -303,7 +309,7 @@ test_debuild_forcesign() {
 	dpkg-buildpackage: source changed by Testophilus Testownik <tester at testity.org>
 	 dpkg-source --before-build test
 	dpkg-buildpackage: host architecture ${_ARCH}
-	 fakeroot debian/rules clean
+	 ${FAKEROOT}debian/rules clean
 	dh clean
 	 dpkg-source -b test
 	dpkg-source: info: using source format '3.0 (quilt)'
@@ -312,7 +318,7 @@ test_debuild_forcesign() {
 	dpkg-source: info: building test in test_1.0-2.dsc
 	 debian/rules build
 	dh build
-	 fakeroot debian/rules binary
+	 ${FAKEROOT}debian/rules binary
 	dh binary
 	dpkg-deb: building package 'test' in '../test_1.0-2_all.deb'.
 	 dpkg-genchanges  >../test_1.0-2_${_ARCH}.changes

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



More information about the devscripts-devel mailing list