3 distDir
=/data
/webserver
/tarballs
5 urls
=$
(nix-instantiate
--eval-only --xml --strict .
/eval-release.nix \
6 |
grep -A2 'name="urls"' \
7 |
grep '<string value=' \
8 |
sed 's/.*"\(.*\)".*/\1/' \
13 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
15 base
="$(basename "$url")"
16 newPath
="$distDir/$base"
18 if ! test -e "$newPath"; then
20 #if echo $url | grep -q 'mirror://'; then
21 # echo "$fn: skipping mirrored $url"
25 echo "downloading $url to $newPath"
27 if test -n "$doCopy"; then
29 if ! res
=($
(PRINT_PATH
=1 nix-prefetch-url
"$url")); then
33 cp $storePath "$newPath.tmp.$$"
34 mv -f "$newPath.tmp.$$" "$newPath"
39 if test -n "$doCopy" -a -e "$newPath"; then
41 echo "hashing $newPath"
43 md5
=$
(nix-hash
--flat --type md5
"$newPath")
44 ln -sfn "../$base" $distDir/md
5/$md5
46 sha1
=$
(nix-hash
--flat --type sha1
"$newPath")
47 ln -sfn "../$base" $distDir/sha
1/$sha1
49 sha256
=$
(nix-hash
--flat --type sha256
"$newPath")
50 ln -sfn "../$base" $distDir/sha256
/$sha256
51 ln -sfn "../$base" $distDir/sha256
/$
(nix-hash
--type sha256
--to-base32 "$sha256")