[debhelper-devel] [Git][debian/debhelper][master] dh_testroot: root_requirements() no longer read d/control

Niels Thykier gitlab at salsa.debian.org
Sun Feb 18 07:52:31 UTC 2018


Niels Thykier pushed to branch master at Debian / debhelper


Commits:
e6b3ba49 by Niels Thykier at 2018-02-18T07:50:12+00:00
dh_testroot: root_requirements() no longer read d/control

Signed-off-by: Niels Thykier <niels at thykier.net>

- - - - -


2 changed files:

- debian/changelog
- dh_testroot


Changes:

=====================================
debian/changelog
=====================================
--- 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 at thykier.net>  Sun, 04 Feb 2018 18:03:34 +0000
 


=====================================
dh_testroot
=====================================
--- 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;
 }
 



View it on GitLab: https://salsa.debian.org/debian/debhelper/commit/e6b3ba49d0e1504966eaeb58dca280ea3c8310bc

---
View it on GitLab: https://salsa.debian.org/debian/debhelper/commit/e6b3ba49d0e1504966eaeb58dca280ea3c8310bc
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/debhelper-devel/attachments/20180218/d462b822/attachment-0001.html>


More information about the debhelper-devel mailing list