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

Jérémy Bobbio lunar at moszumanska.debian.org
Fri Nov 6 14:02:18 UTC 2015


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

lunar pushed a commit to branch pu/reproducible_builds
in repository dpkg.

commit 10d77ba878eb998b3eede0c5ac7917a901de05b0
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>
    Stable-Candidate: 1.16.x 1.17.x
---
 debian/changelog |  4 ++++
 lib/dpkg/parse.c | 19 ++++++++++++-------
 2 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 6c27993..82f811a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,10 @@ dpkg (1.18.4) UNRELEASED; urgency=low
   * Switch dpkg-scansources and dpkg-scanpackages to use File::Find instead
     of find(1), as the former is more portable with more consistent behavior,
     and always canonicalizes the pathnames. Closes: #800649
+  * 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 043a164..2d7f0a3 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