[Reproducible-commits] [dpkg] 10/17: libdpkg: Config-Version should also be initialized on triggers-pending

Holger Levsen holger at layer-acht.org
Tue May 3 08:44:27 UTC 2016


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to annotated tag 1.17.27
in repository dpkg.

commit 56ac2a6132cbd0bea2bab27f20409999201ef5d7
Author: Guillem Jover <guillem at debian.org>
Date:   Sat Oct 10 16:06:41 2015 +0200

    libdpkg: Config-Version should also be initialized on triggers-pending
    
    A package in triggers-pending state should be considered an installed
    package, by not doing so we might end up not passing the correct version
    to the configure maintainer script and making it look like we are doing
    a configuration for a first install, instead of an upgrade.
    
    Closes: #801156
    Reported-by: Andreas Beckmann <anbe at debian.org>
---
 debian/changelog |  4 ++++
 lib/dpkg/parse.c | 19 ++++++++++++-------
 2 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 8b58a68..d62d635 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -14,6 +14,10 @@ dpkg (1.17.27) UNRELEASED; urgency=medium
     the -T option, otherwise the tarball will end up with duplicated entries.
     Thanks to Richard Purdie <richard.purdie at linuxfoundation.org>.
     Closes: #807940
+  * Initialize Config-Version also for packages previously in triggers-pending
+    state, otherwise we end up not passing the previously configured version
+    to «postinst configure», which might consider this a first install instead
+    of an upgrade. Closes: #801156
   * Build system:
     - Set PERL5LIB globally for the test suite to the local modules directory,
       to avoid using the system modules. Regression introduced in dpkg 1.17.8.
diff --git a/lib/dpkg/parse.c b/lib/dpkg/parse.c
index d70d3f0..1e69b2f 100644
--- a/lib/dpkg/parse.c
+++ b/lib/dpkg/parse.c
@@ -225,19 +225,24 @@ pkg_parse_verify(struct parsedb_state *ps,
       if (!dop->arch)
         dop->arch = pkgbin->arch;
 
-  /* Check the Config-Version information:
-   * If there is a Config-Version it is definitely to be used, but
-   * there shouldn't be one if the package is ‘installed’ (in which case
-   * the Version and/or Revision will be copied) or if the package is
-   * ‘not-installed’ (in which case there is no Config-Version). */
+  /*
+   * Check the Config-Version information:
+   *
+   * If there is a Config-Version it is definitely to be used, but there
+   * should not be one if the package is ‘installed’ or ‘triggers-pending’
+   * (in which case the Version will be copied) or if the package is
+   * ‘not-installed’ (in which case there is no Config-Version).
+   */
   if (!(ps->flags & pdb_recordavailable)) {
     if (pkg->configversion.version) {
       if (pkg->status == PKG_STAT_INSTALLED ||
-          pkg->status == PKG_STAT_NOTINSTALLED)
+          pkg->status == PKG_STAT_NOTINSTALLED ||
+          pkg->status == PKG_STAT_TRIGGERSPENDING)
         parse_error(ps,
                     _("Config-Version for package with inappropriate Status"));
     } else {
-      if (pkg->status == PKG_STAT_INSTALLED)
+      if (pkg->status == PKG_STAT_INSTALLED ||
+          pkg->status == PKG_STAT_TRIGGERSPENDING)
         pkg->configversion = pkgbin->version;
     }
   }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git



More information about the Reproducible-commits mailing list