diff options
author | Justin Davis <jrcd83@gmail.com> | 2011-11-10 19:11:28 +0100 |
---|---|---|
committer | Justin Davis <jrcd83@gmail.com> | 2011-11-10 19:11:28 +0100 |
commit | 6dc5a35a26dec706d5f8a6793976969c9b9be1dc (patch) | |
tree | cc1b7112fc39b4b7af6d301206377ae36c147b00 /lib/metas/perl.d | |
parent | ce9d1f4c3b1c551e4d620c6b53274a747956c235 (diff) | |
download | genpkg-6dc5a35a26dec706d5f8a6793976969c9b9be1dc.tar.gz genpkg-6dc5a35a26dec706d5f8a6793976969c9b9be1dc.tar.xz |
Rename cpandists to fetchcpan. Don't fetch core perl dists.
Diffstat (limited to 'lib/metas/perl.d')
-rwxr-xr-x | lib/metas/perl.d/fetchcpan (renamed from lib/metas/perl.d/cpandists) | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/lib/metas/perl.d/cpandists b/lib/metas/perl.d/fetchcpan index 040db77..076599b 100755 --- a/lib/metas/perl.d/cpandists +++ b/lib/metas/perl.d/fetchcpan @@ -7,27 +7,21 @@ curl --silent "$mirror$path" | gzip -dc | awk ' NR < 10 { next } { file = a[split($3, a, "/")] - len = split(file, a, ".") - if (!match(a[1], /[-_][vV]?[0-9]+$/)) { + if (!match(file, /[-_][vV]?[0-9]+/)) { #print "error: failed to grok " $3 | "cat 1>&2" next } - ver = substr(file, RSTART+1, RLENGTH-1) + ver = substr(file, RSTART+1) dist = substr(file, 1, RSTART-1) - for (i=2; i<=len; i++) { - if (a[i] !~ /^[0-9]/) break - ver = ver "." a[i] - } + + sub(/[.]tar[.].*$|[.]zip$/, "", ver) sub(/^[vV]/, "", ver) + sub(/[.]pm$/, "", dist) - # For some reason the newest version of perl had no modules in 02packages - # so I cant just use modules from the newest version of perl. - if(dist == "perl") - coremods = coremods $1 " " $2 "\n" - else - mods[dist,ver] = mods[dist,ver] $1 " " $2 "\n" + if(dist == "perl") next + mods[dist,ver] = mods[dist,ver] $1 " " $2 "\n" if (lessthan(dists[dist], ver)) { dists[dist] = ver paths[dist] = $3 @@ -43,7 +37,7 @@ END { # Prints modules out in sorted order, too! while(getline<"cpandists" > 0) { - print $1 "\n" ($1 == "perl" ? coremods : mods[$1,$2]) >"cpanmods" + print $1 "\n" mods[$1,$2] >"cpanmods" } } |