On Mon, Aug 14, 2000 at 11:38:28PM -0700, Joey Hess wrote: > > ====================================================================== > > ------------- Question depends on test on fie system > > / ------------ Question important (IMHO) > > |/ ----------- Depends on previous answer > > ||/ ---------- Needs run time test > > |||/ __ can be pre asked > > |||| / > > |||| | > > |||| | > > X...........Y 1) Ask to remove /System.map files > > .X Y 2) ask to prepare a boot floppy > > XXX.........Y 3) ask which floppy drive to use > > .XX.........? 4) do I need to format the floppy? > > .XXX........N 5) Insert floppy, hit return > > .XXX........N 6) failure, retry? > > .XXX........N 7) failure, you have formatted floppy? > > .XXX........N 8) you have floppy, hit return when ready > > .XXX........N 9) Failure writing floppy, retry? > > .XXX........N 10) failure, hit return when youhave new floppy > > XX..........Y 11) if conf exists ask if we should run $loader with old > > config > > XXX.........Y 12) Or else ask if a new $loader config > > .XX.........Y 13) Or else ask if loader needed at all > > .XX.........N 14) Install boot vlock on partition detected at runtime > > XXXX........N 15) Install mbr root disk > > .XXX........N 16) Failure writing mbr, do this manually, hit return > > .XX.........N 17) make that partition active? > > ====================================================================== > > Right. This is obviously a rather important package, which *cannot* > fail, plus is is very dependant on the actual state of the system. As > such, the best you'll be able to do is allow a few questions to be > pre-asked, and defer the remainder to the appropriate maintainer script. > > (BTW, I'm ccing this to Wichert and AJ as a sterling example of why > debconf has to continue to support this type of thing in maintainer > scripts. I think both of them don't want it to have this capability,[..]
You'd be at least half right. To clarify a little: I want to be able to answer the questions up front, do the install and have it work. If I've made a mistake (like not put a file where I said I did maybe), I don't mind if it dies and leaves that package to be configured later or something. I don't want it to pause and leave the rest of the system unconfigured, though. This is just for my system, I don't really care that much how it works for other people. If we go through the `N' questions above, we have: > > .XXX........N 6) failure, retry? > > .XXX........N 7) failure, you have formatted floppy? > > .XXX........N 9) Failure writing floppy, retry? > > .XXX........N 10) failure, hit return when youhave new floppy > > .XXX........N 16) Failure writing mbr, do this manually, hit return ...failure cases, which I want to address as late as possible, rather than as soon as possible. (The realplayer question is mainly a failure question too, iirc) > > .XXX........N 5) Insert floppy, hit return > > .XX.........? 4) do I need to format the floppy? > > .XXX........N 8) you have floppy, hit return when ready ...questions needing a temporary change in hardware. I'd answer "no, I don't want to have a floppy" initially, or perhaps want to run /usr/lib/kernel-2.2.17/make-floppy or something after my install's completed. > > .XX.........N 14) Install boot block on partition detected at runtime You can detect stuff at runtime from within the .config too; you should be able to this before the package is actually installed. At worst, you can say "no, don't try to detect it and annoy me later: this is what it should be. okay? trust me" > > XXXX........N 15) Install mbr root disk > > .XX.........N 17) make that partition active? And hence you should be able to ask these beforehand too, I think. Basically, I'd like to be able to insist that I'm *never* asked a question as part of a postinst. I'd rather the postinst fail (and I'd rather Apt/Dpkg just get on with installing everything else, although it probably won't at the moment) than get asked a question. One way of dealing with this might be to have a debconf question, debconf/interactive-postinst. If this is answered "no", then attempts to ask questions from the postinst (rather than the config) should simply fail with an error return. In .config's, logic somewhat like: db_input kernel-image-blah/make-a-boot-floppy if kernel-image-blah/make-a-boot-floppy = yes; then if debconf/interactive-postinst = no; then db_input kernel-image-blah/cant-make-a-boot-floppy db_set kernel-image-blah/make-a-boot-floppy no fi fi should be used, I suppose. Or perhaps: if debconf/interactive-postinst = yes; then db_input kernel-image-blah/make-a-boot-floppy else db_input kernel-image-blah/cant-make-a-boot-floppy db_set kernel-image-blah/make-a-boot-floppy no fi would be tidier. For the moment, though, as long as I *can* say "no, I don't want a floppy made" and end up with a non-interactive postinst, I'm happy. Cheers, aj -- Anthony Towns <[EMAIL PROTECTED]> <http://azure.humbug.org.au/~aj/> I don't speak for anyone save myself. GPG signed mail preferred. ``We reject: kings, presidents, and voting. We believe in: rough consensus and working code.'' -- Dave Clark
pgpRMiEtXltci.pgp
Description: PGP signature