]> git.vpit.fr Git - perl/modules/CPANPLUS-Dist-Gentoo.git/blobdiff - lib/CPANPLUS/Dist/Gentoo.pm
Relink prerequisites with gentooisms
[perl/modules/CPANPLUS-Dist-Gentoo.git] / lib / CPANPLUS / Dist / Gentoo.pm
index 37fbcae8db767b6881c674a691272c3555cb8e92..962d60f7ff31b9d7ed8637429ba15ddd89aa0e9f 100644 (file)
@@ -147,8 +147,10 @@ sub prepare {
  $stat->license([ qw/Artistic GPL-2/ ]);
 
  my $prereqs = $mod->status->prereqs;
+ $prereqs = { map { ($gentooism{$_} || $_) => $prereqs->{$_} } keys %$prereqs };
  my @depends;
  for my $prereq (sort keys %$prereqs) {
+  next if $prereq =~ /^perl(?:-|\z)/;
   my $obj = $int->module_tree($prereq);
   unless ($obj) {
    error 'Wrong module object -- aborting';
@@ -175,6 +177,7 @@ sub prepare {
 sub create {
  my $self = shift;
  my $stat = $self->status;
+ my $conf = $self->parent->parent->configure_object;
 
  unless ($stat->prepared) {
   error 'Can\'t create ' . $stat->dist . ' since it was never prepared -- aborting';
@@ -236,8 +239,16 @@ sub create {
   }
 
   msg 'Adding Manifest entry for ' . $stat->dist;
-  unless (scalar run command => [ 'ebuild', $file, 'manifest' ], verbose => 0) {
-   error 'ebuild manifest failed -- aborting';
+  my ($success, $errmsg, $output) = run
+                                     command => [ 'ebuild', $file, 'manifest' ],
+                                     verbose => 0;
+  unless ($success) {
+   error "$errmsg -- aborting";
+   if (defined $output and $conf->get_conf('verbose')) {
+    my $msg = join '', @$output;
+    1 while chomp $msg;
+    error $msg;
+   }
    1 while unlink $file;
    return 0;
   }
@@ -255,8 +266,10 @@ sub install {
  my @cmd = ('emerge', '=' . $stat->eb_name . '-' . $stat->eb_version);
  unshift @cmd, $sudo if $sudo;
 
- unless (run command => \@cmd, verbose => 1) {
-  error 'emerge failed -- aborting';
+ my ($success, $errmsg) = run command => \@cmd,
+                              verbose => 1;
+ unless ($success) {
+  error "$errmsg -- aborting";
   return 0;
  }
 
@@ -272,8 +285,10 @@ sub uninstall {
  my @cmd = ('emerge', '-C', '=' . $stat->eb_name . '-' . $stat->eb_version);
  unshift @cmd, $sudo if $sudo;
 
- unless (run command => \@cmd, verbose => 1) {
-  error 'emerge -C failed -- aborting';
+ my ($success, $errmsg) = run command => \@cmd,
+                              verbose => 1;
+ unless ($success) {
+  error "$errmsg -- aborting";
   return 0;
  }
 
@@ -298,6 +313,8 @@ L<CPANPLUS::Dist::Base>, L<CPANPLUS::Dist::Deb>, L<CPANPLUS::Dist::Mdv>.
 
 Vincent Pit, C<< <perl at profvince.com> >>, L<http://www.profvince.com>.
 
+You can contact me by mail or on C<irc.perl.org> (vincent).
+
 =head1 BUGS
 
 Please report any bugs or feature requests to C<bug-cpanplus-dist-gentoo at rt.cpan.org>, or through the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=CPANPLUS-Dist-Gentoo>.  I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.