summaryrefslogtreecommitdiff
path: root/scripts/dpkg-divert.pl
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/dpkg-divert.pl')
-rwxr-xr-xscripts/dpkg-divert.pl8
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/dpkg-divert.pl b/scripts/dpkg-divert.pl
index 80edae547..bdab7d628 100755
--- a/scripts/dpkg-divert.pl
+++ b/scripts/dpkg-divert.pl
@@ -199,9 +199,13 @@ sub checkrename {
# (hopefully) wont overwrite anything. If it succeeds, we
# assume a writable filesystem.
foreach $file ($rsrc,$rdest) {
- open (TMP, ">> ${file}.dpkg-devert.tmp") || &quit("error checking \`$file': $!");
+ open (TMP, ">> ${file}.dpkg-devert.tmp") || $! == NOENT ||
+ &quit("error checking \`$file': $!");
close TMP;
- unlink ("${file}.dpkg-devert.tmp");
+ if ($1 == ENOENT) {
+ $dorename = 0;
+ } else
+ unlink ("${file}.dpkg-devert.tmp");
}
if (@ssrc && @sdest &&
!($ssrc[0] == $sdest[0] && $ssrc[1] == $sdest[1])) {