Re: [cdebconf] New EXTERNAL command (was Re: Slow redraws in the debootstrap stage)

2003-11-16 Thread Joey Hess
Denis Barbier wrote:
 On Thu, Nov 13, 2003 at 12:54:15PM -0500, Joey Hess wrote:
 [...]
   I believe that all we need is an EXTERNAL cdebconf command, which
   runs its arguments on another console and waits for its child to
   finish.  The di-utils-shell could then simply become
 #! /bin/sh
 . /usr/share/debconf/confmodule
 db_external /bin/sh
  
  I think this might be a good idea, but it should just tear down the
  current debconf UI (if necessary, not for X), then run the program and
  then set up the UI again.
 
 Implemented in the cdebconf_external branch, tested with text and newt
 frontends.  Enjoy ;)

Cool, someone should update di-utils-shell and I suppose partitioner to
use this. Would myself but real life is intervening right now.

-- 
see shy jo


signature.asc
Description: Digital signature


Re: Slow redraws in the debootstrap stage

2003-11-13 Thread Joey Hess
Denis Barbier wrote:
 For (b), where should cfdisk be displayed?  Certainly not on the
 same window.  So when scripts or programs are displaying something,
 they have to be directed elsewere.  Maybe the newt frontend could
 run cfdisk on another console, switch to this console and display a
 message in newt telling that an application is running on vcN.

It has to go to the same console to support serial installs.

 I believe that all we need is an EXTERNAL cdebconf command, which
 runs its arguments on another console and waits for its child to
 finish.  The di-utils-shell could then simply become
   #! /bin/sh
   . /usr/share/debconf/confmodule
   db_external /bin/sh

I think this might be a good idea, but it should just tear down the
current debconf UI (if necessary, not for X), then run the program and
then set up the UI again.

-- 
see shy jo


signature.asc
Description: Digital signature


Re: Slow redraws in the debootstrap stage

2003-11-12 Thread Christian Perrier
Quoting Matt Kraai ([EMAIL PROTECTED]):

 No, it grows and shrinks.  I had a patch to make it only get
 bigger, but I thought the consensus was that it was the wrong
 approach.  If I misunderstood, please let me know and I'll commit
 it.

Well, for a user point of view, this *is* the solution.

What *I* call flashing box effect is the grow/shrink effect of
progress bars when , for instance, d-i modules are fetched then
loaded. The box flashes as it always adapts to 1-line/2-line
text...depending on the string length.

If your patch freeezes the dialog box size when it grows up to, say, 2
lines, and then forbids it to shrink down when 1 line is enough, then
your patch does the work.



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Slow redraws in the debootstrap stage

2003-11-11 Thread Joey Hess
Denis Barbier wrote:
 Could someone please test the attached patch?
 I cannot test it myself at the moment, but I believe that it eliminates
 those flashing boxes.

It seems rather broken. When the hw-detect progress bar was displayed,
it cleared the screen to blue each time the bar was updated. Then it
displayed the inside of the dialg box, but not the border. This was very
slow and very obvious on vmware.

-- 
see shy jo


signature.asc
Description: Digital signature


Re: Slow redraws in the debootstrap stage

2003-11-11 Thread Denis Barbier
On Tue, Nov 11, 2003 at 01:41:02PM -0500, Joey Hess wrote:
 Denis Barbier wrote:
  Could someone please test the attached patch?
  I cannot test it myself at the moment, but I believe that it eliminates
  those flashing boxes.
 
 It seems rather broken. When the hw-detect progress bar was displayed,
 it cleared the screen to blue each time the bar was updated. Then it
 displayed the inside of the dialg box, but not the border. This was very
 slow and very obvious on vmware.

Here is another patch.  I managed to get hw-detect to work directly under
cdebconf and so could test it, but I prefer anyway to have it reviewed.
As the previous one, it only addresses the flashing boxes problem, I
still do not know what to do with resized boxes.

Denis
Index: src/modules/frontend/newt/newt.c
===
RCS file: 
/cvs/debian-boot/debian-installer/tools/cdebconf/src/modules/frontend/newt/newt.c,v
retrieving revision 1.40
diff -u -r1.40 newt.c
--- src/modules/frontend/newt/newt.c8 Nov 2003 22:39:41 -   1.40
+++ src/modules/frontend/newt/newt.c11 Nov 2003 20:56:29 -
@@ -901,17 +901,19 @@
 obj-interactive = 1;
 obj-data = calloc(1, sizeof(struct newt_data));
 newtInit();
+newtCls();
 newtGetScreenSize(width, height);
 // Fill the screen so people can shift-pgup properly
 for (i = 0; i  height; i++)
 putchar('\n');
-newtFinished();
+newtRefresh();
 return DC_OK;
 }
 
 static int
 newt_shutdown(struct frontend *obj)
 {
+newtFinished();
 return DC_OK;
 }
 
@@ -926,36 +928,25 @@
 static int
 newt_go(struct frontend *obj)
 {
-struct newt_data *data = (struct newt_data *)obj-data;
 struct question *q = obj-questions;
-int i, ret = DC_OK, cleared;
+int i, ret = DC_OK;
 
-cleared = 0;
 while (q != NULL) {
 for (i = 0; i  DIM(question_handlers); i++) {
 if (strcmp(q-template-type, question_handlers[i].type) == 0) {
-if (!cleared  !data-scale_form) {
-cleared = 1;
-newtInit();
-newtCls();
-}
 ret = question_handlers[i].handler(obj, q);
 if (ret == DC_OK)
 obj-qdb-methods.set(obj-qdb, q);
 else if (ret == DC_GOBACK  q-prev != NULL)
 q = q-prev;
-else {
-newtFinished();
+else
 return ret;
-}
 break;
 }
 }
 if (ret == DC_OK)
 q = q-next;
 }
-if (cleared  !data-scale_form)
-newtFinished();
 return DC_OK;
 }
 
@@ -981,8 +972,6 @@
 obj-progress_min = min;
 obj-progress_max = max;
 obj-progress_cur = min;
-newtInit();
-newtCls();
 newtGetScreenSize(width, NULL);
 win_width = width-7;
 newtCenteredWindow(win_width, 5, title);
@@ -1070,7 +1059,6 @@
 if (data-scale_form != NULL) {
 newtFormDestroy(data-scale_form);
 newtPopWindow();
-newtFinished();
 data-scale_form = data-scale_bar = data-perc_label = data-scale_textbox = 
NULL;
 }
 }


Re: Slow redraws in the debootstrap stage

2003-11-11 Thread kraai
Denis Barbier wrote:
 On Tue, Nov 11, 2003 at 01:41:02PM -0500, Joey Hess wrote:
  Denis Barbier wrote:
   Could someone please test the attached patch?
   I cannot test it myself at the moment, but I believe that it eliminates
   those flashing boxes.
  
  It seems rather broken. When the hw-detect progress bar was displayed,
  it cleared the screen to blue each time the bar was updated. Then it
  displayed the inside of the dialg box, but not the border. This was very
  slow and very obvious on vmware.
 
 Here is another patch.  I managed to get hw-detect to work directly under
 cdebconf and so could test it, but I prefer anyway to have it reviewed.
 As the previous one, it only addresses the flashing boxes problem, I
 still do not know what to do with resized boxes.

I've sponsored an NMU of debootstrap by Steinar that should make the resizing
much less frequent.

-- 
Matt


-
This message was sent using the LA Free-Net - LA's best kept secret.
http://www.lafn.org/



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Slow redraws in the debootstrap stage

2003-11-11 Thread Denis Barbier
On Tue, Nov 11, 2003 at 09:38:14PM +, [EMAIL PROTECTED] wrote:
 Denis Barbier wrote:
[...]
  I still do not know what to do with resized boxes.
 
 I've sponsored an NMU of debootstrap by Steinar that should make the resizing
 much less frequent.

Thanks, this is certainly the best solution.

Denis


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Slow redraws in the debootstrap stage

2003-11-11 Thread Joey Hess
Denis Barbier wrote:
 Here is another patch.  I managed to get hw-detect to work directly under
 cdebconf and so could test it, but I prefer anyway to have it reviewed.
 As the previous one, it only addresses the flashing boxes problem, I
 still do not know what to do with resized boxes.

Oh hmm, I am not really sure what flashing boxes problem that is, I
thought this was to fix the resizing progress bar problem. Someone else
who knows the problem ought to test it.

-- 
see shy jo


signature.asc
Description: Digital signature


Re: Slow redraws in the debootstrap stage

2003-11-11 Thread Denis Barbier
On Tue, Nov 11, 2003 at 05:11:26PM -0500, Joey Hess wrote:
 Denis Barbier wrote:
  Here is another patch.  I managed to get hw-detect to work directly under
  cdebconf and so could test it, but I prefer anyway to have it reviewed.
  As the previous one, it only addresses the flashing boxes problem, I
  still do not know what to do with resized boxes.
 
 Oh hmm, I am not really sure what flashing boxes problem that is, I
 thought this was to fix the resizing progress bar problem. Someone else
 who knows the problem ought to test it.

I am mainly interested to know whether it breaks anything.
If not, I want to apply this patch even if it does not fix any obvious
problem, because it makes it very easy to add a Working, please wait
text on the root window which will become visible when no windows are
displayed.  To do so, add
  newtDrawRootText(width/2-11, height/2, Working, please wait...);
at the end of newt_initialize().

Denis


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Slow redraws in the debootstrap stage

2003-11-11 Thread Joey Hess
Denis Barbier wrote:
 I am mainly interested to know whether it breaks anything.
 If not, I want to apply this patch even if it does not fix any obvious
 problem, because it makes it very easy to add a Working, please wait
 text on the root window which will become visible when no windows are
 displayed.  To do so, add
   newtDrawRootText(width/2-11, height/2, Working, please wait...);
 at the end of newt_initialize().

In that case, I tested the patch with a 3 floppy + CD install in. I
suspended that session after it started to retreive debs from the CD.

There is one weird thing I do not understand. Remember the black
character at the bottom-right corner? Well, it is now one line higher
than it used to be. I made sure to refresh the screen, this is not a
transient glitch. Strange. Later on in the install it moved to the
bottom where I expect it.

After cfdisk runs, the screen is corrupted. Looks like cdebconf draws
the next dialog box on top of what cdebconf left on the screen, without
clearing it. I don't know if it's related, but I then ran a shell from
the menu, and the terminal was in stair-step mode. Never seen that
before. I was interested to see if what I had done in the shell would
remain on the screen when I got back to the menu, but it jumped into
high priority mode and ran something that immediatly displayed a red
error, which redrew the screen, so I don't know.

The progress bar dialog does of course resize a few times, even with
debootstrap fixes, since the descriptions of some kernel modules are
rather long. I wish it would only grow bigger, not smaller..

-- 
see shy jo


signature.asc
Description: Digital signature


Re: Slow redraws in the debootstrap stage

2003-11-11 Thread Steinar H. Gunderson
On Tue, Nov 11, 2003 at 08:17:07PM -0500, Joey Hess wrote:
 The progress bar dialog does of course resize a few times, even with
 debootstrap fixes, since the descriptions of some kernel modules are
 rather long. I wish it would only grow bigger, not smaller..

This is already the case, isn't it? It gets reset when a new progress bar
starts, though. Should we fix hw-detect to cut the names with ... in the
middle?

/* Steinar */
-- 
Homepage: http://www.sesse.net/


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Slow redraws in the debootstrap stage

2003-11-10 Thread Christian Perrier
Quoting Joey Hess ([EMAIL PROTECTED]):
 Leaving aside the cdebconf progress bar resize bug, if I were doing any
 number of installs over slow serial (more than 1..), I would switch d-i

The redraw problem is, btw, also a problem for VmWare installs. Screen
drawing is really slow on some VmWare setups (mine for instance)
and the flashing boxes mentioned in this thread are indeed a bit
annoying.



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Slow redraws in the debootstrap stage

2003-11-10 Thread Denis Barbier
On Mon, Nov 10, 2003 at 07:15:46AM +0100, Christian Perrier wrote:
 Quoting Joey Hess ([EMAIL PROTECTED]):
  Leaving aside the cdebconf progress bar resize bug, if I were doing any
  number of installs over slow serial (more than 1..), I would switch d-i
 
 The redraw problem is, btw, also a problem for VmWare installs. Screen
 drawing is really slow on some VmWare setups (mine for instance)
 and the flashing boxes mentioned in this thread are indeed a bit
 annoying.

Could someone please test the attached patch?
I cannot test it myself at the moment, but I believe that it eliminates
those flashing boxes.

Denis
Index: debian/changelog
===
RCS file: /cvs/debian-boot/debian-installer/tools/cdebconf/debian/changelog,v
retrieving revision 1.251
diff -u -r1.251 changelog
--- debian/changelog10 Nov 2003 18:40:08 -  1.251
+++ debian/changelog11 Nov 2003 00:11:18 -
@@ -5,6 +5,9 @@
   * Denis Barbier
 - Fix navigation with arrow keys in the newt frontend.  Closes: #218844.
 - Provide a better example in src/test/backup.config
+- Do not call newtInit/newtFinished when displaying progress bars,
+  these functions should only be called when starting and stopping
+  the interface, and caused flashing effects.
   * Chris Tillman
 - s/debconf/cdebconf/ in man pages.
 
Index: src/modules/frontend/newt/newt.c
===
RCS file: 
/cvs/debian-boot/debian-installer/tools/cdebconf/src/modules/frontend/newt/newt.c,v
retrieving revision 1.40
diff -u -r1.40 newt.c
--- src/modules/frontend/newt/newt.c8 Nov 2003 22:39:41 -   1.40
+++ src/modules/frontend/newt/newt.c11 Nov 2003 00:11:19 -
@@ -901,17 +901,18 @@
 obj-interactive = 1;
 obj-data = calloc(1, sizeof(struct newt_data));
 newtInit();
+newtCls();
 newtGetScreenSize(width, height);
 // Fill the screen so people can shift-pgup properly
 for (i = 0; i  height; i++)
 putchar('\n');
-newtFinished();
 return DC_OK;
 }
 
 static int
 newt_shutdown(struct frontend *obj)
 {
+newtFinished();
 return DC_OK;
 }
 
@@ -926,26 +927,19 @@
 static int
 newt_go(struct frontend *obj)
 {
-struct newt_data *data = (struct newt_data *)obj-data;
 struct question *q = obj-questions;
-int i, ret = DC_OK, cleared;
+int i, ret = DC_OK;
 
-cleared = 0;
 while (q != NULL) {
 for (i = 0; i  DIM(question_handlers); i++) {
 if (strcmp(q-template-type, question_handlers[i].type) == 0) {
-if (!cleared  !data-scale_form) {
-cleared = 1;
-newtInit();
-newtCls();
-}
 ret = question_handlers[i].handler(obj, q);
 if (ret == DC_OK)
 obj-qdb-methods.set(obj-qdb, q);
 else if (ret == DC_GOBACK  q-prev != NULL)
 q = q-prev;
 else {
-newtFinished();
+newtCls();
 return ret;
 }
 break;
@@ -954,8 +948,7 @@
 if (ret == DC_OK)
 q = q-next;
 }
-if (cleared  !data-scale_form)
-newtFinished();
+newtCls();
 return DC_OK;
 }
 
@@ -981,8 +974,6 @@
 obj-progress_min = min;
 obj-progress_max = max;
 obj-progress_cur = min;
-newtInit();
-newtCls();
 newtGetScreenSize(width, NULL);
 win_width = width-7;
 newtCenteredWindow(win_width, 5, title);
@@ -1070,7 +1061,6 @@
 if (data-scale_form != NULL) {
 newtFormDestroy(data-scale_form);
 newtPopWindow();
-newtFinished();
 data-scale_form = data-scale_bar = data-perc_label = data-scale_textbox = 
NULL;
 }
 }


Re: Slow redraws in the debootstrap stage

2003-11-09 Thread Steinar H. Gunderson
On Sun, Nov 09, 2003 at 06:37:25PM +0100, Karsten Merker wrote:
 during the install base system step in d-i, i.e. while debootstrap
 is running, there is one annoying effect. The newt frontend redraws
 the whole status box (the progress bar and the text about which file
 is retrieved respective validated currently) very often (i.e. twice
 for each package in many cases). This is caused by the fact that the
 retrieving-lines are longer than the validating-lines and so they
 wrap into the next line, which causes the newt frontend to redraw a
 larger bounding box. When the next file is retrieved, the line is
 shorter again, so a smaller bounding box is redrawn again. The
 redrawing itself first overwrites the whole bounding box with the blue
 background and then overwrites the blue background again with a new
 bounding box.

Please see bug #213669. :-)

/* Steinar */
-- 
Homepage: http://www.sesse.net/


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Slow redraws in the debootstrap stage

2003-11-09 Thread Steinar H. Gunderson
On Sun, Nov 09, 2003 at 06:46:01PM +0100, Steinar H. Gunderson wrote:
 during the install base system step in d-i, i.e. while debootstrap
 is running, there is one annoying effect. The newt frontend redraws
 the whole status box (the progress bar and the text about which file
 is retrieved respective validated currently) very often (i.e. twice
 for each package in many cases).
 Please see bug #213669. :-)

FWIW, I have an NMU ready to fix #213669 and #210912 (another
cosmetical/user-friendliess problem with debootstrap under d-i), but my
sponsor didn't have time to upload it before the beta yesterday. The changes
are quite small -- if anybody else would like to take a look at it and do the
NMU (as per debootstrap's README.Debian), feel free to contact me. :-)
 
/* Steinar */
-- 
Homepage: http://www.sesse.net/


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Slow redraws in the debootstrap stage

2003-11-09 Thread Joey Hess
Leaving aside the cdebconf progress bar resize bug, if I were doing any
number of installs over slow serial (more than 1..), I would switch d-i
to use the cdebconf text frontend in my install media. Of course we
don't currently ship any media with that frontend on them, but it should
be an easy change, and make serial installs much more fun.

-- 
see shy jo


signature.asc
Description: Digital signature