From 05a8ddb482419d110571679a29bcd25e3c2b036d Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Sun, 26 Aug 2012 18:14:55 +0200 Subject: 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 --- src/archives.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') 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) -- cgit v1.2.3