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

Bug#179192: dpkg: patch for install-info related bugs



Package: dpkg
Version: 1.9.21
Severity: important
Tags: patch

Please observe. This bug is filed against the woody-script-version.
The sid version of the install-info script includes modifications which
indicate _some_ bug fixes address the problems described below.

This simple patch should pinpoint and possibly cure some problems
which make install-info a _show stopper_ under certain conditions. One
of the bugs is over 6 years old :(

I tagged this bug 'important'. Should have been 'grave', but it would
be unfare to tag it as a 'grave' dpkg bug just because of
install-info.

The patch addresses bugs #2531, #3410, #160761, possibly others.

I also think it's _very unfortunate_ the Debian distributed
install-info perl script _does not_ emulate all the options the GNU
install-info provides (se option --dir-file in the patch).

It would be very interesting to find out _why_ a perl script is used
instead of GNU install-info. Please enlighten us!

Here's the patch:

--------------------------------------------------------------------------
--- install-info.pl.orig        Sat Feb  2 19:47:33 2002
+++ install-info.pl     Fri Jan 31 13:07:02 2003
@@ -19,7 +19,7 @@ usage: install-info [--version] [--help]
              [--section regexp title] [--infodir=xxx] [--align=nnn]
              [--calign=nnn] [--quiet] [--menuentry=xxx] [--info-dir=xxx]
              [--keep-old] [--description=xxx] [--test]
-             [--remove | --remove-exactly ]
+             [--remove | --remove-exactly ] [--dir-file]
              [--]
              filename
 END
@@ -87,6 +87,8 @@ while ($ARGV[0] =~ m/^--/) {
         $infodir=$';
     } elsif (m/^--description=/) {
         $description=$';
+    } elsif (m/^--dir-file=/) { # for compatibility with GNU install-info
+        $infodir=$';
     } else {
         print STDERR "$name: unknown option \`$_'\n"; &usage; exit 1;
     }
@@ -241,6 +243,9 @@ $name: unable to determine description f
     }
 }

+# FIXME: the fact that "$infodir/dir" does not exis should not cause
+#       the script failure. A minimal "$infodir/dir" should be created.
+#       Problems related to bugs #2531, #3410, possibly others.
 if (!$nowrite && !link("$infodir/dir","$infodir/dir.lock")) {
     die "$name: failed to lock dir for editing! $!\n".
         ($! =~ m/exists/i ? "try deleting $infodir/dir.lock ?\n" : '');
@@ -250,7 +255,9 @@ open(OLD,"$infodir/dir") || &ulquit("ope
 @work= <OLD>;
 eof(OLD) || &ulquit("read $infodir/dir: $!");
 close(OLD) || &ulquit("close $infodir/dir after read: $!");
-while ($work[$#work] !~ m/\S/) { $#work--; }
+
+# Problems related to bugs #2531, #3410, #160761, possibly others
+while (($#work >= 0) && ($work[$#work] !~ m/\S/)) { $#work--; }

 while (@work) {
     $_= shift(@work);
--------------------------------------------------------------------------


Cheers,
Cristian

-- System Information
Debian Release: 3.0
Architecture: i386
Kernel: Linux my-box 2.4.20-686 #1 Mon Jan 13 12:59:29 EST 2003 i686
Locale: LANG=C, LC_CTYPE=

Versions of packages dpkg depends on:
ii  libc6                  2.2.5-11.2        GNU C Library: Shared libraries an
ii  libncurses5            5.2.20020112a-7   Shared libraries for terminal hand
ii  libstdc++2.10-glibc2.2 1:2.95.4-11woody1 The GNU stdc++ library



Reply to: