Bug#196361: Preparing patch
tags 196361 patch
thanks
On Sun, Aug 24, 2003 at 12:40:29PM +0200, Frank Lichtenheld wrote:
> Hi.
>
> Just wanted to say that I'm preparing a patch for this issue (since I
> could not claim it).
> If someone other is working on this, please scream ;)
Too late ;)
I propose a patch for this issue:
It not only tries to pull in a backup file but also tries to copy the
default file from the base-files package. If there isn't a default
file, I think it is best to quit with an error. Or is it not safe to
assume that base-files will be unpacked before any package is calling
install-info?
diff against v1_10 branch attached.
Gruesse,
--
*** Frank Lichtenheld <frank@lichtenheld.de> ***
*** http://www.djpig.de/ ***
see also: - http://www.usta.de/
- http://fachschaft.physik.uni-karlsruhe.de/
Index: install-info.pl
===================================================================
RCS file: /cvs/dpkg/dpkg/scripts/install-info.pl,v
retrieving revision 1.12.2.2
diff -u -b -r1.12.2.2 install-info.pl
--- install-info.pl 5 Sep 2002 21:31:55 -0000 1.12.2.2
+++ install-info.pl 24 Aug 2003 11:44:26 -0000
@@ -31,6 +31,7 @@
$maxwidth=79;
$Text::Wrap::columns=$maxwidth;
$backup='/var/backups/infodir.bak';
+$default='/usr/share/base-files/info.dir';
$menuentry="";
$description="";
@@ -253,9 +254,19 @@
exit 1;
}
} else {
- print STDERR "$name: no backup file $backup available, giving up.\n";
+ if (-r $default) {
+ print STDERR "$name: no backup file $backup available, retrieving default file.\n";
+
+ if (system("cp $default $infodir/dir")) {
+ print STDERR "$name: copying $default to $infodir/dir failed, giving up: $!\n";
exit 1;
}
+ } else {
+ print STDERR "$name: no backup file $backup available.\n";
+ print STDERR "$name: no default file $default available, giving up.\n";
+ exit 1;
+ }
+ }
}
if (!$nowrite && !link("$infodir/dir","$infodir/dir.lock")) {
@@ -267,7 +278,7 @@
@work= <OLD>;
eof(OLD) || &ulquit("read $infodir/dir: $!");
close(OLD) || &ulquit("close $infodir/dir after read: $!");
-while ($work[$#work] !~ m/\S/) { $#work--; }
+while ($work[$#work] !~ m/\S/) { $#work--; last unless $#work; }
while (@work) {
$_= shift(@work);
Reply to: