Explorar el Código

dpkg-divert: fix return value of rename_mv

This is a regression introduced by the C rewrite of dpkg-divert
(commit 02b12d75f1eff7c184fafb5a663a0421e9a645ea) that made it unable to
rename files when that rename implies a copy on another file system.

The code has provision to do a copy when a simple rename is not enough
but the associated function erroneously returned a failure value when
that operation was performed.

Reported-by: Durk Strooisma
Raphaël Hertzog hace 15 años
padre
commit
083f2ed8a6
Se han modificado 2 ficheros con 4 adiciones y 1 borrados
  1. 3 0
      debian/changelog
  2. 1 1
      src/divertcmd.c

+ 3 - 0
debian/changelog

@@ -87,6 +87,9 @@ dpkg (1.16.0) UNRELEASED; urgency=low
   * Improve parser in Dpkg::Control::Hash to not require an empty line
     before the PGP signature. Closes: #617923
     Thanks to Roger Leigh for the initial patch.
+  * Fix a regression in dpkg-divert where using --rename led to a failure when
+    the rename implies crossing file systems. Thanks to Durk Strooisma for
+    spotting it.
 
   [ Jonathan Nieder ]
   * Remove support for use of synchronous sync(2), due to its pernicious

+ 1 - 1
src/divertcmd.c

@@ -255,7 +255,7 @@ rename_mv(const char *src, const char *dst)
 
 	free(tmpdst);
 
-	return -1;
+	return 0;
 }
 
 static void