Merge branch 'll-fix-fetchzip-darwin' of https://github.com/obsidiansystems/nixpkgs

This commit is contained in:
Shea Levy 2017-07-18 09:06:11 -04:00
commit 1ea9a69376

View File

@ -23,7 +23,6 @@ lib.overrideDerivation (fetchurl ({
postFetch = postFetch =
'' ''
export PATH=${unzip}/bin:$PATH export PATH=${unzip}/bin:$PATH
mkdir $out
unpackDir="$TMPDIR/unpack" unpackDir="$TMPDIR/unpack"
mkdir "$unpackDir" mkdir "$unpackDir"
@ -32,8 +31,6 @@ lib.overrideDerivation (fetchurl ({
renamed="$TMPDIR/${baseNameOf url}" renamed="$TMPDIR/${baseNameOf url}"
mv "$downloadedFile" "$renamed" mv "$downloadedFile" "$renamed"
unpackFile "$renamed" unpackFile "$renamed"
shopt -s dotglob
'' ''
+ (if stripRoot then '' + (if stripRoot then ''
if [ $(ls "$unpackDir" | wc -l) != 1 ]; then if [ $(ls "$unpackDir" | wc -l) != 1 ]; then
@ -43,12 +40,11 @@ lib.overrideDerivation (fetchurl ({
fi fi
fn=$(cd "$unpackDir" && echo *) fn=$(cd "$unpackDir" && echo *)
if [ -f "$unpackDir/$fn" ]; then if [ -f "$unpackDir/$fn" ]; then
mv "$unpackDir/$fn" "$out" mkdir $out
else
mv "$unpackDir/$fn"/* "$out/"
fi fi
mv "$unpackDir/$fn" "$out"
'' else '' '' else ''
mv "$unpackDir"/* "$out/" mv "$unpackDir" "$out"
'') #*/ '') #*/
+ extraPostFetch; + extraPostFetch;
} // removeAttrs args [ "stripRoot" "extraPostFetch" ])) } // removeAttrs args [ "stripRoot" "extraPostFetch" ]))