1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-21 05:00:16 +00:00

Use an SF version extractor with better chances to yield correct result by default

svn path=/nixpkgs/trunk/; revision=22390
This commit is contained in:
Michael Raskin 2010-06-23 04:58:07 +00:00
parent 6308953547
commit 44216c2ef8
2 changed files with 3 additions and 2 deletions

View file

@ -4,6 +4,7 @@
#http://downloads.sourceforge.net/webdruid/files/webdruid/0.6.0-alpha5/webdruid-0.6.0-alpha5.tar.gz
skipRedirectSF='s@sourceforge.net/projects@downloads.sourceforge.net/project@; s@/files@@; s@/download$@@;'
extractReleaseSF='s@.*/([^/]+)/[^/]+@\1@'
extractVersionSF='s@.*/[^/0-9]*([0-9].*)[.](tar|tgz|tbz2|zip).*@\1@'
apacheMirror='s@http://www.apache.org/dist/@mirror://apache/@'
skipRedirectApache='s@/dyn/closer.cgi[?]path=@/dist@'

View file

@ -56,8 +56,8 @@ prefetchClause=""
echo "Sourceforge-corrected URL: $freshUrl" >&2
version="$(echo "$freshUrl" |
sed -re "$extractReleaseSF")"
baseName="$(getAttr baseName "$(echo "$freshUrl" | sed -re 's@.*/projects/([^/]+)/.*@\1@')")"
sed -re "$extractVersionSF")"
baseName="$(getAttr baseName "$(echo "$freshUrl" | sed -re 's@.*/project/([^/]+)/.*@\1@')")"
url="$freshUrl"
name="$baseName-$version"
advertisedUrl="$freshUrl"