summaryrefslogtreecommitdiff
path: root/dselect/pkgtop.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/pkgtop.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/pkgtop.cc')
-rw-r--r--dselect/pkgtop.cc90
1 files changed, 70 insertions, 20 deletions
diff --git a/dselect/pkgtop.cc b/dselect/pkgtop.cc
index 845b5dd79..efb68586e 100644
--- a/dselect/pkgtop.cc
+++ b/dselect/pkgtop.cc
@@ -45,30 +45,57 @@ const char *pkgprioritystring(const struct pkginfo *pkg) {
}
}
-static int describemany(char buf[], const char *prioritystring, const char *section) {
+int packagelist::describemany(char buf[], const char *prioritystring,
+ const char *section,
+ const struct perpackagestate *pps) {
+ const char *ssostring, *ssoabbrev;
+ int statindent;
+
+ statindent= 0;
+ ssostring= 0;
+ ssoabbrev= "All";
+ switch (statsortorder) {
+ case sso_avail:
+ if (pps->ssavail == -1) break;
+ ssostring= ssastrings[pps->ssavail];
+ ssoabbrev= ssaabbrevs[pps->ssavail];
+ statindent++;
+ break;
+ case sso_state:
+ if (pps->ssstate == -1) break;
+ ssostring= sssstrings[pps->ssstate];
+ ssoabbrev= sssabbrevs[pps->ssstate];
+ statindent++;
+ break;
+ case sso_unsorted:
+ break;
+ default:
+ internerr("unknown statsortrder in describemany all");
+ }
+
if (!prioritystring) {
if (!section) {
- strcpy(buf, "All packages");
- return 0;
+ strcpy(buf, ssostring ? ssostring : "All packages");
+ return statindent;
} else {
if (!*section) {
- strcpy(buf, "All packages without a section");
+ sprintf(buf,"%s packages without a section",ssoabbrev);
} else {
- sprintf(buf, "All packages in section %s", section);
+ sprintf(buf,"%s packages in section %s",ssoabbrev,section);
}
- return 1;
+ return statindent+1;
}
} else {
if (!section) {
- sprintf(buf, "All %s packages", prioritystring);
- return 1;
+ sprintf(buf,"%s %s packages",ssoabbrev,prioritystring);
+ return statindent+1;
} else {
if (!*section) {
- sprintf(buf, "All %s packages without a section", prioritystring);
+ sprintf(buf,"%s %s packages without a section",ssoabbrev,prioritystring);
} else {
- sprintf(buf, "All %s packages in section %s", prioritystring, section);
+ sprintf(buf,"%s %s packages in section %s",ssoabbrev,prioritystring,section);
}
- return 2;
+ return statindent+2;
}
}
}
@@ -79,7 +106,7 @@ void packagelist::redrawthisstate() {
const char *section= table[cursorline]->pkg->section;
const char *priority= pkgprioritystring(table[cursorline]->pkg);
- char *buf= new char[220+
+ char *buf= new char[500+
greaterint((table[cursorline]->pkg->name
? strlen(table[cursorline]->pkg->name) : 0),
(section ? strlen(section) : 0) +
@@ -91,13 +118,13 @@ void packagelist::redrawthisstate() {
package_width,
table[cursorline]->pkg->name,
statusstrings[table[cursorline]->pkg->status],
- holdstrings[table[cursorline]->pkg->eflag][0] ? " - " : "",
- holdstrings[table[cursorline]->pkg->eflag],
+ eflagstrings[table[cursorline]->pkg->eflag][0] ? " - " : "",
+ eflagstrings[table[cursorline]->pkg->eflag],
wantstrings[table[cursorline]->selected],
wantstrings[table[cursorline]->original],
priority);
} else {
- describemany(buf,priority,section);
+ describemany(buf,priority,section,table[cursorline]->pkg->clientdata);
}
mvwaddnstr(thisstatepad,0,0, buf, total_width);
pnoutrefresh(thisstatepad, 0,leftofscreen, thisstate_row,0,
@@ -120,7 +147,7 @@ void packagelist::redraw1itemsel(int index, int selected) {
mvwprintw(listpad,index,0, "%-*.*s ",
status_hold_width, status_hold_width,
- holdstrings[pkg->eflag]);
+ eflagstrings[pkg->eflag]);
wprintw(listpad, "%-*.*s ",
status_status_width, status_status_width,
statusstrings[pkg->status]);
@@ -143,7 +170,7 @@ void packagelist::redraw1itemsel(int index, int selected) {
} else {
- mvwaddch(listpad,index,0, holdchars[pkg->eflag]);
+ mvwaddch(listpad,index,0, eflagchars[pkg->eflag]);
waddch(listpad, statuschars[pkg->status]);
waddch(listpad,
/* fixme: keep this feature? */
@@ -176,7 +203,22 @@ void packagelist::redraw1itemsel(int index, int selected) {
mvwprintw(listpad,index,package_column-1, " %-*.*s ",
package_width, package_width, pkg->name);
-
+
+ if (versioninstalled_width)
+ mvwprintw(listpad,index,versioninstalled_column, "%-*.*s ",
+ versioninstalled_width, versioninstalled_width,
+ versiondescribe(&pkg->installed.version,vdew_never));
+ 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));
+ wattrset(listpad, selected ? listsel_attr : list_attr);
+ waddch(listpad,' ');
+ }
+
i= description_width;
p= info->description ? info->description : "";
while (i>0 && *p && *p != '\n') { waddch(listpad,*p); i--; p++; }
@@ -186,11 +228,11 @@ void packagelist::redraw1itemsel(int index, int selected) {
const char *section= pkg->section;
const char *priority= pkgprioritystring(pkg);
- char *buf= new char[220+
+ char *buf= new char[500+
(section ? strlen(section) : 0) +
(priority ? strlen(priority) : 0)];
- indent= describemany(buf,priority,section);
+ indent= describemany(buf,priority,section,pkg->clientdata);
mvwaddstr(listpad,index,0, " ");
i= total_width-6;
@@ -243,6 +285,14 @@ void packagelist::redrawcolheads() {
mvwaddnstr(colheadspad,0,section_column, "Section", section_width);
mvwaddnstr(colheadspad,0,priority_column, "Priority", priority_width);
mvwaddnstr(colheadspad,0,package_column, "Package", package_width);
+
+ if (versioninstalled_width)
+ mvwaddnstr(colheadspad,0,versioninstalled_column,
+ "Inst.ver",versioninstalled_width);
+ if (versionavailable_width)
+ mvwaddnstr(colheadspad,0,versionavailable_column,
+ "Avail.ver",versionavailable_width);
+
mvwaddnstr(colheadspad,0,description_column, "Description", description_width);
}
refreshcolheads();