[Midnightbsd-cvs] mports: PortTest.pm: Skip ports that have IGNORE set.
ctriv at midnightbsd.org
ctriv at midnightbsd.org
Fri Nov 2 14:15:50 EDT 2007
Log Message:
-----------
Skip ports that have IGNORE set.
Don't report make exiting non-zero if we have a more specific error to
report.
Modified Files:
--------------
mports/Tools/lib/Magus:
PortTest.pm (r1.5 -> r1.6)
-------------- next part --------------
Index: PortTest.pm
===================================================================
RCS file: /home/cvs/mports/Tools/lib/Magus/PortTest.pm,v
retrieving revision 1.5
retrieving revision 1.6
diff -LTools/lib/Magus/PortTest.pm -LTools/lib/Magus/PortTest.pm -u -r1.5 -r1.6
--- Tools/lib/Magus/PortTest.pm
+++ Tools/lib/Magus/PortTest.pm
@@ -35,6 +35,8 @@
use File::Path qw(mkpath);
use Mport::Globals qw($MAKE);
+use Mport::Utils qw(make_var);
+
use Magus::OutcomeRules ();
=head1 NAME
@@ -109,9 +111,12 @@
$self->_set_env;
$self->{chroot}->mark_dirty;
-
+
my %results = (summary => 'pass');
+ $self->check_for_skip(\%results) && return \%results;
+
+
foreach my $target (qw(fetch extract patch configure build fake package install deinstall reinstall)) {
if (!$self->_run_make($target)) {
push(@{$results{errors}}, {
@@ -141,7 +146,9 @@
}
if ($presults->{errors}) {
- push(@{$results{errors}}, @{$presults->{errors}});
+ # these will be the first errors we see. If we parsed them, we just
+ # report the results of parsing.
+ $results{errors} = $presults->{errors};
}
if ($presults->{warnings}) {
@@ -161,6 +168,29 @@
}
+sub check_for_skip {
+ my ($self, $results) = @_;
+
+ chdir($self->{port}->origin) || die "Couldn't chdir to " . $self->{port}->origin . ": $!\n";
+
+ my $ignore = make_var('IGNORE');
+
+ if ($ignore) {
+ $results->{skips} = {
+ phase => 'prerun',
+ msg => "$self->{port} $ignore",
+ name => 'PortIgnored',
+ };
+
+ $results->{'summary'} = 'skip';
+
+ return 1;
+ }
+
+ return;
+}
+
+
sub _run_make {
my ($self, $target) = @_;
@@ -169,6 +199,8 @@
}
+
+
sub _set_env {
my ($self) = @_;
More information about the Midnightbsd-cvs
mailing list