summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2011-05-24 06:19:28 +0200
committerGuillem Jover <guillem@debian.org>2011-05-24 07:10:20 +0200
commit2ed0a42cb3863e2ce0199e13242fa3b769ca773d (patch)
treee589c7c4a1741ed71a7e9f234eceaab6c4f92317 /lib
parente4cb12a710457b103a7544c4de5e9fc1b2bd24d8 (diff)
downloaddpkg-2ed0a42cb3863e2ce0199e13242fa3b769ca773d.tar.gz
libdpkg: Do not warn on missing Architecture in config-files state
dpkg before commit 2ef42b027e4267432a41343e28f102b1dae668d2 (versions older than 1.10.19) did not keep the Architecture field in the status file, and as such removed (but not purged) packages might still be around in live systems lacking the Architecture field. Let's shut up the warning for now. Closes: #604241 Analysis-by: Raphael Hertzog <hertzog@debian.org> Signed-off-by: Guillem Jover <guillem@debian.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/dpkg/parse.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/dpkg/parse.c b/lib/dpkg/parse.c
index f71c4388d..58b31108d 100644
--- a/lib/dpkg/parse.c
+++ b/lib/dpkg/parse.c
@@ -177,11 +177,19 @@ pkg_parse_verify(struct parsedb_state *ps,
parse_ensure_have_field(ps, pkg, &pkgbin->description, "description");
parse_ensure_have_field(ps, pkg, &pkgbin->maintainer, "maintainer");
parse_must_have_field(ps, pkg, pkgbin->version.version, "version");
+ }
+ /* XXX: Versions before dpkg 1.10.19 did not preserve the Architecture
+ * field in the status file. So there's still live systems with packages
+ * in stat_configfiles, ignore those too for now. */
+ if ((ps->flags & pdb_recordavailable) ||
+ pkg->status > stat_halfinstalled) {
/* We always want usable architecture information (as long as the package
* is in such a state that it make sense), so that it can be used safely
* on string comparisons and the like. */
parse_ensure_have_field(ps, pkg, &pkgbin->arch, "architecture");
+ } else if (pkgbin->arch == NULL) {
+ pkgbin->arch = "";
}
/* Check the Config-Version information: