]> git.vpit.fr Git - perl/modules/CPANPLUS-Dist-Gentoo.git/commitdiff
Use MODULE_{AUTHOR,VERSION} when SRC_URI is not specified in the ebuild
authorVincent Pit <vince@profvince.com>
Thu, 14 Jun 2012 22:40:23 +0000 (00:40 +0200)
committerVincent Pit <vince@profvince.com>
Thu, 14 Jun 2012 22:40:41 +0000 (00:40 +0200)
This catches the version mismatch of Lab-Measurement.

lib/CPANPLUS/Dist/Gentoo/Maps.pm
samples/gengentooisms

index fd1cd8a1e6f0b3d4e7abe39d1fb56289872149c9..fb2cbd699137a7feab6c01f9f37d10855223d7bc 100644 (file)
@@ -249,6 +249,7 @@ $version_mismatch{$_} = $simple_cleanup for qw<
  I18N-LangTags
  IO
  IPC-System-Simple
+ Lab-Measurement
  Log-TraceMessages
  MusicBrainz-DiscID
  Net-IRC
index aad8df14cbda3811d58f071e0cc752fe27424b33..980ecbf7dcaf56b8b4418080ad5deb7a6e347853 100755 (executable)
@@ -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,