From 6552ea2ddbeb5e8241555f9bc8d52fedc82384a4 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 9 Mar 2012 17:53:04 +0000 Subject: svn path=/nixpkgs/trunk/; revision=32961 --- maintainers/scripts/copy-tarball.sh | 21 +++++++++++++++------ maintainers/scripts/copy-tarballs.sh | 1 + 2 files changed, 16 insertions(+), 6 deletions(-) (limited to 'maintainers') diff --git a/maintainers/scripts/copy-tarball.sh b/maintainers/scripts/copy-tarball.sh index 9070977d7ce10..b4c2e93dab177 100755 --- a/maintainers/scripts/copy-tarball.sh +++ b/maintainers/scripts/copy-tarball.sh @@ -3,6 +3,7 @@ distDir=/data/webserver/tarballs url="$1" +file="$2" if [ -z "$url" ]; then echo "syntax: $0 URL"; exit 0; fi base="$(basename "$url")" @@ -11,15 +12,23 @@ dstPath="$distDir/$base" if [ -e "$dstPath" ]; then echo "$dstPath already exists"; exit 0; fi -echo "downloading $url to $newPath" +if [ -z "$file" ]; then -if [ -n "$dryRun" ]; then exit 0; fi + echo "downloading $url to $dstPath" -declare -a res -if ! res=($(PRINT_PATH=1 nix-prefetch-url "$url")); then - continue + if [ -n "$dryRun" ]; then exit 0; fi + + declare -a res + if ! res=($(PRINT_PATH=1 nix-prefetch-url "$url")); then + continue + fi + + storePath=${res[1]} + +else + storePath="$file" fi -storePath=${res[1]} + cp $storePath "$dstPath.tmp.$$" mv -f "$dstPath.tmp.$$" "$dstPath" diff --git a/maintainers/scripts/copy-tarballs.sh b/maintainers/scripts/copy-tarballs.sh index c1ed903919107..80aeef9d66de1 100755 --- a/maintainers/scripts/copy-tarballs.sh +++ b/maintainers/scripts/copy-tarballs.sh @@ -8,6 +8,7 @@ urls=$(nix-instantiate --eval-only --xml --strict '