From daf844321a2ac5ba9a6874208505088b2cda30d9 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Wed, 21 Mar 2007 21:45:46 +0000 Subject: [PATCH] Show the epoch (if present) when displaying package versions. Closes: #107449, #179913, #345594, #393924, #405668 Based on a patch by Jeffrey W. Baker. --- ChangeLog | 10 ++++++++++ debian/changelog | 3 +++ dselect/pkgsublist.cc | 2 +- dselect/pkgtop.cc | 4 ++-- src/archives.c | 13 +++++-------- src/configure.c | 2 +- src/query.c | 4 ++-- 7 files changed, 24 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index b3468bf2..407ed3dd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2007-03-21 Jeffrey W. Baker + Guillem Jover + + * src/archives.c (wanttoinstall): Use vdew_nonambig instead of + vdew_never on versiondescribe. + * src/configure.c (deferred_configure): Likewise. + * src/query.c (list1package): Likewise. + * dselect/pkgsublist.cc (packagelist::add): Likewise. + * dselect/pkgtop.cc (packagelist::redraw1itemsel): Likewise. + 2007-03-21 Guillem Jover * dselect/main.cc: Remove duplicated included files and diff --git a/debian/changelog b/debian/changelog index c85c5c27..9b5f77d9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -54,6 +54,9 @@ dpkg (1.14.0) UNRELEASED; urgency=low * Support building binary packages with the member data.tar.lzma compressed with lzma. * Require gettext 0.16.1. + * Show the epoch (if present) when displaying package versions. + Closes: #107449, #179913, #345594, #393924, #405668 + Based on a patch by Jeffrey W. Baker. [ Updated dpkg translations ] * Romanian (Eddy Petrișor). diff --git a/dselect/pkgsublist.cc b/dselect/pkgsublist.cc index fe41ebc2..7046b6fe 100644 --- a/dselect/pkgsublist.cc +++ b/dselect/pkgsublist.cc @@ -131,7 +131,7 @@ int packagelist::add(dependency *depends, showpriority displayimportance) { case dvr_exact: info(" (= "); break; default: internerr("unknown verrel"); } - info(versiondescribe(&possi->version,vdew_never)); + info(versiondescribe(&possi->version, vdew_nonambig)); info(")"); } } diff --git a/dselect/pkgtop.cc b/dselect/pkgtop.cc index 385ed53f..8edde413 100644 --- a/dselect/pkgtop.cc +++ b/dselect/pkgtop.cc @@ -208,14 +208,14 @@ void packagelist::redraw1itemsel(int index, int selected) { if (versioninstalled_width) mvwprintw(listpad,index,versioninstalled_column, "%-*.*s ", versioninstalled_width, versioninstalled_width, - versiondescribe(&pkg->installed.version,vdew_never)); + versiondescribe(&pkg->installed.version, vdew_nonambig)); if (versionavailable_width) { if (informativeversion(&pkg->available.version) && versioncompare(&pkg->available.version,&pkg->installed.version) > 0) wattrset(listpad, selected ? selstatesel_attr : selstate_attr); mvwprintw(listpad,index,versionavailable_column, "%-*.*s", versionavailable_width, versionavailable_width, - versiondescribe(&pkg->available.version,vdew_never)); + versiondescribe(&pkg->available.version, vdew_nonambig)); wattrset(listpad, selected ? listsel_attr : list_attr); waddch(listpad,' '); } diff --git a/src/archives.c b/src/archives.c index 0ba14d55..38e2b56a 100644 --- a/src/archives.c +++ b/src/archives.c @@ -1084,7 +1084,6 @@ int wanttoinstall(struct pkginfo *pkg, const struct versionrevision *ver, int sa * also return -1 to mean it doesn't know because it would depend on * the version number. */ - enum versiondisplayepochwhen needepochs; int r; if (pkg->want != want_install && pkg->want != want_hold) { @@ -1111,26 +1110,24 @@ int wanttoinstall(struct pkginfo *pkg, const struct versionrevision *ver, int sa pkg->status == stat_installed && !(pkg->eflag &= eflagf_reinstreq)) { if (saywhy) fprintf(stderr, _("Version %.250s of %.250s already installed, " "skipping.\n"), - versiondescribe(&pkg->installed.version,vdew_never), + versiondescribe(&pkg->installed.version, vdew_nonambig), pkg->name); return 0; } else { return 1; } } else { - needepochs= epochsdiffer(&pkg->available.version,&pkg->installed.version) ? - vdew_always : vdew_never; if (fc_downgrade) { if (saywhy) fprintf(stderr, _("%s - warning: downgrading %.250s " "from %.250s to %.250s.\n"), DPKG, pkg->name, - versiondescribe(&pkg->installed.version,needepochs), - versiondescribe(&pkg->available.version,needepochs)); + versiondescribe(&pkg->installed.version, vdew_nonambig), + versiondescribe(&pkg->available.version, vdew_nonambig)); return 1; } else { if (saywhy) fprintf(stderr, _("Will not downgrade %.250s from version %.250s " "to %.250s, skipping.\n"), pkg->name, - versiondescribe(&pkg->installed.version,needepochs), - versiondescribe(&pkg->available.version,needepochs)); + versiondescribe(&pkg->installed.version, vdew_nonambig), + versiondescribe(&pkg->available.version, vdew_nonambig)); return 0; } } diff --git a/src/configure.c b/src/configure.c index 197ebe78..0df4582c 100644 --- a/src/configure.c +++ b/src/configure.c @@ -131,7 +131,7 @@ void deferred_configure(struct pkginfo *pkg) { " reinstall it before attempting configuration.")); printf(_("Setting up %s (%s) ...\n"),pkg->name, - versiondescribe(&pkg->installed.version,vdew_never)); + versiondescribe(&pkg->installed.version, vdew_nonambig)); if (f_noact) { pkg->status= stat_installed; diff --git a/src/query.c b/src/query.c index cc1324f0..1addb082 100644 --- a/src/query.c +++ b/src/query.c @@ -139,7 +139,7 @@ static void list1package(struct pkginfo *pkg, int *head, if (!pdesc) pdesc= _("(no description available)"); plen= strlen(pkgl[i]->name); - vlen= strlen(versiondescribe(&pkgl[i]->installed.version,vdew_never)); + vlen = strlen(versiondescribe(&pkgl[i]->installed.version, vdew_nonambig)); dlen= strcspn(pdesc, "\n"); if (plen > nw) nw = plen; if (vlen > vw) vw = vlen; @@ -176,7 +176,7 @@ Desired=Unknown/Install/Remove/Purge/Hold\n\ "nUFiHc"[pkg->status], " R?#"[pkg->eflag], pkg->name, - versiondescribe(&pkg->installed.version,vdew_never), + versiondescribe(&pkg->installed.version, vdew_nonambig), l, pdesc); } -- 2.39.5