Просмотр исходного кода

Use the numerical value of errno instead of a string in install-info
when checking if the locking error was due to an already existing
file, which is locale dependent, and die accordingly. Based on a patch
by Nicolas François. Closes: #199204, #210781

Guillem Jover лет назад: 20
Родитель
Сommit
d3d7d05207
3 измененных файлов с 13 добавлено и 2 удалено
  1. 7 0
      ChangeLog
  2. 4 0
      debian/changelog
  3. 2 2
      scripts/install-info.pl

+ 7 - 0
ChangeLog

@@ -1,3 +1,10 @@
+2006-05-04  Nicolas François  <nicolas.francois@centraliens.net>,
+	    Guillem Jover  <guillem@debian.org>
+
+	* scripts/install-info.pl: Use the numerical value of $! instead of
+	the string when checking if the locking error was due to an already
+	existing file, which is locale dependent, and die accordingly.
+
 2006-05-04  Nicolas François  <nicolas.francois@centraliens.net>
 
 	* scripts/install-info.pl: Add a new line after adding the last

+ 4 - 0
debian/changelog

@@ -49,6 +49,10 @@ dpkg (1.13.19~) UNRELEASED; urgency=low
   * Make install-info add a new line after adding the last entry at the
     end of the dir file, which makes the info readers able to see those
     last enties (Nicolas François). Closes: #164495
+  * Use the numerical value of errno instead of a string in install-info
+    when checking if the locking error was due to an already existing
+    file, which is locale dependent, and die accordingly. Based on a patch
+    by Nicolas François. Closes: #199204, #210781
 
  -- Jacobo Tarrio <jtarrio@debian.org>  Wed,  3 May 2006 11:50:59 +0200
 

+ 2 - 2
scripts/install-info.pl

@@ -273,8 +273,8 @@ if (!$nowrite && ( ! -e $dirfile || ! -s _ )) {
 }
 
 if (!$nowrite && !link($dirfile, "$dirfile.lock")) {
-    print STDERR "$name: failed to lock dir for editing! $!\n".
-        ($! =~ m/exists/i ? "try deleting $dirfile.lock ?\n" : '');
+    die "$name: failed to lock dir for editing! $!\n".
+        ($! == EEXIST ? "try deleting $dirfile.lock ?\n" : '');
 }
 
 open(OLD, $dirfile) || &ulquit("open $dirfile: $!");