From e6b3ba49d0e1504966eaeb58dca280ea3c8310bc Mon Sep 17 00:00:00 2001 From: Niels Thykier Date: Sun, 18 Feb 2018 07:50:12 +0000 Subject: dh_testroot: root_requirements() no longer read d/control Signed-off-by: Niels Thykier --- debian/changelog | 5 +++++ dh_testroot | 8 +++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index e35498e9..a99e0df0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,6 +11,11 @@ debhelper (11.1.5) UNRELEASED; urgency=medium of the "C.UTF-8" locale. * autoscripts/postinst-systemd-restart: Apply patch from Christoph Biedl to fix indentation. (Closes: #890373) + * dh_testroot: With the advent of DEB_RULES_REQUIRES_ROOT, it + no longer needs to read debian/control to tell whether root + is needed or not. However, the warning remains for calling + dh_testroot outside the source root (as we may need to check + the compat level in a future version of debhelper). -- Niels Thykier Sun, 04 Feb 2018 18:03:34 +0000 diff --git a/dh_testroot b/dh_testroot index 4fbd18fe..fca7cb1a 100755 --- a/dh_testroot +++ b/dh_testroot @@ -50,11 +50,9 @@ our $VERSION = DH_BUILTIN_VERSION; inhibit_log(); -my $requirements = 'legacy-root'; +my $requirements = Debian::Debhelper::Dh_Lib::root_requirements(); -if (-f 'debian/control') { - $requirements = Debian::Debhelper::Dh_Lib::root_requirements(); -} else { +if (! -f 'debian/control') { warning('dh_testroot must be called from the source root'); } @@ -67,7 +65,7 @@ if ($requirements eq 'legacy-root') { error("You must run this as root (or use fakeroot)."); } else { my $env = $ENV{DEB_GAIN_ROOT_CMD}; - error("Package needs targetted root but builder has not provided a gain-root command via \${DEB_GAIN_ROOT_CMD}") + error("Package needs targeted root but builder has not provided a gain-root command via \${DEB_GAIN_ROOT_CMD}") if not $env; } -- cgit v1.2.3