diff options
author | Michael Raskin <7c6f434c@mail.ru> | 2010-06-23 04:39:21 +0000 |
---|---|---|
committer | Michael Raskin <7c6f434c@mail.ru> | 2010-06-23 04:39:21 +0000 |
commit | 0fcb69e1da8ae599aff3878732d259ee62fa9032 (patch) | |
tree | 507b5b9864a4ba82b142a69e5ec9ba1dbf92c5d8 /pkgs/build-support/upstream-updater | |
parent | 78f5f3359ba79445fff52e25bacb38c8b9eaa780 (diff) | |
download | nixpkgs-0fcb69e1da8ae599aff3878732d259ee62fa9032.tar nixpkgs-0fcb69e1da8ae599aff3878732d259ee62fa9032.tar.gz nixpkgs-0fcb69e1da8ae599aff3878732d259ee62fa9032.tar.bz2 nixpkgs-0fcb69e1da8ae599aff3878732d259ee62fa9032.tar.lz nixpkgs-0fcb69e1da8ae599aff3878732d259ee62fa9032.tar.xz nixpkgs-0fcb69e1da8ae599aff3878732d259ee62fa9032.tar.zst nixpkgs-0fcb69e1da8ae599aff3878732d259ee62fa9032.zip |
Add a Sourceforge-friendly fetch method to upstream-updater
svn path=/nixpkgs/trunk/; revision=22388
Diffstat (limited to 'pkgs/build-support/upstream-updater')
-rwxr-xr-x | pkgs/build-support/upstream-updater/update-upstream-data.sh | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/pkgs/build-support/upstream-updater/update-upstream-data.sh b/pkgs/build-support/upstream-updater/update-upstream-data.sh index 006da112fdb..936e90f13c1 100755 --- a/pkgs/build-support/upstream-updater/update-upstream-data.sh +++ b/pkgs/build-support/upstream-updater/update-upstream-data.sh @@ -36,10 +36,44 @@ baseName="$(getAttr baseName 'unnamed-package')" commonPrefetchVars=" version name hash" prefetchClause="" +[ fetchSF = "$method" ] && { + if [ -z "$forcedUrl" ]; then + freshUrl="$("$own_dir"/urls-from-page.sh "$(getAttr downloadPage)" | + eval "egrep \"$(getAttr sourceRegexp '.*[.]tar[.].*|.*[.]tgz$|.*[.]tbz2$')\"" | + eval "egrep -v \"$(getAttr blacklistRegexp '^$')\"" | + eval "$(getAttr choiceCommand 'head -1')")" + + if ! egrep ':' <<< "$freshUrl" ; then + freshUrl="$(dirname "$(getAttr downloadPage).")/$freshUrl" + fi + + echo "Found download link: $freshUrl" >&2 + else + freshUrl="$forcedUrl" + fi + + freshUrl="$(echo "$freshUrl" | sed -re "$skipRedirectSF")" + echo "Sourceforge-corrected URL: $freshUrl" >&2 + + version="$(echo "$freshUrl" | + sed -re "$extractReleaseSF")" + baseName="$(getAttr baseName "$(echo "freshUrl" | sed -re 's@.*/projects/([^/]+)/.*@\1@')")" + url="$freshUrl" + name="$baseName-$version" + advertisedUrl="$freshUrl" + + if [ x"$freshUrl" = x"$(cat "$src_defs_dir"/advertisedUrl)" ]; then + echo "Source link not changed" >&2 + exit + fi + hash=$(nix-prefetch-url "$freshUrl") + + prefetchVars="url advertisedUrl"; +} [ fetchurl = "$method" ] && { if [ -z "$forcedUrl" ] ; then freshUrl="$("$own_dir"/urls-from-page.sh "$(getAttr downloadPage)" | - eval "egrep \"$(getAttr sourceRegexp '.*[.]tar[.].*')\"" | + eval "egrep \"$(getAttr sourceRegexp '.*[.]tar[.].*|.*[.]tgz$|.*[.]tbz2$')\"" | eval "egrep -v \"$(getAttr blacklistRegexp '^$')\"" | eval "$(getAttr choiceCommand 'head -1')")" |