From ecd43e2bfe9bf845206da01c38c580bfae4660e2 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sat, 25 Apr 2009 18:34:11 +0000 Subject: * Updated the script that copies tarballs used in Nixpkgs to nixos.org/tarballs. It no longer greps the source for fetchurl calls, because a lot of URLs are now computed (e.g. "http://foo/${name}.tar.bz2"). So instead we evaluate the Nix expression with "nix-instantiate --xml --strict" and look for URLs in the result. Because I'm lazy the script no longer checks whether the hash of the download matches the hash in the expression. svn path=/nixpkgs/trunk/; revision=15310 --- maintainers/scripts/copy-tarballs.sh | 57 +++++++++++++++++++++++++ maintainers/scripts/evacuate-urls.sh | 83 ------------------------------------ 2 files changed, 57 insertions(+), 83 deletions(-) create mode 100755 maintainers/scripts/copy-tarballs.sh delete mode 100755 maintainers/scripts/evacuate-urls.sh (limited to 'maintainers') diff --git a/maintainers/scripts/copy-tarballs.sh b/maintainers/scripts/copy-tarballs.sh new file mode 100755 index 00000000000..76ced8a01d9 --- /dev/null +++ b/maintainers/scripts/copy-tarballs.sh @@ -0,0 +1,57 @@ +#! /bin/sh -e + +distDir=/data/webserver/tarballs + +urls=$(nix-instantiate --eval-only --xml --strict pkgs/top-level/build-for-release.nix \ + | grep -A2 'name="urls"' \ + | grep ' $newPath" - - if test -n "$doCopy"; then - if ! curl --disable-epsv --fail --location --max-redirs 20 --remote-time \ - "$url" --output "$newPath".tmp; then - continue - fi - mv -f "$newPath".tmp "$newPath" - fi - - fi - - if test -n "$doCopy" -a -e "$newPath"; then - - md5=$(nix-hash --flat --type md5 "$newPath") - ln -sfn "../$base" $distDir/md5/$md5 - - sha1=$(nix-hash --flat --type sha1 "$newPath") - ln -sfn "../$base" $distDir/sha1/$sha1 - - sha256=$(nix-hash --flat --type sha256 "$newPath") - ln -sfn "../$base" $distDir/sha256/$sha256 - ln -sfn "../$base" $distDir/sha256/$(nix-hash --type sha256 --to-base32 "$sha256") - - fi - - fi - - fi - - done - -done - -echo DONE -- cgit 1.4.1