Bug#581544: [PATCH] Re: /usr/bin/dpkg-divert: useless errors on not writable destination if source does not exist
Hi! On Wed, 2010-07-07 at 16:54:37 +0200, Raphael Hertzog wrote: On Wed, 07 Jul 2010, Andreas Beckmann wrote: Version: 1.15.7.2 I attach a patch that stops dpkg-divert --rename doing useless checking (and emitting useless errors) if the source file of the rename does not exist. dpkg-divert has been rewritten in C in the master branch of the git repository, please try it out and verify if your bug is still present. I got a patch for this bug report several weeks ago, but didn't want to push it yet to be able to properly check the currently rewritten implementation. I'm pushing it about right now. thanks, guillem -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#581544: [PATCH] Re: /usr/bin/dpkg-divert: useless errors on not writable destination if source does not exist
tags 581544 + patch thanks Version: 1.15.7.2 I attach a patch that stops dpkg-divert --rename doing useless checking (and emitting useless errors) if the source file of the rename does not exist. I successfully tested this in a few piuparts runs (on the nvidia-graphics-drivers* packages) where it reduced the removal failures due to dpkg-divert errors to 0. Andreas --- dpkg-1.15.7.2+nmu0anbe1/scripts/dpkg-divert.pl 2010-05-19 07:55:01.0 +0200 +++ dpkg-1.15.7.2+nmu0anbe2/scripts/dpkg-divert.pl 2010-07-07 14:51:29.0 +0200 @@ -269,6 +269,13 @@ ($rsrc,$rdest) = @_; (@ssrc = lstat($rsrc)) || $! == ENOENT || quit(sprintf(_g(cannot stat old name \`%s': %s), $rsrc, $!)); +unless(@ssrc) { + # 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 or the + # write permissions of any directory. + $dorename = !$dorename; + return; +} (@sdest = lstat($rdest)) || $! == ENOENT || quit(sprintf(_g(cannot stat new name \`%s': %s), $rdest, $!)); # Unfortunately we have to check for write access in both @@ -281,11 +288,6 @@ if (open (TMP, , ${rsrc}.dpkg-devert.tmp)) { close TMP; 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, $!)); }
Bug#581544: [PATCH] Re: /usr/bin/dpkg-divert: useless errors on not writable destination if source does not exist
Hi, On Wed, 07 Jul 2010, Andreas Beckmann wrote: Version: 1.15.7.2 I attach a patch that stops dpkg-divert --rename doing useless checking (and emitting useless errors) if the source file of the rename does not exist. dpkg-divert has been rewritten in C in the master branch of the git repository, please try it out and verify if your bug is still present. Your patch is not very useful right now, sorry. git://git.debian.org/dpkg/dpgk.git Cheers, -- Raphaƫl Hertzog Follow my Debian News on http://RaphaelHertzog.com -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org