The 'dialog' tool provided in RH 6.0 distribution does not work in some cases. Two known bugs are: 1. dialog --yesno "hello" 80 20 leads to: Segmentation fault (core dumped) (above example just swaps correct "width" and "height") 2. for i in 20 40 60 80 ; do echo $i ; sleep 1 ; done |\ dialog --gauge "hello" 20 70 0 leads to: Broken pipe
This patch excludes the loop patch. The loop patch checks that fd0 is a tty. Which, in case the --gauge option is given, is a pipe. --- dialog-0.6.spec.orig Thu Jan 20 14:45:14 2000 +++ dialog-0.6.spec Thu Jan 20 14:45:18 2000 @@ -23,7 +23,7 @@ %setup -q %patch0 -p1 -b .ncurses %patch1 -p1 -b .opt -%patch2 -p1 -b .loop +# %patch2 -p1 -b .loop cd src make depend
Second is fixed in dialog-0.6-15; as for the first, we're taking patches to make it smarter.
Allright, then we got a gauge, but thats a gauge without the bar I used to know. I patched gauge.c a little, and now it has the status IWGEFM (It Works Good Enough For Me :)). Ehh, does Marc still maintain dialog? --- gauge.c.orig Mon Jan 16 00:48:14 1995 +++ gauge.c Thu Jan 20 17:37:12 2000 @@ -72,17 +72,18 @@ waddch(dialog, ' '); } - wattrset(dialog, title_attr); - wmove(dialog, height - 3, (width / 2) - 2); - sprintf(buf, "%3d%%", percent); - waddstr(dialog, buf); - x = (percent * (width - 8)) / 100; wattrset(dialog, item_selected_attr); wmove(dialog, height - 3, 4); for (i = 0; i < x; i++) { - waddch(dialog, winch(dialog)); +//waddch(dialog, winch(dialog)); + waddch(dialog, ACS_BLOCK); } + wattrset(dialog, title_attr); + wmove(dialog, height - 3, (width / 2) - 2); + sprintf(buf, "%3d%%", percent); + waddstr(dialog, buf); + wrefresh(dialog);
Hmmm, Debian has a cdialog0.9 version, based on dialog 0.6c I will look into rpm'ing that version. New features include time out etc...