[Debconf-devel] Bug#474813: Bug#474813: lprng/dpkg: preinst called with [ -z $1 ]

Joey Hess joeyh at debian.org
Mon Apr 7 23:32:10 UTC 2008


Craig Small wrote:
> On Mon, Apr 07, 2008 at 11:45:46PM +0200, Sven Joachim wrote:
> > I've put a few lines with 'echo "$1"' into the lprng preinst, and it
> > seems that $1 gets lost after the call to check_configfile_locations;
> > since that function does not do anything obviously wrong to reset the
> > positional parameters, it seems debconf does something fishy here.
> > 
> > Reassigning to debconf,
> Thanks, I really did not know what was going wrong here myself.
> Everything seemed to be ok except for that message.

This is not a debconf bug.

check_configfile_locations() {
  # Source debconf scripts
  . /usr/share/debconf/confmodule

This code contains the bug. By importing the conffmodule late, in a function,
you hide the settings of $@ from it. Or potentially worse, make $@ be
whatever is passed to the function.

Scripts that source the debconf confmodule should do so at the very top of
the script, since doing so involves starting up debconf and restarting
the script inside the debconf environment.

If you really want to source the confmodule in a a function, you will need
to make sure that $@ are passed into the function so the confmodule can see
them. But I don't recommend it.

-- 
see shy jo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.alioth.debian.org/pipermail/debconf-devel/attachments/20080407/99ae9468/attachment.pgp 


More information about the Debconf-devel mailing list