[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Kernel-package, fix version 2 ...



On Sun, Oct 23, 2005 at 03:00:12AM +0200, Jonas Smedegaard wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On Sat, 22 Oct 2005 23:50:10 +0200
> Sven Luther <sven.luther@wanadoo.fr> wrote:
> 
> > BTW, my new plan makes me consider two things : 
> > 
> >   1) how can i check if there is only one entry in the ramdisk=
> > line ? Reading the length of the list, or doing a shift and checking
> > for and empty list ? 
> 
> split it with the delimiting character (I proposed colon - as in
> $PATH - but don't know if it makes better sense to use comma or space).
> 
> 
> Here's what you deciphered yourself tonight in yaird, splitting a path
> into directoy/file components:
> 
>   my @components = split (/\/+/, $path);
> 
> 
> If you want _either_ colon, comma or whitespace as delimiter (not sure
> that is a good idea though) then something like this should work:
> 
>   my @entries = split (/[:,\s]+/, $line);

Well, we already do that, in fact :

    (split (/ /, $ramdisk));

But the problem is not how to split it, but how to detect it is of length 1,
that is having the legacy single entry in the field.

Not sure if allowing copa, colon or whitespace delimitation clashes with the
filenames though, as some may use comas.

> > The second issue is not really related to this plan, but we really
> > want to debconfify the kernel-package kernel scripts, this would mean
> > replacing all die and printing to stdout with proper debconf
> > messages, and inputs in the same way, and maybe redesigning some. I
> > can do this in shell, but never tried the perl solution previously.
> 
> Please do not bloat the postinst code! Separate it into a helper tool
> instead!

No way, i think you are misunderstanding here. The current code does :

  print STDERR <<"EOINFOMSG";
Using $ramdisk to build the ramdisk.
Other suitable ramdisk generating tools : @ramdisklist.
Full list of probed ramdisk generating tools : $ramdiskorig.
EOINFOMSG
  ;

And we will replace it with (shell version given) :

db_subst kernel-package/postinst_ramdisk $ramdisk
db_subst kernel-package/postinst_ramdisklist $ramdisklist
db_subst kernel-package/postinst_ramdiskorig $ramdiskorig
db_input high kernel-package/postinst_ramdisk_verbose_output || true

And then list in a template file those kernel-package/postinst_* with the
corresponding text above, and so on. 

This allow to translate those templates, to select different questions at
different priorities, and do generic preseeding of those responses for
automatic installation. Not to mention its effect on usability and such.

Furthermore it has been since before sarge policy that all user questions need
to use debconf, and it was only skipped because Manoj didn't want to do those
change (probably for lack of time), and nobody jumped in. Now is the time
though.

Does that clarify it, and if not, please explain how i could put this in a
helper tool ? 

Friendly,

Sven Luther



Reply to: