This is an automated email from the git hooks/post-receive script. guillem pushed a commit to branch master in repository dpkg.
View the commit online: https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=813024b95f3087fe018f73867ea30ad2a83321e5 commit 813024b95f3087fe018f73867ea30ad2a83321e5 Author: Guillem Jover <[email protected]> AuthorDate: Mon Feb 18 03:53:36 2019 +0100 libdpkg: Blank packages that are not-installed with unknown selection Versions before 1.13.10 did not properly clear the Origin and Bugs fields, so there might still be entries with these fields that are not getting garbage collected properly. Make sure to blank these package entries so that they get forgotten on the next database dump. Closes: #922410 --- debian/changelog | 2 ++ lib/dpkg/parse.c | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/debian/changelog b/debian/changelog index 7d69fbaed..e40d7f93f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -34,6 +34,8 @@ dpkg (1.19.5) UNRELEASED; urgency=medium * libdpkg: Print a more accurate warning for Revision nicknames. * libdpkg: Increase the pkg-hash bins size to 65521, to improve hash table performance at the cost of a bit more memory usage. + * libdpkg: Blank packages that are not-installed with unknown selection. + Closes: #922410 * Perl modules: - Dpkg::Vendor::Debian: Add support for merged-usr-via-symlinks tainted tag. Suggested by Alexander E. Patrakov <[email protected]>. diff --git a/lib/dpkg/parse.c b/lib/dpkg/parse.c index 863e42644..f7979b8e5 100644 --- a/lib/dpkg/parse.c +++ b/lib/dpkg/parse.c @@ -292,6 +292,17 @@ pkg_parse_verify(struct parsedb_state *ps, pkg->want == PKG_WANT_INSTALL && pkgbin->arch->type == DPKG_ARCH_EMPTY) pkg_set_want(pkg, PKG_WANT_UNKNOWN); + + /* XXX: Versions before dpkg 1.13.10 did not blank the Origin and Bugs + * fields, so there can be packages that should be garbage collected but + * are lingering around. Blank them to make sure we will forget all about + * them on the next database dump. */ + if (!(ps->flags & pdb_recordavailable) && + pkg->status == PKG_STAT_NOTINSTALLED && + pkg->eflag == PKG_EFLAG_OK && + pkg->want == PKG_WANT_UNKNOWN) { + pkgbin_blank(pkgbin); + } } struct pkgcount { -- Dpkg.Org's dpkg

