[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#469925: lintian: doesn't allow root directory to be specified with a relative path



Package: lintian
Version: 1.23.46
Severity: minor

Lintian doesn't seem to support that its root directory is specified
using a relative path. For example, the following command works fine:

$ lintian --root /usr/share/lintian/ ~/lintian_1.23.46_all.deb

However, these commands fail:

$ cd /usr/share/lintian/
$ lintian --root . ~/lintian_1.23.46_all.deb
Can't exec "./collection/override-file": No such file or directory at lib/Pipeline.pm line 124.
internal error: collect info override-file about package lintian: 65280
N: Skipping check of binary package lintian

This isn't a big want, but it could perhaps be useful to be allowed to
do this when working with multiple versions of Lintian. The following
simple patch is supposed to add support for it.

diff -Naur a/frontend/lintian b/frontend/lintian
--- a/frontend/lintian	2008-03-03 05:09:07.000000000 +0000
+++ b/frontend/lintian	2008-03-06 00:57:09.000000000 +0000
@@ -295,10 +295,16 @@
 GetOptions(%opthash)
     or die("error parsing options\n");
 
+# determine current working directory--we'll need this later
+chop($cwd = `pwd`);
+
 # determine LINTIAN_ROOT if it was not set with --root.
 $LINTIAN_ROOT = $LINTIAN_ROOT || $ENV{'LINTIAN_ROOT'};
-if (defined $LINTIAN_ROOT) { # see if it has a frontend directory
-    if (-d "$LINTIAN_ROOT/frontend") {
+if (defined $LINTIAN_ROOT) {
+    unless ($LINTIAN_ROOT =~ m,^/,) {
+	$LINTIAN_ROOT = "$cwd/$LINTIAN_ROOT";
+    }
+    if (-d "$LINTIAN_ROOT/frontend") { # see if it has a frontend directory
         $lintian_info_cmd = "$LINTIAN_ROOT/frontend/lintian-info";
     }
 } else {
@@ -340,9 +346,6 @@
     print STDERR "warning: lintian's authors do not recommend running it with root privileges!\n";
 }
 
-# determine current working directory--we'll need this later
-chop($cwd = `pwd`);
-
 # search for configuration file if it was not set with --cfg
 # do not search the default locations if it was set.
 if ($LINTIAN_CFG) {

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (500, 'testing'), (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.22-2-686 (SMP w/2 CPU cores)
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/bash

Versions of packages lintian depends on:
ii  binutils            2.18.1~cvs20080103-1 The GNU assembler, linker and bina
ii  diffstat            1.45-2               produces graph of changes introduc
ii  dpkg-dev            1.14.16.6            package building tools for Debian
ii  file                4.23-2               Determines file type using "magic"
ii  gettext             0.17-2               GNU Internationalization utilities
ii  intltool-debian     0.35.0+20060710.1    Help i18n of RFC822 compliant conf
ii  libparse-debianchan 1.1.1-2              parse Debian changelogs and output
ii  liburi-perl         1.35.dfsg.1-1        Manipulates and accesses URI strin
ii  man-db              2.5.1-2              on-line manual pager
ii  perl [libdigest-md5 5.8.8-12             Larry Wall's Practical Extraction 

lintian recommends no packages.

-- no debconf information

Reply to: