3
0
Fork 0
forked from mirrors/nixpkgs

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

View file

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