summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2012-08-26 18:14:55 +0200
committerGuillem Jover <guillem@debian.org>2012-10-13 23:34:03 +0200
commit05a8ddb482419d110571679a29bcd25e3c2b036d (patch)
tree71745077c42ce89fd3f37400150a6f4bc930e9e4 /src
parentf1996e1acede31575414c599c3eeee099ddf18b5 (diff)
downloaddpkg-05a8ddb482419d110571679a29bcd25e3c2b036d.tar.gz
dpkg: Fix logic on reinstallation of previously configured shared conffiles
When checking for the validity of the Conffiles database field, do not just assume that a package that is just in stat_unpacked has never before been configured. Instead check if the last configured version is the same as the currently extracted version, which will mean the values in the Conffiles field are valid. Closes: #684776
Diffstat (limited to 'src')
-rw-r--r--src/archives.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/archives.c b/src/archives.c
index 66148bd35..4e3634746 100644
--- a/src/archives.c
+++ b/src/archives.c
@@ -194,7 +194,14 @@ md5hash_prev_conffile(struct pkginfo *pkg, char *oldhash, const char *oldname,
continue;
/* The hash in the Conffiles is only meaningful if the package
* configuration has been at least tried. */
- if (otherpkg->status <= stat_unpacked)
+ if (otherpkg->status < stat_unpacked)
+ continue;
+ /* If we are reinstalling, even if the other package is only unpacked,
+ * we can always make use of the Conffiles hash value from an initial
+ * installation, if that happened at all. */
+ if (otherpkg->status == stat_unpacked &&
+ dpkg_version_compare(&otherpkg->installed.version,
+ &otherpkg->configversion) != 0)
continue;
for (conff = otherpkg->installed.conffiles; conff; conff = conff->next) {
if (conff->obsolete)