summaryrefslogtreecommitdiff
path: root/dselect/pkgdisplay.cc
diff options
context:
space:
mode:
authorIan Jackson <ian@chiark.chu.cam.ac.uk>1996-05-16 00:01:21 +0100
committerIan Jackson <ian@chiark.chu.cam.ac.uk>1996-05-16 00:01:21 +0100
commitd4d3484ac88ca3953fef3cf2c0464cdc776b6574 (patch)
treeab15ab1e585e5c1d97b44f7b880af96632b1f08c /dselect/pkgdisplay.cc
parent258ed6ae6ff639a76b534353fcc502d4ca97ca8c (diff)
downloaddpkg-d4d3484ac88ca3953fef3cf2c0464cdc776b6574.tar.gz
dpkg (1.2.0); priority=MEDIUM
* dselect can sort packages by available and installed states, and display their version numbers. (Use O, o and V.) * Hold is properly integrated as a real `wanted state', rather than a separate flag. * Epochs in version numbers implemented, using the syntax <epoch>:<version>-<revision>. (Epoch not usually displayed.) * dselect disk method is architecture-independent (uses dpkg's installation architecture, and looks in the right part of the tree). * dselect disk method doesn't try to satisfy the predependencies of packages which are on hold. * Fixed conflict-related assertion failure. (Bug#2784.) * conffiles do not cause file conflicts if the conflicting package is in the `configuration only' state. (Bug#2720.) * Fixed messages where available version number was reported as installed version in conflict and dependency messages. (Bug#2654, Bug#2974.) * New format .deb files are default even for a.out compiles (but a.out version of dpkg is in old format). * Characters @:= (at colon equals) in package names now strictly forbidden everywhere (_ is still allowed in existing packages). * New dpkg --print-installation-architecture option prints installation architecture (compiled in), rather than build architecture (determined from gcc -print-libgcc-file-name). * Version messages show whether compiled a.out or ELF (i386 only). * Fixed missing space in version syntax error messages. * Manpage dpkg.8 installed with warning about inaccuracy. * Guidelines don't say to stop and restart daemons in runlevels 2345; instead they say to start in 2345 and stop in 016. * Guidelines and version messages say just Debian Linux. * Guidelines typo fix `"stop2' => `"stop"'. (Bug#2867.) * doc/Makefile.in clean properly deletes various guidelines.info* files. -- Ian Jackson <ian@chiark.chu.cam.ac.uk> Thu, 16 May 1996 00:01:21 +0100
Diffstat (limited to 'dselect/pkgdisplay.cc')
-rw-r--r--dselect/pkgdisplay.cc107
1 files changed, 96 insertions, 11 deletions
diff --git a/dselect/pkgdisplay.cc b/dselect/pkgdisplay.cc
index 4704e217c..bedac26c4 100644
--- a/dselect/pkgdisplay.cc
+++ b/dselect/pkgdisplay.cc
@@ -35,9 +35,8 @@ extern "C" {
/* These MUST be in the same order as the corresponding enums in dpkg-db.h */
const char
- *const wantstrings[]= { "new package", "selected", "deselected", "purge", 0 },
- *const holdstrings[]= { "", "on hold", "REINSTALL",
- "hold,REINSTALL", 0 },
+ *const wantstrings[]= { "new package", "selected", "hold", "remove", "purge", 0 },
+ *const eflagstrings[]= { "", "REINSTALL", 0 },
*const statusstrings[]= { "not installed", "unpacked (not set up)",
"failed config", "installed", "half installed",
"removed (configs remain)", 0 },
@@ -49,9 +48,34 @@ const char
*const priorityabbrevs[]= { "Req", "Imp", "Std", "Rec",
"Opt", "Xtr", "Ctb",
"bUG", "?" };
-const char statuschars[]= " uF*H-";
-const char holdchars[]= " hRX";
-const char wantchars[]= "n*-_";
+const char statuschars[]= " UF*H-";
+const char eflagchars[]= " R?#";
+const char wantchars[]= "n*=-_";
+
+/* These MUST be in the same order as the corresponding enums in pkglist.h */
+const char
+ *const ssaabbrevs[]= { "Broken",
+ "New",
+ "Updated",
+ "Obsolete/local",
+ "Up-to-date",
+ "Available" },
+ *const ssastrings[]= { "Brokenly installed packages",
+ "Newly available packages",
+ "Updated packages (newer version is available)",
+ "Obsolete and local packages present on system",
+ "Up to date installed packages",
+ "Available packages (not currently installed)" };
+
+const char
+ *const sssstrings[]= { "Brokenly installed packages",
+ "Installed packages",
+ "Removed packages (configuration still present)",
+ "Purged packages and those never installed" },
+ *const sssabbrevs[]= { "Broken",
+ "Installed",
+ "Removed",
+ "Purged" };
static int maximumstring(const char *const *array) {
int maxlen= 0;
@@ -74,7 +98,7 @@ void packagelist::setwidths() {
status_want_width= maximumstring(wantstrings);
status_width= status_hold_width+status_status_width+status_want_width*2+3;
priority_width= 8;
- package_width= 16;
+ package_width= 16;
} else {
status_width= 4;
priority_width= 3;
@@ -94,8 +118,31 @@ void packagelist::setwidths() {
package_column= section_column + section_width + gap_width;
}
- description_column= package_column + package_width + gap_width;
-
+ int versiondescriptioncolumn= package_column + package_width + gap_width;
+
+ switch (versiondisplayopt) {
+ case vdo_none:
+ versioninstalled_column= versioninstalled_width= 0;
+ versionavailable_column= versionavailable_width= 0;
+ description_column= versiondescriptioncolumn;
+ break;
+ case vdo_available:
+ versioninstalled_column= versioninstalled_width= 0;
+ versionavailable_column= versiondescriptioncolumn;
+ versionavailable_width= 11;
+ description_column= versionavailable_column + versionavailable_width + gap_width;
+ break;
+ case vdo_both:
+ versioninstalled_column= versiondescriptioncolumn;
+ versioninstalled_width= 11;
+ versionavailable_column= versioninstalled_column + versioninstalled_width +gap_width;
+ versionavailable_width= versioninstalled_width;
+ description_column= versionavailable_column + versionavailable_width + gap_width;
+ break;
+ default:
+ internerr("unknown versiondisplayopt in setwidths");
+ }
+
total_width= TOTAL_LIST_WIDTH;
description_width= total_width - description_column;
}
@@ -114,12 +161,50 @@ void packagelist::redrawtitle() {
if (x < xmax) {
switch (sortorder) {
case so_section:
- waddnstr(titlewin, " (by section)", xmax-x);
+ switch (statsortorder) {
+ case sso_unsorted:
+ waddnstr(titlewin, " (by section)", xmax-x);
+ break;
+ case sso_avail:
+ waddnstr(titlewin, " (avail., section)", xmax-x);
+ break;
+ case sso_state:
+ waddnstr(titlewin, " (status, section)", xmax-x);
+ break;
+ default:
+ internerr("bad statsort in redrawtitle/so_section");
+ }
break;
case so_priority:
- waddnstr(titlewin, " (by priority)", xmax-x);
+ switch (statsortorder) {
+ case sso_unsorted:
+ waddnstr(titlewin, " (by priority)", xmax-x);
+ break;
+ case sso_avail:
+ waddnstr(titlewin, " (avail., priority)", xmax-x);
+ break;
+ case sso_state:
+ waddnstr(titlewin, " (status, priority)", xmax-x);
+ break;
+ default:
+ internerr("bad statsort in redrawtitle/so_priority");
+ }
break;
case so_alpha:
+ switch (statsortorder) {
+ case sso_unsorted:
+ waddnstr(titlewin, " (alphabetically)", xmax-x);
+ break;
+ case sso_avail:
+ waddnstr(titlewin, " (by availability)", xmax-x);
+ break;
+ case sso_state:
+ waddnstr(titlewin, " (by status)", xmax-x);
+ break;
+ default:
+ internerr("bad statsort in redrawtitle/so_priority");
+ }
+ break;
waddnstr(titlewin, " (alphabetically)", xmax-x);
break;
case so_unsorted: