Package: debhelper
Version: 9.20120909
Severity: important
Tags: patch

Dear Maintainer,

Midweek, some of our packages in SprezzOS (a Debian derivative) started to be
built with incomplete or entirely missing Depends lines. You can read the saga
here:

     https://www.sprezzatech.com/bugs/show_bug.cgi?id=638

I traced it down this morning to line 118 of dh_shlibdeps, which was not
properly enumerating executables. You'll find there the find(1) predicate
"-perm +111". Consult the find manpage:


       -perm +mode
              Deprecated,  old way of searching for files with any of the
per‐
              mission bits in mode set.  You should use -perm  /mode  instead.
              Trying to use the `+' syntax with symbolic modes will yield
sur‐
              prising results.  For example, `+u+x' is a valid  symbolic  mode
              (equivalent to +u,+x, i.e. 0111) and will therefore not be
eval‐
              uated as -perm +mode but instead as  the  exact  mode  specifier
              -perm  mode  and so it matches files with exact permissions 0111
              instead of files with any execute bit set.  If  you  found  this
              paragraph  confusing,  you're  not alone - just use -perm /mode.
              This form of the -perm test  is  deprecated  because  the  POSIX
              specification  requires  the  interpretation of a leading `+' as
              being part of a symbolic mode, and so we switched to  using  `/'
              instead.

In SprezzOS, we're using findutils 4.5.11 rather than Debian Unstable's 4.4.2.
With this newer findutils, the -perm +111 test generates an empty list. I
downgraded to 4.4.2 and verified that this fixed the issue. I then applied the
attached patch to debhelper, and verified that packages were now properly built
using both versions of findutils. We now consider this bug closed.

Debian does not appear to see this problem yet. However, at some point you will
upgrade to some unknown version of findutils which exposes the issue. Since the
test as stands is deprectated, and the proper test exists in both versions, and
functions properly in both, I strongly urge you to apply my patch.

Thanks!

--rigorously, nick
Hacker in Charge, SprezzOS Project



-- System Information:
Debian Release: 1 (von Neumann)
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.7.6 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages debhelper depends on:
ii  binutils    2.23.1-SprezzOS1
ii  dpkg        1.16.9-SprezzOS1
ii  dpkg-dev    1.16.9-SprezzOS1
ii  file        5.11-SprezzOS1
ii  html2text   1.3.2a-15
ii  man-db      2.6.3-SprezzOS1
ii  perl        5.16.2-SprezzOS1
ii  po-debconf  1.0.16+nmu2

debhelper recommends no packages.

Versions of packages debhelper suggests:
pn  dh-make  <none>

-- no debconf information
diff -ur debhelper-pristine/dh_shlibdeps debhelper-9.20120909/dh_shlibdeps
--- debhelper-pristine/dh_shlibdeps	2013-02-09 15:15:56.406329132 -0500
+++ debhelper-9.20120909/dh_shlibdeps	2013-02-09 15:16:57.252994702 -0500
@@ -129,7 +129,7 @@
 	if (defined($dh{EXCLUDE_FIND}) && $dh{EXCLUDE_FIND} ne '') {
 		$find_options="! \\( $dh{EXCLUDE_FIND} \\)";
 	}
-	foreach my $file (split(/\n/,`find $tmp -type f \\( -perm +111 -or -name "*.so*" -or -name "*.cmxs" \\) $find_options -print`)) {
+	foreach my $file (split(/\n/,`find $tmp -type f \\( -perm -111 -or -name "*.so*" -or -name "*.cmxs" \\) $find_options -print`)) {
 		# Prune directories that contain separated debug symbols.
 		next if $file=~m!^\Q$tmp\E/usr/lib/debug/(lib|lib64|usr|bin|sbin|opt|dev|emul)/!;
 		# TODO this is slow, optimize. Ie, file can run once on

Reply via email to