Your message dated Sat, 07 Apr 2018 19:34:21 +0000
with message-id <>
and subject line Bug#894549: fixed in debhelper 11.2
has caused the Debian Bug report #894549,
regarding debhelper: dh_usrlocal may remove a direct subdirectory of /usr/local
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact

Debian Bug Tracking System
Contact with problems
--- Begin Message ---
Package: debhelper
Version: 11.1.6
Severity: minor
Tags: patch


The attached script shows that dh_usrlocal generates a prerm script
removing a direct subdirectory of /usr/local.
As I understand the policy, it should not.

The fix is included.
It also suggests some minor related changes, which do not seem to change the 
--- a/dh_usrlocal
+++ b/dh_usrlocal
@@ -82,6 +82,8 @@
 		      wanted => sub {
 			my $fn = $File::Find::name;
 			if (-d $fn) {
+				return if $fn eq  "$tmp/usr/local";
 				my $user = 'root';
 				my $group = 'staff';
 				my $mode = '02775';
@@ -99,12 +101,13 @@
 				$fn =~ s!^\Q$tmp\E!!;
-				return if $fn eq '/usr/local';
-				# @dirs is in parents-first order for dir creation...
-				unshift @dirs, "$fn $mode $user $group";
-				# ...whereas @justdirs is depth-first for removal.
-				push @justdirs, $fn;
+				push @dirs, "$fn $mode $user $group";
+				# don't remove directories directly in /usr/local
+				if ($File::Find::dir ne "$tmp/usr/local") {
+					push @justdirs, $fn;
+				}
 				doit('rmdir', $_);
 			else {
@@ -118,11 +121,10 @@
 		# This constructs the body of a 'sed' c\ expression which
 		# is parsed by the shell in double-quotes
 		my $dirs = join("$ebs\n", sort @dirs);
-		pop @justdirs; # don't remove directories directly in /usr/local
 		my $justdirs = join("$ebs\n", reverse sort @justdirs);
 		if (! $dh{NOSCRIPTS}) { 
 			autoscript($package,"postinst", "postinst-usrlocal",
-				   "/#DIRS#/ c${ebs}\n${dirs}");
+				   "/#DIRS#/ c${ebs}\n${dirs}") if length $dirs;
 			autoscript($package,"prerm", "prerm-usrlocal",
 				   "/#JUSTDIRS#/ c${ebs}\n${justdirs}") if length $justdirs;

Description: Bourne shell script

--- End Message ---
--- Begin Message ---
Source: debhelper
Source-Version: 11.2

We believe that the bug you reported is fixed in the latest version of
debhelper, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
Niels Thykier <> (supplier of updated debhelper package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing

Hash: SHA256

Format: 1.8
Date: Sat, 07 Apr 2018 19:23:32 +0000
Source: debhelper
Binary: debhelper dh-systemd
Architecture: source
Version: 11.2
Distribution: unstable
Urgency: medium
Maintainer: Debhelper Maintainers <>
Changed-By: Niels Thykier <>
 debhelper  - helper programs for debian/rules
 dh-systemd - debhelper add-on to handle systemd unit files - transitional pack
Closes: 894549 894573 894666 894835 894895 895011 895044
 debhelper (11.2) unstable; urgency=medium
   [ Niels Thykier ]
   * debhelper.7: Add a ~ to the suggested Build-Depends to ensure
     backports also work for debhelper with single integer versions.
     Thanks to Trent W. Buck for the suggestion.  (Closes: #894666)
   * Use -Oline with make.  This avoids make mistaking
     a target name for a value for -O and should make build time
     outs less likely for "long" targets.  (Closes: #894573)
   * Fix bug that make debhelper trip on packages with
     the version "0".  Thanks to Chris Lamb for reporting the bug
     plus debugging the issue.  (Closes: #894895)
   * Rewrite to support build systems that generate
     build files for another build system (without using
     inheritance).  This enables generator build systems to have
     multiple backends.
   * Support ninja as alternative backend (by using the
     build system cmake+ninja).  Thanks to Kyle Edwards for the
     suggestion.  (Closes: #895044)
   * Rewrite as a generator build system with ninja as
     the only backend.
   * debhelper.7: Recommend packagers to use "debian/<pkg>.<file>"
     over "debian/<file>" in most cases.  Thanks to Johannes
     Schauer for the suggestion.
   * dh_usrlocal: Implement a simple guard for directories that
     will likely cause issues in the shell snippets.
   * dh_usrlocal: Use the new rules from Debian Policy 4.1.4 to
     determine the default ownership and mode for directories.
   * d/control: Bump Standards-Versions to 4.1.4.  Beyond the
     dh_usrlocal change listed above, no changes were required.
   [ Nicolas Boulenguez ]
   * dh_installxfonts: Fix typo that causes a misc:Depends on
     non-existing xfont-utils.  (Closes: #894835)
   * dh_installwm.1: Document --all.  (Closes: #895011)
   * dh_usrlocal: Fix bug where the generated prerm script generated
     by dh_usrlocal could remove a directory directly in /usr/local.
     (Closes: #894549)
   [ Mattia Rizzolo ]
   * Lower the version restrictions on dpkg and dpkg-dev.  They are not
     needed anymore, as R³ support is not implied anymore, but requires
     an environment variable to be passed.
 71d3f409fbca3c667cfa0809447e658f4de008da 1681 debhelper_11.2.dsc
 9f3ad653d486721186056cc9b897c8b3f682bf97 455608 debhelper_11.2.tar.xz
 9ebc288ca16fd9aaad22de04e3e0f33d9de935ba 4546 debhelper_11.2_source.buildinfo
 0da35b90fd65d17ef7a6ddaac472349e92ce6d3ffe6aa9163086add61a062cab 1681 
 bd726051ca3a488a3edaff925d9c5ca45c7a7b20dfcb62a381fb55b93ea2ee66 455608 
 6926e624cb4cff32507bf43e21d363a9e3206948ba18e30b96f93205545bd477 4546 
 849efbdc1e61126e1c410188f8e01dcd 1681 devel optional debhelper_11.2.dsc
 870ac4fd8278eaccbc3e276c0ba9fe5a 455608 devel optional debhelper_11.2.tar.xz
 28947d1df252254d30a65cb178d4d1e4 4546 devel optional 



--- End Message ---

Reply via email to