summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiels Thykier <niels@thykier.net>2022-12-15 08:52:22 +0000
committerNiels Thykier <niels@thykier.net>2022-12-15 08:52:22 +0000
commite41b7d15c4b005def732cb9f82ed14171499689d (patch)
tree163b667bce1dd951e75e727f7b31f20f7c3ffd7a
parent1c4a66881eec1fe86b275d9a8454ef60b27b9622 (diff)
Stop using (fake)root for mkdirs again
Should have been removed as a part of the clean up in the previous upload but was overlooked causing breakage in packages still having `Rules-Requires-Root: binary-targets`. Closes: #1026125 Gbp-Dch: Full Signed-off-by: Niels Thykier <niels@thykier.net>
-rwxr-xr-xdh_strip2
-rw-r--r--doc/PROGRAMMING.md7
-rw-r--r--lib/Debian/Debhelper/Dh_Lib.pm16
3 files changed, 7 insertions, 18 deletions
diff --git a/dh_strip b/dh_strip
index a7c21491..5cd32c10 100755
--- a/dh_strip
+++ b/dh_strip
@@ -251,7 +251,7 @@ sub write_buildid_file {
my ($package, $build_ids) = @_;
my $dir = "debian/.debhelper/${package}";
my $path = "${dir}/dbgsym-build-ids";
- mkdirs($dir);
+ install_dir($dir);
open(my $fd, '>>', $path) or error("open $path failed: $!");
print {$fd} join(q{ }, sort(@{$build_ids})) . ' ';
close($fd) or error("close $path failed: $!");
diff --git a/doc/PROGRAMMING.md b/doc/PROGRAMMING.md
index 4f47e648..69be8daa 100644
--- a/doc/PROGRAMMING.md
+++ b/doc/PROGRAMMING.md
@@ -387,10 +387,9 @@ The following keys are also set in the `%dh` hash when you call `init()`:
The `install_dir` function should be used for directories
installed in a final package while `mkdirs` should be used
- for other directories. The difference is that `install_dir`
- will attempt to chown the directory to `root:root` if required
- whereas `mkdirs` will not. The `mkdirs` function requires
- `debhelper (>= 13.11~)`.
+ for other directories. The difference is related to whether
+ the change will be shown via -v/--verbose or not. The
+ `mkdirs` function requires `debhelper (>= 13.11~)`.
- `install_file($src, $dest)`
diff --git a/lib/Debian/Debhelper/Dh_Lib.pm b/lib/Debian/Debhelper/Dh_Lib.pm
index 63cd1476..7cf59e03 100644
--- a/lib/Debian/Debhelper/Dh_Lib.pm
+++ b/lib/Debian/Debhelper/Dh_Lib.pm
@@ -671,18 +671,9 @@ sub error_exitcode {
sub _mkdirs {
- my ($maybe_chown, @dirs) = @_;
+ my ($log, @dirs) = @_;
return if not @dirs;
- my $do_chown = !$maybe_chown && should_use_root();
- if ($do_chown) {
- # Use the real install for the case that requires root. The error handling
- # of File::Path for this case seems a bit too fragile for my liking.
- # (E.g., chown failures are carp warnings rather than hard errors and
- # intercepting them via the error parameter does not seem to work so well)
- doit('install', '-m0755', '-o', '0', '-g', '0', '-d', @dirs);
- return;
- }
- if (not $maybe_chown && $dh{VERBOSE}) {
+ if ($log && $dh{VERBOSE}) {
verbose_print(sprintf('install -m0755 -d %s', escape_shell(@dirs)));
}
return 1 if $dh{NO_ACT};
@@ -713,8 +704,7 @@ sub mkdirs {
sub install_dir {
my @dirs = @_;
- my $maybe_chown = (defined($main::VERSION) && $main::VERSION eq DH_BUILTIN_VERSION) ? 1 : 0;
- return _mkdirs($maybe_chown, @dirs);
+ return _mkdirs(1, @dirs);
}
sub rename_path {