From: Vincent Pit Date: Thu, 14 Jun 2012 22:40:23 +0000 (+0200) Subject: Use MODULE_{AUTHOR,VERSION} when SRC_URI is not specified in the ebuild X-Git-Tag: v0.12~4 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=5b30d3775087ec80c860185b6fe18998629beacf;p=perl%2Fmodules%2FCPANPLUS-Dist-Gentoo.git Use MODULE_{AUTHOR,VERSION} when SRC_URI is not specified in the ebuild This catches the version mismatch of Lab-Measurement. --- diff --git a/lib/CPANPLUS/Dist/Gentoo/Maps.pm b/lib/CPANPLUS/Dist/Gentoo/Maps.pm index fd1cd8a..fb2cbd6 100644 --- a/lib/CPANPLUS/Dist/Gentoo/Maps.pm +++ b/lib/CPANPLUS/Dist/Gentoo/Maps.pm @@ -249,6 +249,7 @@ $version_mismatch{$_} = $simple_cleanup for qw< I18N-LangTags IO IPC-System-Simple + Lab-Measurement Log-TraceMessages MusicBrainz-DiscID Net-IRC diff --git a/samples/gengentooisms b/samples/gengentooisms index aad8df1..980ecbf 100755 --- a/samples/gengentooisms +++ b/samples/gengentooisms @@ -112,10 +112,25 @@ sub parse_portage_tree { die "system(\"@cmd\") returned $ret and/or failed with status $code"; } - while ($err =~ /SRC_URI=((['"]).*?\2|\S+)/gs) { - $uri = $1; - $uri =~ s{^(['"])(.*?)\1$}{$2}s; + my %map; + while ($err =~ /([a-zA-Z0-9_]+)=((['"]).*?\3|\S+)/gs) { + my $key = $1; + my $val = $2; + $val =~ s{^(['"])(.*?)\1$}{$2}s; + $map{$key} = $val; } + + $uri = $map{SRC_URI}; + unless (defined $uri) { + my $author = $map{MODULE_AUTHOR}; + if (defined $author) { + my ($au, $a) = $author =~ /^((.).)/; + my $dist_version = $map{MODULE_VERSION}; + $dist_version = $last->[1] unless defined $dist_version; + $uri = "mirror://cpan/$a/$au/$author/$pkg_name/$dist_version.tar.gz"; + } + } + $fetched_uri{$ebuild} = $uri; Storable::store([ $timestamp,