summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiels Thykier <niels@thykier.net>2018-02-18 07:50:12 +0000
committerNiels Thykier <niels@thykier.net>2018-02-18 07:50:12 +0000
commite6b3ba49d0e1504966eaeb58dca280ea3c8310bc (patch)
tree4c9a09c73d43ef2d4b87c58f2baa272ee3581220
parent9986bc5c1ea30c8c4df51605b4f3916825aa263a (diff)
downloaddebhelper-e6b3ba49d0e1504966eaeb58dca280ea3c8310bc.tar.gz
dh_testroot: root_requirements() no longer read d/control
Signed-off-by: Niels Thykier <niels@thykier.net>
-rw-r--r--debian/changelog5
-rwxr-xr-xdh_testroot8
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 <niels@thykier.net> 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;
}