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

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


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

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

commit 5514ab54d8fd7baad0ddcefd56b71f425b7a765c
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 | 20 +++++++++++++-------
 2 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index bb4dfdc..a1265ac 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -10,6 +10,10 @@ dpkg (1.16.18) 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
 
  -- Guillem Jover <guillem at debian.org>  Sat, 19 Mar 2016 19:13:34 +0100
 
diff --git a/lib/dpkg/parse.c b/lib/dpkg/parse.c
index e790ec5..0236615 100644
--- a/lib/dpkg/parse.c
+++ b/lib/dpkg/parse.c
@@ -222,18 +222,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 == stat_installed || pkg->status == stat_notinstalled)
+      if (pkg->status == stat_installed ||
+          pkg->status == stat_notinstalled ||
+          pkg->status == stat_triggerspending)
         parse_error(ps,
                     _("Configured-Version for package with inappropriate Status"));
     } else {
-      if (pkg->status == stat_installed)
+      if (pkg->status == stat_installed ||
+          pkg->status == 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