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

Bug#563121: dh_installdefoma leads to buggy maintainer scripts



On Thu, 31 Dec 2009 09:03:59 +0100, Cyril Brulebois <kibi@debian.org> wrote:
> Keith Packard <keithp@keithp.com> (30/12/2009):
> > > I'm about to QA-upload defoma with this change in the various
> > > debhelper-files/* files, but I wanted to open this bugreport for
> > > reference.
> 
> Fortunately, I didn't do so, that wouldn't have helped (yay for
> sleeping before uploading :)).
> 
> > Here's a patch which I've used to build new fontconfig packages
> > which should survive the absence of defoma.
> 
> I don't think it would help.
> 
> > -  test -x `which defoma-app` && defoma-app update #PACKAGE#
> > +  which defoma-app >/dev/null && defoma-app update #PACKAGE#
> 
> $ which doesnotexist >/dev/null && echo be happy
> $ echo $?
> 1
> 
> So the maintainer script bits generated by dh_installdefoma would
> still lead to non-0 exits.

Check out the 'bash' manual -- set -e explicitly excludes precisely this
case from causing early termination of the script:

      The shell does not exit if the command that fails is part of the command  list  immedi‐
      ately  following  a  while  or until keyword, part of the test following the if or elif
      reserved words, part of any command executed in a && or ⎪⎪ list except the command fol‐
      lowing  the final && or ⎪⎪, any command in a pipeline but the last, or if the command's
      return value is being inverted with !.

> Current/common practice within debhelper seems to be:
> | if [ -x "`which foo 2>/dev/null`" ]; then…

That also seems fine, if a bit longer.

> I think I'm going to upload with such a change once I'm up (for real,
> not vaguely opening eyes).

cool! I'd prefer to build fontconfig with your desired change; the set
+e change will hold until then. I'll change the one other case to match
whatever you choose to use.

-- 
keith.packard@intel.com

Attachment: pgpXVRFAPK8D2.pgp
Description: PGP signature


Reply to: