svn path=/nixpkgs/trunk/; revision=32961

This commit is contained in:
Eelco Dolstra 2012-03-09 17:53:04 +00:00
parent a736ed4e66
commit 6552ea2ddb
2 changed files with 16 additions and 6 deletions

View File

@ -3,6 +3,7 @@
distDir=/data/webserver/tarballs distDir=/data/webserver/tarballs
url="$1" url="$1"
file="$2"
if [ -z "$url" ]; then echo "syntax: $0 URL"; exit 0; fi if [ -z "$url" ]; then echo "syntax: $0 URL"; exit 0; fi
base="$(basename "$url")" base="$(basename "$url")"
@ -11,7 +12,9 @@ dstPath="$distDir/$base"
if [ -e "$dstPath" ]; then echo "$dstPath already exists"; exit 0; fi if [ -e "$dstPath" ]; then echo "$dstPath already exists"; exit 0; fi
echo "downloading $url to $newPath" if [ -z "$file" ]; then
echo "downloading $url to $dstPath"
if [ -n "$dryRun" ]; then exit 0; fi if [ -n "$dryRun" ]; then exit 0; fi
@ -19,7 +22,13 @@ declare -a res
if ! res=($(PRINT_PATH=1 nix-prefetch-url "$url")); then if ! res=($(PRINT_PATH=1 nix-prefetch-url "$url")); then
continue continue
fi fi
storePath=${res[1]} storePath=${res[1]}
else
storePath="$file"
fi
cp $storePath "$dstPath.tmp.$$" cp $storePath "$dstPath.tmp.$$"
mv -f "$dstPath.tmp.$$" "$dstPath" mv -f "$dstPath.tmp.$$" "$dstPath"

View File

@ -8,6 +8,7 @@ urls=$(nix-instantiate --eval-only --xml --strict '<nixpkgs/maintainers/scripts/
for url in $urls; do for url in $urls; do
if echo "$url" | grep -q -E "www.cs.uu.nl|nixos.org|.stratego-language.org|java.sun.com|ut2004|linuxq3a|RealPlayer|Adbe|belastingdienst|microsoft|armijn/.nix|sun.com|archive.eclipse.org"; then continue; fi if echo "$url" | grep -q -E "www.cs.uu.nl|nixos.org|.stratego-language.org|java.sun.com|ut2004|linuxq3a|RealPlayer|Adbe|belastingdienst|microsoft|armijn/.nix|sun.com|archive.eclipse.org"; then continue; fi
if ! echo "$url" | grep -q -E "\-.*[0-9].*"; then echo "skipping $url"; continue; fi
$(dirname $0)/copy-tarball.sh "$url" $(dirname $0)/copy-tarball.sh "$url"
done done