Subject: Bug#3992: install-info shouldn't try to lock the dir file during --test

From: "Darren/Torin/Who Ever..." <[email-masked]>
Date: 31 Jul 1996 23:48:43 -0700

Package: dpkg
Version: 1.2.12elf

If you run install-info in --test mode, it still tries to lock the
/usr/info/dir file.  If you don't happen to currently have write
permission there, it fails.

Here's a unified diff that fixes this:
(this message is unsigned since it screws with the diff below.  I need
to integrate tm into xemacs.)
--- /usr/sbin/install-info.orig	Thu Jul 25 19:56:28 1996
+++ /usr/sbin/install-info	Thu Jul 25 23:08:33 1996
@@ -205,7 +205,7 @@
     }
 }
 
-if (!link("$infodir/dir","$infodir/dir.lock")) {
+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" : '');
 }
@@ -335,9 +335,8 @@
         &ulquit("$name: cannot backup old $infodir/dir, giving up: $!\n");
     rename("$infodir/dir.new","$infodir/dir") ||
         &ulquit("$name: install new $infodir/dir: $!\n");
-}
-
 unlink("$infodir/dir.lock") || die "$name: unlock $infodir/dir: $!\n";
+}
 
 sub ulquit {
     unlink("$infodir/dir.lock") ||

-- 
<[email-masked]> <http://www.daft.com/~torin> <[email-masked]> <[email-masked]>
Darren Stalder/2608 Second Ave, @282/Seattle, WA 98121-1212/USA/+1-800-921-4996
@ Do you have your clothes on? I probably don't. Take yours off. Feel better. @
@ Sysadmin, webweaver, postmaster for hire.  C/Perl/CGI programmer and tutor. @