summaryrefslogtreecommitdiffstats
path: root/preps/perl.d/fetchcpan
diff options
context:
space:
mode:
authorJustin Davis <jrcd83@gmail.com>2013-08-18 12:45:16 +0200
committerJustin Davis <jrcd83@gmail.com>2013-08-18 12:45:16 +0200
commit2dc84873baf86f9b12f56f543ce344e0079d741c (patch)
treed60de6c479e77c1fc42bbae1a0437a8a68852831 /preps/perl.d/fetchcpan
parent6d8daba2b1f377b59a3ffa0a55b6429703eb9672 (diff)
downloadgenpkg-2dc84873baf86f9b12f56f543ce344e0079d741c.tar.gz
genpkg-2dc84873baf86f9b12f56f543ce344e0079d741c.tar.xz
Bugfix for fetchcpan. Changed the dist/version splitting algorithm.
We split on hyphens and underscores and choose the last element for the version string. The earlier algorithm was mistaking the 3D in GD-3DBarcode for a version string.
Diffstat (limited to 'preps/perl.d/fetchcpan')
-rwxr-xr-xpreps/perl.d/fetchcpan12
1 files changed, 4 insertions, 8 deletions
diff --git a/preps/perl.d/fetchcpan b/preps/perl.d/fetchcpan
index dff7873..b59c293 100755
--- a/preps/perl.d/fetchcpan
+++ b/preps/perl.d/fetchcpan
@@ -7,17 +7,13 @@ curl --silent "$mirror$path" | zcat 2>/dev/null | awk '
NR < 10 { next }
{
file = a[split($3, a, "/")]
-
- if (!match(file, /[-_][vV]?[0-9]+/)) {
- #print "error: failed to grok " $3 | "cat 1>&2"
- next
- }
- ver = substr(file, RSTART+1)
- dist = substr(file, 1, RSTART-1)
+ ver = a[split(file, a, "[-_]")]
+ dist = substr(file, 1, length(file) - length(ver) - 1)
+ if(!dist) next # ignore dists with no versions
sub(/[.]tar[.].*$|[.]zip$/, "", ver)
sub(/^[vV]/, "", ver)
- sub(/[.]pm$/, "", dist)
+ sub(/[.]pm$/, "", dist) # srsly?
if(dist == "perl") next