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

dpkg-divert: On renames do no check the target if the source does not exist

The rename is going to be disabled anyway in that case. This also allows
to remove bogus diversions. Closes: #476973, #469033
Guillem Jover лет назад: 18
Родитель
Сommit
d329b123b6
3 измененных файлов с 11 добавлено и 0 удалено
  1. 5 0
      ChangeLog
  2. 3 0
      debian/changelog
  3. 3 0
      scripts/dpkg-divert.pl

+ 5 - 0
ChangeLog

@@ -1,3 +1,8 @@
+2008-05-15  Guillem Jover  <guillem@debian.org>
+
+	* scripts/dpkg-divert.pl (checkrename): Do not check the target file
+	if the source does not exist and dorename was thus disabled.
+
 2008-06-09  Raphael Hertzog  <hertzog@debian.org>
 
 	* scripts/dpkg-divert.pl, scripts/update-alternatives.pl,

+ 3 - 0
debian/changelog

@@ -6,6 +6,9 @@ dpkg (1.14.20) UNRELEASED; urgency=low
   * Document triggers --debug values in dpkg.1. Thanks to Sven Joachim.
   * Improve package descriptions for dpkg, dpkg-dev and dselect.
     Thanks to Justin B Rye for the review and corrections. Closes: #484002
+  * When dpkg-divert does renames do no check the target file if the source
+    does not exist and the rename is thus being disabled. This also allows
+    to remove bogus diversions. Closes: #476973, #469033
 
   [ Raphael Hertzog ]
   * Add missing 'use File::Path' in Dpkg::Source::Package::V3::quilt.

+ 3 - 0
scripts/dpkg-divert.pl

@@ -244,6 +244,9 @@ sub checkrename {
 	unlink ("${rsrc}.dpkg-devert.tmp");
     } elsif ($! == ENOENT) {
 	$dorename = !$dorename;
+	# If the source file is not present and we are not going to do the
+	# rename anyway there's no point in checking the target.
+	return;
     } else {
 	quit(sprintf(_g("error checking \`%s': %s"), $rsrc, $!));
     }