]> git.vpit.fr Git - perl/modules/CPANPLUS-Dist-Gentoo.git/blobdiff - lib/CPANPLUS/Dist/Gentoo.pm
Also print the output of the manifest command when it fails
[perl/modules/CPANPLUS-Dist-Gentoo.git] / lib / CPANPLUS / Dist / Gentoo.pm
index 870d6d816fca3bd321f356070bbcf2fe23beafde..ad0976dfe636530c5a7626686a7c071a7084fa6a 100644 (file)
@@ -149,6 +149,7 @@ sub prepare {
  my $prereqs = $mod->status->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 +176,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 +238,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 +265,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 +284,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;
  }