The following commit has been merged in the master branch:
commit 08463d3cafdad1c25b95d23daa16cb70e6bc84a3
Author: Guillem Jover <[email protected]>
Date:   Tue Jul 14 12:32:53 2009 +0200

    Cleanup eflag value names
    
    Remove f and v from value names. Remove duplicated value for reinstreq.

diff --git a/dselect/pkgdepcon.cc b/dselect/pkgdepcon.cc
index a9c43f4..5627f96 100644
--- a/dselect/pkgdepcon.cc
+++ b/dselect/pkgdepcon.cc
@@ -175,8 +175,11 @@ int packagelist::deselect_one_of(pkginfo *per, pkginfo 
*ped, dependency *display
   
   perpackagestate *best;
 
-  if (per->eflag & pkginfo::eflagf_reinstreq) best= ed;      // Try not keep 
packages
-  else if (ped->eflag & pkginfo::eflagf_reinstreq) best= er; //  needing 
reinstallation
+  // Try not keep packages needing reinstallation.
+  if (per->eflag & pkginfo::eflag_reinstreq)
+    best = ed;
+  else if (ped->eflag & pkginfo::eflag_reinstreq)
+    best = er;
   else if (er->spriority < ed->spriority) best= er; // We'd rather change the
   else if (er->spriority > ed->spriority) best= ed; // one with the lowest 
priority.
   else if (er->pkg->priority >
diff --git a/lib/database.c b/lib/database.c
index bc7cd11..ab204f5 100644
--- a/lib/database.c
+++ b/lib/database.c
@@ -65,7 +65,7 @@ void blankversion(struct versionrevision *version) {
 void blankpackage(struct pkginfo *pigp) {
   pigp->name= NULL;
   pigp->status= stat_notinstalled;
-  pigp->eflag= eflagv_ok;
+  pigp->eflag = eflag_ok;
   pigp->want= want_unknown;
   pigp->priority= pri_unknown;
   pigp->otherpriority = NULL;
@@ -104,7 +104,7 @@ int informative(struct pkginfo *pkg, struct pkginfoperfile 
*info) {
    */
   if (info == &pkg->installed &&
       (pkg->want != want_unknown ||
-       pkg->eflag != eflagv_ok ||
+       pkg->eflag != eflag_ok ||
        pkg->status != stat_notinstalled ||
        informativeversion(&pkg->configversion)))
     /* We ignore Section and Priority, as these tend to hang around. */
diff --git a/lib/dpkg-db.h b/lib/dpkg-db.h
index 2a3af54..95630db 100644
--- a/lib/dpkg-db.h
+++ b/lib/dpkg-db.h
@@ -146,9 +146,8 @@ struct pkginfo { /* pig */
                      in some places */
   } want;
   enum pkgeflag {
-    eflagf_reinstreq    = 01,
-    eflagv_ok           = 0,
-    eflagv_reinstreq    =    eflagf_reinstreq,
+    eflag_ok           = 0,
+    eflag_reinstreq    = 1,
   } eflag; /* Bitmask. */
   enum pkgstatus {
     stat_notinstalled,
diff --git a/lib/dump.c b/lib/dump.c
index 47c4934..a414691 100644
--- a/lib/dump.c
+++ b/lib/dump.c
@@ -168,7 +168,7 @@ void w_status(struct varbuf *vb,
               enum fwriteflags flags, const struct fieldinfo *fip) {
   if (pifp != &pigp->installed) return;
   assert(pigp->want <= want_purge);
-  assert(pigp->eflag <= eflagv_reinstreq);
+  assert(pigp->eflag <= eflag_reinstreq);
 
 #define PEND pigp->trigpend_head
 #define AW pigp->trigaw.head
diff --git a/lib/parse.c b/lib/parse.c
index 8c60205..059f9a2 100644
--- a/lib/parse.c
+++ b/lib/parse.c
@@ -319,7 +319,7 @@ int parsedb(const char *filename, enum parsedbflags flags,
      * major distributions. */
     if (!(flags & pdb_recordavailable) &&
         newpig.status == stat_notinstalled &&
-        newpig.eflag == eflagv_ok &&
+        newpig.eflag == eflag_ok &&
         (newpig.want == want_purge ||
          newpig.want == want_deinstall ||
          newpig.want == want_hold)) {
diff --git a/lib/parsehelp.c b/lib/parsehelp.c
index 0574fcb..7799d0a 100644
--- a/lib/parsehelp.c
+++ b/lib/parsehelp.c
@@ -117,9 +117,9 @@ const struct namevalue statusinfos[]= {  /* Note !  These 
must be in order ! */
 };
 
 const struct namevalue eflaginfos[]= {  /* Note !  These must be in order ! */
-  { "ok",                      eflagv_ok,                2 },
-  { "reinstreq",               eflagv_reinstreq,         9 },
-  {  NULL                                                   }
+  { "ok",        eflag_ok,        2 },
+  { "reinstreq", eflag_reinstreq, 9 },
+  {  NULL                           }
 };
 
 const struct namevalue wantinfos[]= {  /* Note !  These must be in order ! */
diff --git a/src/archives.c b/src/archives.c
index d2f7b63..a5afe6a 100644
--- a/src/archives.c
+++ b/src/archives.c
@@ -1041,7 +1041,7 @@ void check_conflict(struct dependency *dep, struct 
pkginfo *pkg,
       if (!pdep && skip_due_to_hold(fixbyrm)) {
         pdep= &flagdeppossi;
       }
-      if (!pdep && (fixbyrm->eflag & eflagf_reinstreq)) {
+      if (!pdep && (fixbyrm->eflag & eflag_reinstreq)) {
         if (fc_removereinstreq) {
           fprintf(stderr, _("dpkg: package %s requires reinstallation, but 
will"
                   " remove anyway as you requested.\n"), fixbyrm->name);
diff --git a/src/cleanup.c b/src/cleanup.c
index ac0c55c..dc47101 100644
--- a/src/cleanup.c
+++ b/src/cleanup.c
@@ -113,7 +113,7 @@ void cu_prermupgrade(int argc, void **argv) {
                              versiondescribe(&pkg->available.version,
                                              vdew_nonambig),
                              NULL);
-  pkg->eflag &= ~eflagf_reinstreq;
+  pkg->eflag &= ~eflag_reinstreq;
   post_postinst_tasks(pkg, stat_installed);
   cleanup_pkg_failed--;
 }
@@ -162,7 +162,7 @@ void cu_prerminfavour(int argc, void **argv) {
                              versiondescribe(&infavour->available.version,
                                              vdew_nonambig),
                              NULL);
-  conflictor->eflag &= ~eflagf_reinstreq;
+  conflictor->eflag &= ~eflag_reinstreq;
   post_postinst_tasks(conflictor, stat_installed);
   cleanup_conflictor_failed--;
 }
@@ -176,7 +176,7 @@ void cu_preinstverynew(int argc, void **argv) {
   maintainer_script_new(pkg->name, POSTRMFILE,"post-removal",cidir,cidirrest,
                         "abort-install", NULL);
   pkg->status= stat_notinstalled;
-  pkg->eflag &= ~eflagf_reinstreq;
+  pkg->eflag &= ~eflag_reinstreq;
   blankpackageperfile(&pkg->installed);
   modstatdb_note(pkg);
   cleanup_pkg_failed--;
@@ -193,7 +193,7 @@ void cu_preinstnew(int argc, void **argv) {
                                                          vdew_nonambig),
                         NULL);
   pkg->status= stat_configfiles;
-  pkg->eflag &= ~eflagf_reinstreq;
+  pkg->eflag &= ~eflag_reinstreq;
   modstatdb_note(pkg);
   cleanup_pkg_failed--;
 }
@@ -211,7 +211,7 @@ void cu_preinstupgrade(int argc, void **argv) {
                                         vdew_nonambig),
                         NULL);
   pkg->status= *oldstatusp;
-  pkg->eflag &= ~eflagf_reinstreq;
+  pkg->eflag &= ~eflag_reinstreq;
   modstatdb_note(pkg);
   cleanup_pkg_failed--;
 }
@@ -233,7 +233,7 @@ void cu_prermremove(int argc, void **argv) {
 
   if (cleanup_pkg_failed++) return;
   maintainer_script_postinst(pkg, "abort-remove", NULL);
-  pkg->eflag &= ~eflagf_reinstreq;
+  pkg->eflag &= ~eflag_reinstreq;
   post_postinst_tasks(pkg, *oldpkgstatus);
   cleanup_pkg_failed--;
 }
diff --git a/src/configure.c b/src/configure.c
index b827469..9bce33f 100644
--- a/src/configure.c
+++ b/src/configure.c
@@ -142,7 +142,7 @@ void deferred_configure(struct pkginfo *pkg) {
        varbuffree(&aemsgs);
        sincenothing= 0;
 
-       if (pkg->eflag & eflagf_reinstreq)
+       if (pkg->eflag & eflag_reinstreq)
                forcibleerr(fc_removereinstreq,
                                _("Package is in a very bad inconsistent state 
- you should\n"
                                        " reinstall it before attempting 
configuration."));
@@ -324,7 +324,7 @@ void deferred_configure(struct pkginfo *pkg) {
                                                   vdew_nonambig) : "",
                                   NULL);
 
-       pkg->eflag= eflagv_ok;
+       pkg->eflag = eflag_ok;
        post_postinst_tasks(pkg, stat_installed);
 }
 
diff --git a/src/enquiry.c b/src/enquiry.c
index a4628b0..9da5418 100644
--- a/src/enquiry.c
+++ b/src/enquiry.c
@@ -52,11 +52,12 @@ struct badstatinfo {
 };
 
 static int bsyn_reinstreq(struct pkginfo *pkg, const struct badstatinfo *bsi) {
-  return pkg->eflag &= eflagf_reinstreq;
+  return pkg->eflag &= eflag_reinstreq;
 }
 
 static int bsyn_status(struct pkginfo *pkg, const struct badstatinfo *bsi) {
-  if (pkg->eflag &= eflagf_reinstreq) return 0;
+  if (pkg->eflag &= eflag_reinstreq)
+    return 0;
   return (int)pkg->status == bsi->val;
 }
 
diff --git a/src/processarc.c b/src/processarc.c
index 1870fa4..ed99d81 100644
--- a/src/processarc.c
+++ b/src/processarc.c
@@ -404,7 +404,7 @@ void process_archive(const char *filename) {
       oldversionstatus == stat_triggersawaited ||
       oldversionstatus == stat_triggerspending ||
       oldversionstatus == stat_installed) {
-    pkg->eflag |= eflagf_reinstreq;
+    pkg->eflag |= eflag_reinstreq;
     pkg->status= stat_halfconfigured;
     modstatdb_note(pkg);
     push_cleanup(cu_prermupgrade, ~ehflag_normaltidy, NULL, 0, 1, (void *)pkg);
@@ -473,7 +473,7 @@ void process_archive(const char *filename) {
     modstatdb_note(conflictor[i]);
   }
 
-  pkg->eflag |= eflagf_reinstreq;
+  pkg->eflag |= eflag_reinstreq;
   if (pkg->status == stat_notinstalled)
     pkg->installed.version= pkg->available.version;
   pkg->status= stat_halfinstalled;
@@ -1066,7 +1066,7 @@ void process_archive(const char *filename) {
     
     otherpkg->status= stat_notinstalled;
     otherpkg->want = want_unknown;
-    otherpkg->eflag= eflagv_ok;
+    otherpkg->eflag = eflag_ok;
 
     blankversion(&otherpkg->configversion);
     blankpackageperfile(&otherpkg->installed);
@@ -1161,7 +1161,7 @@ void process_archive(const char *filename) {
   /* OK, we're now fully done with the main package.
    * This is quite a nice state, so we don't unwind past here.
    */
-  pkg->eflag= eflagv_ok;
+  pkg->eflag = eflag_ok;
   modstatdb_note(pkg);
   push_checkpoint(~ehflag_bombout, ehflag_normaltidy);
 
diff --git a/src/remove.c b/src/remove.c
index 086ffe8..a98511e 100644
--- a/src/remove.c
+++ b/src/remove.c
@@ -133,7 +133,7 @@ void deferred_remove(struct pkginfo *pkg) {
   varbuffree(&raemsgs);
   sincenothing= 0;
 
-  if (pkg->eflag & eflagf_reinstreq)
+  if (pkg->eflag & eflag_reinstreq)
     forcibleerr(fc_removereinstreq,
                 _("Package is in a very bad inconsistent state - you should\n"
                 " reinstall it before attempting a removal."));
@@ -589,7 +589,7 @@ void removal_bulk(struct pkginfo *pkg) {
     blankpackageperfile(&pkg->installed);
   }
       
-  pkg->eflag= eflagv_ok;
+  pkg->eflag = eflag_ok;
   modstatdb_note(pkg);
 
   debug(dbg_general, "removal done");

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to