Преглед изворни кода

Remove obsolete ‘hold’ and ‘hold-reinstreq’ internal status flags

These flags have been obsolete for a long time, and the ‘hold’ part
has been converted to the ‘want_hold’ value on database parse. No
current system having been upgraded through several Debian releases
should have those values in their status database anymore.
Guillem Jover пре 17 година
родитељ
комит
fb6c4a7a7a
7 измењених фајлова са 6 додато и 14 уклоњено
  1. 1 0
      debian/changelog
  2. 1 1
      dselect/pkgdisplay.cc
  3. 1 4
      lib/dpkg-db.h
  4. 1 1
      lib/dump.c
  5. 0 4
      lib/fields.c
  6. 0 2
      lib/parsehelp.c
  7. 2 2
      src/query.c

+ 1 - 0
debian/changelog

@@ -19,6 +19,7 @@ dpkg (1.15.4) UNRELEASED; urgency=low
   * Document “hold” under package selection states instead of flags in dpkg(1).
   * Document “hold” under package selection states instead of flags in dpkg(1).
   * Remove trailing ‘/’ and ‘/.’ from the directory name to be used as the
   * Remove trailing ‘/’ and ‘/.’ from the directory name to be used as the
     package name on “dpkg-deb -b”. Closes: #218018, #373602
     package name on “dpkg-deb -b”. Closes: #218018, #373602
+  * Remove obsolete ‘hold’ and ‘hold-reinstreq’ internal status flags.
 
 
   [ Raphael Hertzog ]
   [ Raphael Hertzog ]
   * Replace install-info by a wrapper around GNU's install-info. The wrapper
   * Replace install-info by a wrapper around GNU's install-info. The wrapper

+ 1 - 1
dselect/pkgdisplay.cc

@@ -88,7 +88,7 @@ const char
 			       N_("?") };
 			       N_("?") };
 
 
 const char statuschars[] = " -IUCWt*";
 const char statuschars[] = " -IUCWt*";
-const char eflagchars[]=     " R?#";
+const char eflagchars[] = " R";
 const char wantchars[]=     "n*=-_";
 const char wantchars[]=     "n*=-_";
 
 
 /* These MUST be in the same order as the corresponding enums in pkglist.h */
 /* These MUST be in the same order as the corresponding enums in pkglist.h */

+ 1 - 4
lib/dpkg-db.h

@@ -147,12 +147,9 @@ struct pkginfo { /* pig */
   } want;
   } want;
   enum pkgeflag {
   enum pkgeflag {
     eflagf_reinstreq    = 01,
     eflagf_reinstreq    = 01,
-    eflagf_obsoletehold = 02,
     eflagv_ok           = 0,
     eflagv_ok           = 0,
     eflagv_reinstreq    =    eflagf_reinstreq,
     eflagv_reinstreq    =    eflagf_reinstreq,
-    eflagv_obsoletehold =                       eflagf_obsoletehold,
-    eflagv_obsoleteboth =    eflagf_reinstreq | eflagf_obsoletehold
-  } eflag; /* bitmask, but obsoletehold no longer used except when reading */
+  } eflag; /* Bitmask. */
   enum pkgstatus {
   enum pkgstatus {
     stat_notinstalled,
     stat_notinstalled,
     stat_configfiles,
     stat_configfiles,

+ 1 - 1
lib/dump.c

@@ -168,7 +168,7 @@ void w_status(struct varbuf *vb,
               enum fwriteflags flags, const struct fieldinfo *fip) {
               enum fwriteflags flags, const struct fieldinfo *fip) {
   if (pifp != &pigp->installed) return;
   if (pifp != &pigp->installed) return;
   assert(pigp->want <= want_purge);
   assert(pigp->want <= want_purge);
-  assert(pigp->eflag <= eflagv_reinstreq); /* hold and hold-reinstreq NOT allowed */
+  assert(pigp->eflag <= eflagv_reinstreq);
 
 
 #define PEND pigp->trigpend_head
 #define PEND pigp->trigpend_head
 #define AW pigp->trigaw.head
 #define AW pigp->trigaw.head

+ 0 - 4
lib/fields.c

@@ -171,10 +171,6 @@ void f_status(struct pkginfo *pigp, struct pkginfoperfile *pifp,
                               -1, pigp, value, wantinfos, &ep);
                               -1, pigp, value, wantinfos, &ep);
   pigp->eflag = convert_string(ps, _("second (error) word in `status' field"),
   pigp->eflag = convert_string(ps, _("second (error) word in `status' field"),
                                -1, pigp, ep, eflaginfos, &ep);
                                -1, pigp, ep, eflaginfos, &ep);
-  if (pigp->eflag & eflagf_obsoletehold) {
-    pigp->want= want_hold;
-    pigp->eflag &= ~eflagf_obsoletehold;
-  }
   pigp->status = convert_string(ps, _("third (status) word in `status' field"),
   pigp->status = convert_string(ps, _("third (status) word in `status' field"),
                                 -1, pigp, ep, statusinfos, NULL);
                                 -1, pigp, ep, statusinfos, NULL);
 }
 }

+ 0 - 2
lib/parsehelp.c

@@ -119,8 +119,6 @@ const struct namevalue statusinfos[]= {  /* Note !  These must be in order ! */
 const struct namevalue eflaginfos[]= {  /* Note !  These must be in order ! */
 const struct namevalue eflaginfos[]= {  /* Note !  These must be in order ! */
   { "ok",                      eflagv_ok,                2 },
   { "ok",                      eflagv_ok,                2 },
   { "reinstreq",               eflagv_reinstreq,         9 },
   { "reinstreq",               eflagv_reinstreq,         9 },
-  { "hold",                    eflagv_obsoletehold,      4 },
-  { "hold-reinstreq",          eflagv_obsoleteboth,      14 },
   {  NULL                                                   }
   {  NULL                                                   }
 };
 };
 
 

+ 2 - 2
src/query.c

@@ -113,7 +113,7 @@ list1package(struct pkginfo *pkg, int *head, struct pkg_array *array)
     fputs(_("\
     fputs(_("\
 Desired=Unknown/Install/Remove/Purge/Hold\n\
 Desired=Unknown/Install/Remove/Purge/Hold\n\
 | Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend\n\
 | Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend\n\
-|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)\n"), stdout);
+|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)\n"), stdout);
     printf(format,'|','|','/', _("Name"), _("Version"), 40, _("Description"));
     printf(format,'|','|','/', _("Name"), _("Version"), 40, _("Description"));
     printf("+++-");					/* status */
     printf("+++-");					/* status */
     for (l=0;l<nw;l++) printf("="); printf("-");	/* packagename */
     for (l=0;l<nw;l++) printf("="); printf("-");	/* packagename */
@@ -127,7 +127,7 @@ Desired=Unknown/Install/Remove/Purge/Hold\n\
   printf(format,
   printf(format,
          "uihrp"[pkg->want],
          "uihrp"[pkg->want],
          "ncHUFWti"[pkg->status],
          "ncHUFWti"[pkg->status],
-         " R?#"[pkg->eflag],
+         " R"[pkg->eflag],
          pkg->name,
          pkg->name,
          versiondescribe(&pkg->installed.version, vdew_nonambig),
          versiondescribe(&pkg->installed.version, vdew_nonambig),
          l, pdesc);
          l, pdesc);