summaryrefslogtreecommitdiff
path: root/src/divertcmd.c
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2011-04-01 23:49:24 +0200
committerGuillem Jover <guillem@debian.org>2011-04-02 05:36:44 +0200
commit922093b5fb715554456ef44bb4ce70e89dc4e337 (patch)
treee870ac5c4b58373d6072356c8cf8a14dcacf767d /src/divertcmd.c
parent1624466c3d3c882b551f0b5deae8db4016332e5a (diff)
downloaddpkg-922093b5fb715554456ef44bb4ce70e89dc4e337.tar.gz
dpkg-divert: Unlink the source file when moving across filesystems
Otherwise we might leave cruft behind. Regression introduced in commit 02b12d75f1eff7c184fafb5a663a0421e9a645ea.
Diffstat (limited to 'src/divertcmd.c')
-rw-r--r--src/divertcmd.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/divertcmd.c b/src/divertcmd.c
index 95abb2d4f..5ea6c65cf 100644
--- a/src/divertcmd.c
+++ b/src/divertcmd.c
@@ -256,6 +256,10 @@ file_rename(struct file *src, struct file *dst)
/* If a rename didn't work try moving the file instead. */
file_copy(src->name, dst->name);
+
+ if (unlink(src->name))
+ ohshite(_("unable to remove copied source file '%s'"),
+ src->name);
}
}