瀏覽代碼

update-alternatives: ignore empty files in the admin dir

* scripts/update-alternatives.pl: Deal with empty
files in the administrative directory by ignoring them.
Raphael Hertzog 17 年之前
父節點
當前提交
4a109a8bf4
共有 3 個文件被更改,包括 8 次插入0 次删除
  1. 5 0
      ChangeLog
  2. 2 0
      debian/changelog
  3. 1 0
      scripts/update-alternatives.pl

+ 5 - 0
ChangeLog

@@ -3,6 +3,11 @@
 	* lib/dpkg.h (ohshitvb): Remove function prototype.
 	* lib/ehandle.c (ohshitvb): Remove function definition.
 
+2009-02-06  Raphael Hertzog  <hertzog@debian.org>
+
+	* scripts/update-alternatives.pl: Deal with empty
+	files in the administrative directory by ignoring them.
+
 2009-02-06  Raphael Hertzog  <hertzog@debian.org>
 
 	* scripts/update-alternatives.pl: Ensure that a non-existant

+ 2 - 0
debian/changelog

@@ -135,6 +135,8 @@ dpkg (1.15.0) UNRELEASED; urgency=low
     alternative is removed (even in manual mode).
   * Ensure that update-alternative --install fix the links if the alternative
     installed is the one currently selected. Closes: #100135
+  * Let update-alternatives deal with empty files in its administrative
+    directory by ignoring them. Closes: #457863
 
   [ Pierre Habouzit ]
   * Add a --query option to update-alternatives. Closes: #336091, #441904

+ 1 - 0
scripts/update-alternatives.pl

@@ -126,6 +126,7 @@ sub badusage
 
 sub read_link_group
 {
+    return 1 if not -s "$admindir/$name"; # Ignore empty file
     if (open(AF, "$admindir/$name")) {
 	$mode = gl("update_mode");
 	$mode eq 'auto' || $mode eq 'manual' || badfmt(_g("invalid update mode"));