dselect suggestions [PATCHES]
Attached are a few small patches to dselect against the version in
dpkg-1.6.1.
Please use/modify these patches as you see fit.
color.diff: changes the color of the column headings in lists (this affects
both select and access)
describemany.diff: changes '-' to ACS_HLINE and moves the display one column
to the right
expert.diff: adds an `expert' mode which doesn't display the help screen
before each new mode in select.
diff -u --recursive dpkg-1.6.1.orig/dselect/baselist.cc dpkg-1.6.1/dselect/baselist.cc
--- dpkg-1.6.1.orig/dselect/baselist.cc Thu Oct 28 09:05:47 1999
+++ dpkg-1.6.1/dselect/baselist.cc Sun Nov 28 22:33:07 1999
@@ -121,6 +121,7 @@
thisstate_attr= COLOR_PAIR(3);
selstate_attr= list_attr|A_BOLD;
selstatesel_attr= listsel_attr|A_BOLD;
+ colheads_attr= COLOR_PAIR(3);
} else {
title_attr= A_REVERSE;
thisstate_attr= A_STANDOUT;
@@ -128,10 +129,11 @@
listsel_attr= A_STANDOUT;
selstate_attr= A_BOLD;
selstatesel_attr= A_STANDOUT;
+ colheads_attr= A_BOLD;
}
query_attr= title_attr;
info_attr= list_attr;
- colheads_attr= info_headattr= A_BOLD;
+ info_headattr= A_BOLD;
whatinfo_attr= thisstate_attr;
// set up windows and pads, based on screen size
diff -u --recursive dpkg-1.6.1.orig/dselect/pkgtop.cc dpkg-1.6.1/dselect/pkgtop.cc
--- dpkg-1.6.1.orig/dselect/pkgtop.cc Sat Oct 30 08:09:59 1999
+++ dpkg-1.6.1/dselect/pkgtop.cc Sun Nov 28 22:51:25 1999
@@ -234,10 +234,10 @@
indent= describemany(buf,priority,section,pkg->clientdata);
- mvwaddstr(listpad,index,0, " ");
- i= total_width-6;
+ mvwaddstr(listpad,index,0, " ");
+ i= total_width-7;
j= (indent<<1) + 1;
- while (j-- >0) { waddch(listpad,'-'); i--; }
+ while (j-- >0) { waddch(listpad,ACS_HLINE); i--; }
waddch(listpad,' ');
wattrset(listpad, selected ? selstatesel_attr : selstate_attr);
@@ -247,7 +247,7 @@
waddch(listpad,' ');
j= (indent<<1) + 1;
- while (j-- >0) { waddch(listpad,'-'); i--; }
+ while (j-- >0) { waddch(listpad,ACS_HLINE); i--; }
delete[] buf;
diff -u --recursive dpkg-1.6.1.orig/dselect/dselect.h dpkg-1.6.1/dselect/dselect.h
--- dpkg-1.6.1.orig/dselect/dselect.h Wed Oct 13 10:52:49 1999
+++ dpkg-1.6.1/dselect/dselect.h Sun Nov 28 23:17:24 1999
@@ -149,6 +149,7 @@
extern const char *admindir;
extern FILE *debug;
+extern int expertmode;
enum urqresult { urqr_normal, urqr_fail, urqr_quitmenu };
enum quitaction { qa_noquit, qa_quitchecksave, qa_quitnochecksave };
diff -u --recursive dpkg-1.6.1.orig/dselect/main.cc dpkg-1.6.1/dselect/main.cc
--- dpkg-1.6.1.orig/dselect/main.cc Sat Oct 30 08:09:59 1999
+++ dpkg-1.6.1/dselect/main.cc Sun Nov 28 23:23:20 1999
@@ -53,6 +53,7 @@
modstatdb_rw readwrite;
const char *admindir= ADMINDIR;
FILE *debug;
+int expertmode = 0;
static keybindings packagelistbindings(packagelist_kinterps,packagelist_korgbindings);
@@ -91,7 +92,7 @@
_("Usage: dselect [options]\n"
" dselect [options] action ...\n"
"Options: --admindir <directory> (default is /var/lib/dpkg)\n"
- " --help --version --licence --debug <file> | -D<file> | -D\n"
+ " --help --version --licence --expert --debug <file> | -D<file> | -D\n"
"Actions: access update select install config remove quit menu\n"),
stdout)) werr("stdout");
}
@@ -138,11 +139,16 @@
setvbuf(debug,0,_IONBF,0);
}
+ static void setexpert() {
+ expertmode = 1;
+ }
+
} /* End of extern "C" */
static const struct cmdinfo cmdinfos[]= {
{ "admindir", 0, 1, 0, &admindir, 0 },
{ "debug", 'D', 1, 0, 0, setdebug },
+ { "expert", 'E', 0, 0, 0, setexpert },
{ "help", 'h', 0, 0, 0, helponly },
{ "version", 0, 0, 0, 0, versiononly },
{ "licence", 0, 0, 0, 0, showcopyright }, /* UK spelling */
diff -u --recursive dpkg-1.6.1.orig/dselect/pkglist.cc dpkg-1.6.1/dselect/pkglist.cc
--- dpkg-1.6.1.orig/dselect/pkglist.cc Sat Oct 30 08:09:59 1999
+++ dpkg-1.6.1/dselect/pkglist.cc Sun Nov 28 23:19:03 1999
@@ -491,7 +491,9 @@
setupsigwinch();
startdisplay();
- displayhelp(helpmenulist(),'i');
+
+ if (!expertmode)
+ displayhelp(helpmenulist(),'i');
if (debug) fprintf(debug,"packagelist[%p]::display() entering loop\n",this);
for (;;) {
Reply to: