findTarball: Handle pipefail

It was failing because the bash subshell died with SIGPIPE, which is
no longer ignored.

http://hydra.nixos.org/build/16766452
This commit is contained in:
Eelco Dolstra 2014-11-05 18:21:44 +01:00
parent 83758d2b26
commit c964077200
6 changed files with 16 additions and 11 deletions

View File

@ -108,7 +108,7 @@ stdenv.mkDerivation (
. ${./functions.sh} . ${./functions.sh}
origSrc=$src origSrc=$src
src=$(findTarballs $src | head -1) src=$(findTarball $src)
''; '';
} }
) )

View File

@ -38,7 +38,7 @@ stdenv.mkDerivation (
. ${./functions.sh} . ${./functions.sh}
origSrc=$src origSrc=$src
src=$(findTarballs $src | head -1) src=$(findTarball $src)
if test -e $origSrc/nix-support/hydra-release-name; then if test -e $origSrc/nix-support/hydra-release-name; then
releaseName=$(cat $origSrc/nix-support/hydra-release-name) releaseName=$(cat $origSrc/nix-support/hydra-release-name)

View File

@ -32,7 +32,7 @@ vmTools.runInLinuxImage (stdenv.mkDerivation (
postHook = '' postHook = ''
. ${./functions.sh} . ${./functions.sh}
propagateImageName propagateImageName
src=$(findTarballs $src | head -1) # Find a tarball. src=$(findTarball $src)
''; '';
installExtraDebsPhase = '' installExtraDebsPhase = ''

View File

@ -1,11 +1,16 @@
findTarballs() { findTarball() {
local suffix i local suffix i
test -d "$1/tarballs/" && { if [ -f "$1" ]; then
echo "$1"
return
fi
if [ -d "$1/tarballs/" ]; then
for suffix in tar.gz tgz tar.bz2 tbz2 tar.xz tar.lzma; do for suffix in tar.gz tgz tar.bz2 tbz2 tar.xz tar.lzma; do
for i in $1/tarballs/*.$suffix; do echo $i; done for i in $1/tarballs/*.$suffix; do echo $i; return; done
done | sort done | sort | head -1
} return
echo "$1" fi
return 1
} }
canonicalizeJarManifest() { canonicalizeJarManifest() {

View File

@ -89,7 +89,7 @@ stdenv.mkDerivation (
postHook = '' postHook = ''
. ${./functions.sh} . ${./functions.sh}
origSrc=$src origSrc=$src
src=$(findTarballs $src | head -1) src=$(findTarball $src)
''; '';
preHook = '' preHook = ''

View File

@ -16,7 +16,7 @@ vmTools.buildRPM (
preBuild = '' preBuild = ''
. ${./functions.sh} . ${./functions.sh}
propagateImageName propagateImageName
src=$(findTarballs $src | head -1) # Pick the first tarball. src=$(findTarball $src)
''; '';
postInstall = '' postInstall = ''