소스 검색

update-alternatives: remove unneeded slavelinks in --set/--config too

* scripts/update-alternatives.pl (set_links): Remove slavelinks
if needed as well. We create slave links automatically, we should
remove them in the same way. Otherwise --config or --set will let
dangling symlinks on the system.
Raphael Hertzog 17 년 전
부모
커밋
7994776cc4
3개의 변경된 파일과 10개의 추가작업 그리고 0개의 파일을 삭제
  1. 7 0
      ChangeLog
  2. 2 0
      debian/changelog
  3. 1 0
      scripts/update-alternatives.pl

+ 7 - 0
ChangeLog

@@ -3,6 +3,13 @@
 	* lib/dpkg.h (ohshitvb): Remove function prototype.
 	* lib/dpkg.h (ohshitvb): Remove function prototype.
 	* lib/ehandle.c (ohshitvb): Remove function definition.
 	* lib/ehandle.c (ohshitvb): Remove function definition.
 
 
+2009-02-06  Raphael Hertzog  <hertzog@debian.org>
+
+	* scripts/update-alternatives.pl (set_links): Remove slavelinks
+	if needed as well. We create slave links automatically, we should
+	remove them in the same way. Otherwise --config or --set will let
+	dangling symlinks on the system.
+
 2009-02-06  Guillem Jover  <guillem@debian.org>
 2009-02-06  Guillem Jover  <guillem@debian.org>
 
 
 	* man/deb.5: Add detailed information of the currently supported
 	* man/deb.5: Add detailed information of the currently supported

+ 2 - 0
debian/changelog

@@ -129,6 +129,8 @@ dpkg (1.15.0) UNRELEASED; urgency=low
     This also makes update-alternatives less noisy when this happens since we
     This also makes update-alternatives less noisy when this happens since we
     don't call mv when we know that it's going to fail.
     don't call mv when we know that it's going to fail.
     Closes: #98822
     Closes: #98822
+  * Properly remove inappropriate slave links in update-alternatives even when
+    we switch to manual mode with --set or --config. Closes: #388313
 
 
   [ Pierre Habouzit ]
   [ Pierre Habouzit ]
   * Add a --query option to update-alternatives. Closes: #336091, #441904
   * Add a --query option to update-alternatives. Closes: #336091, #441904

+ 1 - 0
scripts/update-alternatives.pl

@@ -309,6 +309,7 @@ sub set_links($$)
 	               $slavelinks[$slnum], $versions[$preferred]))
 	               $slavelinks[$slnum], $versions[$preferred]))
 	        if $verbosemode > 0;
 	        if $verbosemode > 0;
 	    checked_rm("$altdir/$slave");
 	    checked_rm("$altdir/$slave");
+            checked_rm($slavelinks[$slnum]);
 	}
 	}
     }
     }
 }
 }