The following commit has been merged in the master branch:
commit ad0596aaa56277e08efe764373001f4525dd5726
Author: Guillem Jover <guil...@debian.org>
Date:   Tue Feb 10 02:52:50 2009 +0200

    dpkg: Pass fully constructed versions to assert_version_support
    
    Remove the missplaced version constructor from inside
    assert_version_support, and instead just pass an already initialized
    structure. This also allows making the version structures non-static.

diff --git a/ChangeLog b/ChangeLog
index 2ff4497..7a304e3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2009-02-10  Guillem Jover  <guil...@debian.org>
 
+       * src/enquiry.c (assert_version_support): Remove reqversion argument.
+       Do not initialize verrev_buf from reqversion, when the epoch is ~0UL.
+       (assertpredep): Pass a fully constructed versionrevision to
+       assert_version_support, rename versionrevision variable to version
+       and remove static keyword.
+       (assertepoch): Likewise.
+       (assertlongfilenames): Likewise.
+       (assertmulticonrep): Likewise.
+
+2009-02-10  Guillem Jover  <guil...@debian.org>
+
        * src/enquiry.c (assertversion): Rename to ...
        (assert_version_support): ... this.
 
diff --git a/src/enquiry.c b/src/enquiry.c
index a2d9402..17bbc18 100644
--- a/src/enquiry.c
+++ b/src/enquiry.c
@@ -239,8 +239,7 @@ void unpackchk(const char *const *argv) {
 
 static void
 assert_version_support(const char *const *argv,
-                       struct versionrevision *verrev_buf,
-                       const char *reqversion)
+                       struct versionrevision *verrev_buf)
 {
   struct pkginfo *pkg;
 
@@ -248,11 +247,7 @@ assert_version_support(const char *const *argv,
     badusage(_("--%s takes no arguments"), cipaction->olong);
 
   modstatdb_init(admindir,msdbrw_readonly|msdbrw_noavail);
-  if (verrev_buf->epoch == ~0UL) {
-    verrev_buf->epoch= 0;
-    verrev_buf->version= nfstrsave(reqversion);
-    verrev_buf->revision = NULL;
-  }
+
   pkg= findpackage("dpkg");
   switch (pkg->status) {
   case stat_installed:
@@ -272,23 +267,23 @@ assert_version_support(const char *const *argv,
 }
 
 void assertpredep(const char *const *argv) {
-  static struct versionrevision predepversion = { ~0UL, NULL, NULL };
-  assert_version_support(argv, &predepversion, "1.1.0");
+  struct versionrevision version = { 0, "1.1.0", NULL };
+  assert_version_support(argv, &version);
 }
 
 void assertepoch(const char *const *argv) {
-  static struct versionrevision epochversion = { ~0UL, NULL, NULL };
-  assert_version_support(argv, &epochversion, "1.4.0.7");
+  struct versionrevision version = { 0, "1.4.0.7", NULL };
+  assert_version_support(argv, &version);
 }
 
 void assertlongfilenames(const char *const *argv) {
-  static struct versionrevision epochversion = { ~0UL, NULL, NULL };
-  assert_version_support(argv, &epochversion, "1.4.1.17");
+  struct versionrevision version = { 0, "1.4.1.17", NULL };
+  assert_version_support(argv, &version);
 }
 
 void assertmulticonrep(const char *const *argv) {
-  static struct versionrevision epochversion = { ~0UL, NULL, NULL };
-  assert_version_support(argv, &epochversion, "1.4.1.19");
+  struct versionrevision version = { 0, "1.4.1.19", NULL };
+  assert_version_support(argv, &version);
 }
 
 void predeppackage(const char *const *argv) {

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to debian-dpkg-cvs-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to