Bug#360216: lintian: maintainer-script-built-with-broken-debhelper-version fires in non-debhelper case

2006-03-31 Thread Marc Haber
Package: lintian
Version: 1.23.16
Severity: normal

maintainer-script-built-with-broken-debhelper-version is reported if
the construct invoke-rc.d.*exit 0 is found in any maintainer script.

In my case, this was not from debhelper, but the offending code was in
the maintainer script from the package proper.

The --info text should say how exactly the test was done, and that
an outdated debhelper is not the only cause of this warning.

Greetings
Marc

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'stable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.16.1-zgsrv
Locale: LANG=C, LC_CTYPE=de_DE (charmap=ISO-8859-1)

Versions of packages lintian depends on:
ii  binutils 2.16.1cvs20060117-1 The GNU assembler, linker and bina
ii  diffstat 1.41-1  produces graph of changes introduc
ii  dpkg-dev 1.13.17 package building tools for Debian
ii  file 4.17-1  Determines file type using magic
ii  gettext  0.14.5-2GNU Internationalization utilities
ii  intltool-debian  0.34.2+20060322 Help i18n of RFC822 compliant conf
ii  libparse-debianchang 1.0-1   parse Debian changelogs and output
ii  man-db   2.4.3-3 The on-line manual pager
ii  perl [libdigest-md5- 5.8.8-3 Larry Wall's Practical Extraction 

lintian recommends no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#360217: lintian: should clean invocation environment

2006-03-31 Thread Marc Haber
Package: lintian
Version: 1.23.16
Severity: normal

I have CDPATH set in my environment. This causes cd to print the new
working directory, which in turn confuses lintian's
has-errors-from-man detector so that a bogus error is reported.

lintian should clean its environment before doing any tests that use a
shell.

Greetings
Marc

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'stable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.16.1-zgsrv
Locale: LANG=C, LC_CTYPE=de_DE (charmap=ISO-8859-1)

Versions of packages lintian depends on:
ii  binutils 2.16.1cvs20060117-1 The GNU assembler, linker and bina
ii  diffstat 1.41-1  produces graph of changes introduc
ii  dpkg-dev 1.13.17 package building tools for Debian
ii  file 4.17-1  Determines file type using magic
ii  gettext  0.14.5-2GNU Internationalization utilities
ii  intltool-debian  0.34.2+20060322 Help i18n of RFC822 compliant conf
ii  libparse-debianchang 1.0-1   parse Debian changelogs and output
ii  man-db   2.4.3-3 The on-line manual pager
ii  perl [libdigest-md5- 5.8.8-3 Larry Wall's Practical Extraction 

lintian recommends no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#360214: lintian: typo in maintainer-script-built-with-broken-debhelper-version

2006-03-31 Thread Marc Haber
Package: lintian
Version: 1.23.16
Severity: minor

 N:   This packag was built with a debhelper version suffering from #337664.

There is an e missing.

Greetings
Marc

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'stable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.16.1-zgsrv
Locale: LANG=C, LC_CTYPE=de_DE (charmap=ISO-8859-1)

Versions of packages lintian depends on:
ii  binutils 2.16.1cvs20060117-1 The GNU assembler, linker and bina
ii  diffstat 1.41-1  produces graph of changes introduc
ii  dpkg-dev 1.13.17 package building tools for Debian
ii  file 4.17-1  Determines file type using magic
ii  gettext  0.14.5-2GNU Internationalization utilities
ii  intltool-debian  0.34.2+20060322 Help i18n of RFC822 compliant conf
ii  libparse-debianchang 1.0-1   parse Debian changelogs and output
ii  man-db   2.4.3-3 The on-line manual pager
ii  perl [libdigest-md5- 5.8.8-3 Larry Wall's Practical Extraction 

lintian recommends no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Lintian adaptation to Ubuntu

2006-03-31 Thread Marc 'HE' Brockschmidt
Jeroen van Wolffelaar [EMAIL PROTECTED] writes:
[...]
 Other lintian devs opinions? About -D, and about even maybe even adding
 it as no-op option?

I think a no-op would be a nice touch. Perhaps with a little hint how to
change the behaviour for derivatives, so that other distributions
besides Ubuntu can modify lintian for their special needs.

Marc
-- 
BOFH #353:
Second-sytem effect.


pgp9GQIewtnQe.pgp
Description: PGP signature


lintian: r597 - in trunk: checks debian testset testset/maintainer-scripts/debian

2006-03-31 Thread rra
Author: rra
Date: 2006-04-01 08:01:57 +0200 (Sat, 01 Apr 2006)
New Revision: 597

Modified:
   trunk/checks/scripts
   trunk/checks/scripts.desc
   trunk/debian/changelog
   trunk/testset/maintainer-scripts/debian/postinst
   trunk/testset/tags.maintainer-scripts
Log:
* checks/scripts.desc:
  + [RA] Change the check for broken error handling with invoke-rc.d to
maintainer-script-hides-init-failure to be more generic and explain
what the test looks at.  Add the script name and line number and fix
a typo.  Thanks, Marc Haber.  (Closes: #360214, #360216)

Modified: trunk/checks/scripts
===
--- trunk/checks/scripts2006-03-30 03:39:36 UTC (rev 596)
+++ trunk/checks/scripts2006-04-01 06:01:57 UTC (rev 597)
@@ -540,7 +540,7 @@
}
}
if (/invoke-rc.d.*\|\| exit 0/) {
-   tag maintainer-script-built-with-broken-debhelper-version;
+   tag maintainer-script-hides-init-failure, $file:$.;
}
 }
 

Modified: trunk/checks/scripts.desc
===
--- trunk/checks/scripts.desc   2006-03-30 03:39:36 UTC (rev 596)
+++ trunk/checks/scripts.desc   2006-04-01 06:01:57 UTC (rev 597)
@@ -287,8 +287,13 @@
  Using . as a separator is still supported by the GNU tools, but it will
  fail as soon as a system uses the . in user or group names.
 
-Tag: maintainer-script-built-with-broken-debhelper-version
+Tag: maintainer-script-hides-init-failure
 Type: warning
-Info: This packag was built with a debhelper version suffering from #337664.
- The package needs to be reuploaded (could be bin-NMUd, no source changes
- needed)
+Info: This script calls invoke-rc.d to run an init script but then, if the
+ init script fails, exits successfully (using || exit 0).  If the init
+ script fails, the maintainer script should probably fail.
+ .
+ The most likely cause of this problem is that the package was built with
+ a debhelper version suffering from Bug#337664 that inserted incorrect
+ invoke-rc.d code in the generated maintainer script. The package needs to
+ be reuploaded (could be bin-NMUd, no source changes needed).

Modified: trunk/debian/changelog
===
--- trunk/debian/changelog  2006-03-30 03:39:36 UTC (rev 596)
+++ trunk/debian/changelog  2006-04-01 06:01:57 UTC (rev 597)
@@ -14,8 +14,13 @@
   are now too many combinations to list completely.
 + [RA] Catch build dependencies on X metapackages, based on a patch by
   Josh Triplett.  (Partially addresses #347169)
+  * checks/scripts.desc:
++ [RA] Change the check for broken error handling with invoke-rc.d to
+  maintainer-script-hides-init-failure to be more generic and explain
+  what the test looks at.  Add the script name and line number and fix
+  a typo.  Thanks, Marc Haber.  (Closes: #360214, #360216)
 
- -- Russ Allbery [EMAIL PROTECTED]  Sun, 26 Mar 2006 16:16:55 -0800
+ -- Russ Allbery [EMAIL PROTECTED]  Fri, 31 Mar 2006 22:00:45 -0800
 
 lintian (1.23.16) unstable; urgency=low
 

Modified: trunk/testset/maintainer-scripts/debian/postinst
===
--- trunk/testset/maintainer-scripts/debian/postinst2006-03-30 03:39:36 UTC 
(rev 596)
+++ trunk/testset/maintainer-scripts/debian/postinst2006-04-01 06:01:57 UTC 
(rev 597)
@@ -50,3 +50,6 @@
 echo foo /tmp/scripts.tmp
 rm /tmp/scripts.tmp
 rmdir /var/tmp/scripts
+
+# invalid, maintainer-script-hides-init-failure
+invoke-rc.d foo start || exit 0

Modified: trunk/testset/tags.maintainer-scripts
===
--- trunk/testset/tags.maintainer-scripts   2006-03-30 03:39:36 UTC (rev 
596)
+++ trunk/testset/tags.maintainer-scripts   2006-04-01 06:01:57 UTC (rev 
597)
@@ -25,6 +25,7 @@
 W: maintainer-scripts: deprecated-chown-usage postinst:33 'chown root.root'
 W: maintainer-scripts: init.d-script-not-marked-as-conffile /etc/init.d/foo
 W: maintainer-scripts: maintainer-script-calls-deprecated-wm-menu-config 
postinst:31
+W: maintainer-scripts: maintainer-script-hides-init-failure postinst:55
 W: maintainer-scripts: missing-debconf-dependency
 W: maintainer-scripts: no-debconf-templates
 W: maintainer-scripts: possible-bashism-in-maintainer-script postinst:15 '. 
/usr/share/lintian/shell foo'


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Processed: Lintian bugs fixed in revision r597

2006-03-31 Thread Debian Bug Tracking System
Processing commands for [EMAIL PROTECTED]:

 package lintian
Ignoring bugs not assigned to: lintian

 # Fixed in r597 by rra
 tag 360214 + pending
Bug#360214: lintian: typo in 
maintainer-script-built-with-broken-debhelper-version
There were no tags set.
Tags added: pending

 tag 360216 + pending
Bug#360216: lintian: maintainer-script-built-with-broken-debhelper-version 
fires in non-debhelper case
There were no tags set.
Tags added: pending

 thanks
Stopping processing here.

Please contact me if you need assistance.

Debian bug tracking system administrator
(administrator, Debian Bugs database)


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#360216: lintian: maintainer-script-built-with-broken-debhelper-version fires in non-debhelper case

2006-03-31 Thread Russ Allbery
Marc Haber [EMAIL PROTECTED] writes:

 Package: lintian
 Version: 1.23.16
 Severity: normal

 maintainer-script-built-with-broken-debhelper-version is reported if
 the construct invoke-rc.d.*exit 0 is found in any maintainer script.

 In my case, this was not from debhelper, but the offending code was in
 the maintainer script from the package proper.

 The --info text should say how exactly the test was done, and that
 an outdated debhelper is not the only cause of this warning.

I'm going to go ahead and change the tag to:

maintainer-script-hides-init-failure

instead to be more generic and note in the description the likely
debhelper cause.  Thanks for the report!

-- 
Russ Allbery ([EMAIL PROTECTED])   http://www.eyrie.org/~eagle/


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



lintian: r598 - in trunk: checks collection debian lib

2006-03-31 Thread rra
Author: rra
Date: 2006-04-01 08:46:55 +0200 (Sat, 01 Apr 2006)
New Revision: 598

Modified:
   trunk/checks/manpages
   trunk/checks/po-debconf
   trunk/collection/objdump-info
   trunk/debian/changelog
   trunk/lib/Util.pm
Log:
* checks/manpages:
  + [RA] Use system_env instead of system and sanitize the environment
before running man -l out of caution and to avoid extraneous output
when CDPATH is set.  Reported by Marc Haber.  (Closes: #360217)
* checks/po-debconf:
  + [RA] Use system_env instead of system out of caution and to avoid
extraneous output when CDPATH is set.
* collection/objdump-info:
  + [RA] Unset CDPATH before running cd to avoid strange effects from
the user's environment.
* lib/Util.pm:
  + [RA] Add system_env, like system but sanitizing the environment.

Modified: trunk/checks/manpages
===
--- trunk/checks/manpages   2006-04-01 06:01:57 UTC (rev 597)
+++ trunk/checks/manpages   2006-04-01 06:46:55 UTC (rev 598)
@@ -235,7 +235,7 @@
# negatives. When man-db is fixed, this limitation should be
# removed.
if ($path =~ m,/man/man\d/,) {
-   if (system(lexgrog unpacked/\Q$file\E /dev/null 21)) {
+   if (system_env(lexgrog unpacked/\Q$file\E /dev/null 21)) {
tag manpage-has-bad-whatis-entry, $file;
}
}
@@ -244,14 +244,22 @@
# parent directory before running man so that .so directives are
# processed properly.  (Yes, there are man pages that include other
# pages with .so but aren't simple links; rbash, for instance.)
-my $cmd;
-if ($file =~ m,^(.*)/(man\d/.*)$,) {
-$cmd = cd unpacked/\Q$1\E  LANG=C man -l \Q$2\E;
-} else {
-$cmd = LANG=C man -l unpacked/\Q$file\E;
-}
-   open MANERRS, '-|', ($cmd /dev/null) 21
-   or fail(cannot run man -l: $!);
+   my $cmd;
+   if ($file =~ m,^(.*)/(man\d/.*)$,) {
+   $cmd = cd unpacked/\Q$1\E  man -l \Q$2\E;
+   } else {
+   $cmd = man -l unpacked/\Q$file\E;
+   }
+   my $pid = open MANERRS, '-|';
+   if (not defined $pid) {
+   fail(cannot run man -l: $!);
+   } elsif ($pid == 0) {
+   my %newenv = (LANG = 'C', PATH = $ENV{PATH});
+   undef %ENV;
+   %ENV = %newenv;
+   exec ($cmd /dev/null) 21
+   or fail(cannot run man -l: $!);
+   }
while (MANERRS) {
# ignore progress information from man
next if /^Reformatting/;

Modified: trunk/checks/po-debconf
===
--- trunk/checks/po-debconf 2006-04-01 06:01:57 UTC (rev 597)
+++ trunk/checks/po-debconf 2006-04-01 06:46:55 UTC (rev 598)
@@ -76,8 +76,8 @@
 if (-x /usr/bin/msgcmp  -x /usr/share/intltool-debian/intltool-update ) {
if ($missing_files == 0) {
$ENV{INTLTOOL_EXTRACT} ||= 
/usr/share/intltool-debian/intltool-extract;
-   system(cd debfiles/po  
/usr/share/intltool-debian/intltool-update --gettext-package=test --pot);
-   system(/usr/bin/msgcmp debfiles/po/test.pot 
debfiles/po/templates.pot /dev/null 21) == 0
+   system_env(cd debfiles/po  
/usr/share/intltool-debian/intltool-update --gettext-package=test --pot);
+   system_env(/usr/bin/msgcmp debfiles/po/test.pot 
debfiles/po/templates.pot /dev/null 21) == 0
or tag newer-debconf-templates;
}
 } else {
@@ -106,7 +106,7 @@
 }
 tag unknown-encoding-in-po-file, debian/po/$file
 unless length($charset);
-   system(msgfmt -o /dev/null debfiles/po/$file 2/dev/null) == 0
+   system_env(msgfmt -o /dev/null debfiles/po/$file 2/dev/null) == 0
or tag invalid-po-file, debian/po/$file;
 }
 

Modified: trunk/collection/objdump-info
===
--- trunk/collection/objdump-info   2006-04-01 06:01:57 UTC (rev 597)
+++ trunk/collection/objdump-info   2006-04-01 06:46:55 UTC (rev 598)
@@ -30,6 +30,7 @@
 exit 2
 fi
 
+CDPATH=
 cd unpacked
 
 rm -f ../objdump-info

Modified: trunk/debian/changelog
===
--- trunk/debian/changelog  2006-04-01 06:01:57 UTC (rev 597)
+++ trunk/debian/changelog  2006-04-01 06:46:55 UTC (rev 598)
@@ -14,14 +14,28 @@
   are now too many combinations to list completely.
 + [RA] Catch build dependencies on X metapackages, based on a patch by
   Josh Triplett.  (Partially addresses #347169)
+  * checks/manpages:
++ [RA] Use system_env instead of system and sanitize the environment
+  before running man -l out of caution and to avoid extraneous output
+  when CDPATH is set.  Reported by Marc Haber.  (Closes: #360217)
+  * checks/po-debconf:
++ [RA] Use system_env instead of system 

Bug#360217: lintian: should clean invocation environment

2006-03-31 Thread Russ Allbery
Marc Haber [EMAIL PROTECTED] writes:

 Package: lintian
 Version: 1.23.16
 Severity: normal

 I have CDPATH set in my environment. This causes cd to print the new
 working directory, which in turn confuses lintian's has-errors-from-man
 detector so that a bogus error is reported.

 lintian should clean its environment before doing any tests that use a
 shell.

Good catch.  Fixing this now, fairly comprehensively.  You would have
potentially had the same problem with one of the po-debconf checks, and
you may have been seeing extraneous output in the collection phase from
objdump-info.

-- 
Russ Allbery ([EMAIL PROTECTED])   http://www.eyrie.org/~eagle/


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Processed: Lintian bugs fixed in revision r598

2006-03-31 Thread Debian Bug Tracking System
Processing commands for [EMAIL PROTECTED]:

 package lintian
Ignoring bugs not assigned to: lintian

 # Fixed in r598 by rra
 tag 360217 + pending
Bug#360217: lintian: should clean invocation environment
There were no tags set.
Tags added: pending

 thanks
Stopping processing here.

Please contact me if you need assistance.

Debian bug tracking system administrator
(administrator, Debian Bugs database)


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#360227: lintian: check for gksu in menu-command-not-in-package

2006-03-31 Thread Russ Allbery
Colin Watson [EMAIL PROTECTED] writes:

 Package: lintian
 Version: 1.23.16
 Severity: wishlist

 W: bum: menu-command-not-in-package /usr/share/menu/bum:4 /usr/bin/gksu

 Since gksu's really an adverb rather than something we normally expect
 to find in the package itself, I think it should be handled a bit like
 su-to-root (and kdesu should probably be the same, IIRC). I suggest that
 if the menu file uses gksu, then we should (a) check for a dependency on
 gksu, (b) check that the command following gksu is in the package.

I agree that the lintian warning is wrong.  However, why wouldn't using
gksu or kdesu in this situation be a warning themselves since su-to-root
knows how to invoke them when appropriate?  My preferred fix would be to
check for use of gksu, kdesu, or sux at the beginning of the command and,
in that case, emit a different warning telling package maintainers to just
use su-to-root.

I suppose that may not do the right thing if the maintainer is really sure
they want to force a *particular* interface, but is that something people
are likely to want to do?  It looks like the wrong thing to do for bum.

-- 
Russ Allbery ([EMAIL PROTECTED])   http://www.eyrie.org/~eagle/


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]