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

Re: preinst: ( "configure" && [ -n "$2" ] ) or ( "configure" && [ -z "$2" ] ) ?



  On Monday, October 9 2006 0:19 am, Stephen Gran wrote:

> >   Regarding the following part of a preinst maintainer script:
> >
> >
> > 1)    case "$1" in
> > 2)        configure)
> > 3)        if [ -n "$2" ]; then
> > 4)                mkdir -p dir/subDir
> > 5)                # First time install. Can we autodetect the old settings?
> > 6)                test for the old settings
> >
> >
> >   Am I right that the comment partially means the programmer assures us that at
> > this point it is a first time install?
> >   At the 3rd line there is a test for [ -n "$2" ]. By looking at section 6.5 of policy
> > I would say that for being assured this is a first time install the correct test
> > should have been [ -z "$2" ]. Am I right?

> You are correct.  However the "test for old settings" shortly after that
> makes no sense given that this is uspposed to be a new install.  I am
> hazarding a guess that the comment and/or the code is wring somewhere.

  The logic is that another package, which this package suppresed, but not conflicts with,
might have settings that are of interest to the new package. The new package can
suppressed, but not conflicts with, another package in the same manner that a modern
editor and ed coexists.



Reply to: