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

Re: /etc/shells management

On Sun, 7 Sep 2003 10:23:15 -0500, Branden Robinson <branden@debian.org> said: 

> On Sat, Sep 06, 2003 at 03:32:58PM -0500, Manoj Srivastava wrote:
>> case "$1" in configure)
>> # Configure this package.  If the package must prompt the user for
>> # information, do it here.  There are three sub-cases:
>> if test "${2+set}" != set; then

> Man, that's ugly.  I use:

> if [ -n "$var" ]; then fi


> for this sort of thing.  However, that does depend on a certain
> other case you handle never happening:

>> elif test -z "$2" -o "$2" = "<unknown>"; then

> file:///usr/share/doc/debian-policy/policy.html/ch-maintainerscripts.html
> is my Bible when I'm writing/editing maintainer scripts.  It's
> documented nowhere that I need to handle the argument '<unknown>'.

	I think you actually need to go read that document.


6.6 Details of configuration

When we configure a package (this happens with dpkg --install and dpkg
--configure), we first update any conffiles and then call:

     postinst configure most-recently-configured-version

No attempt is made to unwind after errors during configuration.

If there is no most recently configured version dpkg will pass a null
argument; older versions of dpkg may pass <unknown> (including the
angle brackets) in this case. Even older ones do not pass a second
argument at all, under any circumstances. 

	See the bit about older versions of dpkg?

> Where did you come by this, and if it's something we should worry
> about,

	This is an excerpt from one of my postinst files, so it is
 loosely derived from the scripts written by Charles Briscoe-Smith,
 March-June 1998. 

>            why isn't it documented in Policy?

	It is. Why don't you try reading it more carefully?

> To me it looks like whoever wrote this code extrapolated too
> generously from the output of "dpkg -l" on the name of a package
> that has been purged.  But I haven't gone grubbing around in dpkg's
> source code, so I don't know for sure...

	No, whoever wrote this code (yours truly) actually read
 policy, and is trying to hand craft packages that follow it.

A robin redbreast in a cage Puts all Heaven in a rage. Blake
Manoj Srivastava   <srivasta@debian.org>  <http://www.debian.org/%7Esrivasta/>
1024R/C7261095 print CB D9 F4 12 68 07 E4 05  CC 2D 27 12 1D F5 E8 6E
1024D/BF24424C print 4966 F272 D093 B493 410B  924B 21BA DABB BF24 424C

Reply to: