Anyone wanna guess what happens in the following case if compiling of
the cool-thing executable failed in CompileScript?

  InstallScript: <<
  #!/bin/sh -ev
    mkdir -p %i/bin
    (cd src; cp cool-thing %i/bin)
    echo "installed successfully"
  <<

Right, it gets "installed successfully" and the user gets a deficient
.deb. The cmd in the paren'ed subshell fails, but that failure code
doesn't propagate as a failure of the whole subshell. The top-level
interpretter's -e abort mode isn't triggered. It's a "feature" of
using subshells in any Patch/Compile/InstallScript with an explicit #!
interpretter, or any Pre/PostInst/RmScript.

A quick solution is to check the return code of the subshell manually
and explicitly crash if necessary:

  InstallScript: <<
  #!/bin/sh -ev
    mkdir -p %i/bin
    (cd src; cp cool-thing %i/bin) || exit 1
    echo "installed successfully"
  <<

Would love to hear other solutions and/or relatively fool-proof ways
for validator to check for this maintainer goof.

Found this on 10.3/unstable netcdf and ptex, but a quick grep finds
other places as well.

dan

-- 
Daniel Macks
[EMAIL PROTECTED]
http://www.netspace.org/~dmacks


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Fink-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fink-devel

Reply via email to