Fix all users that rely on the enum sorting.
+2008-03-22 Ian Jackson <ian@davenant.greenend.org.uk>
+
+ * lib/dpkg-db.h (enum pkgstatus): Sort entries.
+ * lib/dump.c (w_status): Change 'stat_configfiles' to 'stat_installed'
+ in assert as that's the new last item.
+ * src/processarc.c (process_archive): Likewise.
+ * src/packages.c (process_queue): Likewise.
+ (deppossi_ok_found): Match sorting of 'enum pkgstatus'.
+ * dselect/pkgdisplay.cc (statusstrings): Likewise.
+ (statuschars): Likewise.
+ * src/help.c (statusstrings): Likewise.
+ * src/query.c (list1package): Likewise.
+ * lib/parsehelp.c (statusinfos): Likewise.
+
2008-03-21 Guillem Jover <guillem@debian.org>
* lib/parse.c (cu_parsedb): Remove duplicate function.
0 },
*const statusstrings[]= { N_("not installed"),
+ N_("removed (configs remain)"),
+ N_("half installed"),
N_("unpacked (not set up)"),
N_("failed config"),
N_("installed"),
- N_("half installed"),
- N_("removed (configs remain)"),
0 },
*const prioritystrings[]= { N_("Required"),
N_("bUG"),
N_("?") };
-const char statuschars[]= " UC*I-";
+const char statuschars[] = " -IUC*";
const char eflagchars[]= " R?#";
const char wantchars[]= "n*=-_";
eflagv_obsoleteboth = eflagf_reinstreq | eflagf_obsoletehold
} eflag; /* bitmask, but obsoletehold no longer used except when reading */
enum pkgstatus {
- stat_notinstalled, stat_unpacked, stat_halfconfigured,
- stat_installed, stat_halfinstalled, stat_configfiles
+ stat_notinstalled,
+ stat_configfiles,
+ stat_halfinstalled,
+ stat_unpacked,
+ stat_halfconfigured,
+ stat_installed
} status;
enum pkgpriority {
pri_required, pri_important, pri_standard, pri_recommended,
if (pifp != &pigp->installed) return;
assert(pigp->want <= want_purge);
assert(pigp->eflag <= eflagv_reinstreq); /* hold and hold-reinstreq NOT allowed */
- assert(pigp->status <= stat_configfiles);
+ assert(pigp->status <= stat_installed);
if (flags&fw_printheader)
varbufaddstr(vb,"Status: ");
varbufaddstr(vb,wantinfos[pigp->want].name); varbufaddc(vb,' ');
const struct namevalue statusinfos[]= { /* Note ! These must be in order ! */
{ "not-installed", stat_notinstalled, 13 },
+ { "config-files", stat_configfiles, 12 },
+ { "half-installed", stat_halfinstalled, 14 },
{ "unpacked", stat_unpacked, 8 },
{ "half-configured", stat_halfconfigured, 15, },
{ "installed", stat_installed, 9 },
- { "half-installed", stat_halfinstalled, 14 },
- { "config-files", stat_configfiles, 12 },
/* These are additional entries for reading only, in any order ... */
{ "postinst-failed", stat_halfconfigured, 15 }, /* fixme: backwards compat., remove */
{ "removal-failed", stat_halfinstalled, 14 }, /* fixme: backwards compat., remove */
const char *const statusstrings[]= {
N_("not installed"),
+ N_("not installed but configs remain"),
+ N_("broken due to failed removal"),
N_("unpacked but not configured"),
N_("broken due to postinst failure"),
- N_("installed"),
- N_("broken due to failed removal"),
- N_("not installed but configs remain")
+ N_("installed")
};
struct filenamenode *namenodetouse(struct filenamenode *namenode, struct pkginfo *pkg) {
if (!pkg) continue; /* duplicate, which we removed earlier */
- assert(pkg->status <= stat_configfiles);
+ assert(pkg->status <= stat_installed);
if (setjmp(ejbuf)) {
/* give up on it from the point of view of other packages, ie reset istobe */
return thisf;
}
switch (possdependee->status) {
- case stat_installed:
case stat_unpacked:
case stat_halfconfigured:
+ case stat_installed:
assert(possdependee->installed.valid);
if (checkversion && !versionsatisfied(&possdependee->installed,checkversion)) {
varbufprintf(oemsgs, _(" Version of %s on system is %s.\n"),
oldversionstatus= pkg->status;
- assert(oldversionstatus <= stat_configfiles);
+ assert(oldversionstatus <= stat_installed);
debug(dbg_general,"process_archive oldversionstatus=%s",
statusstrings[oldversionstatus]);
limiteddescription(pkg,dw,&pdesc,&l);
printf(format,
"uihrp"[pkg->want],
- "nUFiHc"[pkg->status],
+ "ncHUFi"[pkg->status],
" R?#"[pkg->eflag],
pkg->name,
versiondescribe(&pkg->installed.version, vdew_nonambig),