[Midnightbsd-cvs] mports: Port.pm: Make sure that when looking for ready ports non of the
ctriv at midnightbsd.org
ctriv at midnightbsd.org
Thu Oct 25 13:48:45 EDT 2007
Log Message:
-----------
Make sure that when looking for ready ports non of the depends are locked. Just because the port is tested doesn't mean that the package is up on the master.
Modified Files:
--------------
mports/Tools/lib/Magus:
Port.pm (r1.3 -> r1.4)
-------------- next part --------------
Index: Port.pm
===================================================================
RCS file: /home/cvs/mports/Tools/lib/Magus/Port.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -LTools/lib/Magus/Port.pm -LTools/lib/Magus/Port.pm -u -r1.3 -r1.4
--- Tools/lib/Magus/Port.pm
+++ Tools/lib/Magus/Port.pm
@@ -52,26 +52,77 @@
(
(name NOT IN (SELECT port FROM depends))
OR
- (name NOT IN (SELECT port FROM depends WHERE dependency NOT IN (SELECT port FROM results WHERE arch=? AND (summary="pass" OR summary="warn"))))
+ (name NOT IN (
+ SELECT port FROM depends
+ WHERE
+ dependency NOT IN (SELECT port FROM results WHERE arch=? AND (summary="pass" OR summary="warn"))
+ AND
+ dependency NOT IN (SELECT port FROM locks WHERE arch=?)
+ )
+ )
)
END_OF_SQL
+=head2 Magus::Port->get_ready_port;
+
+Return a port that is ready to be tested for the current arch.
+Ready is defined as:
+
+=over 4
+
+=item 1
+
+The port is unlocked
+
+=item 2
+
+The port has not been tested.
+
+=item 3
+
+The port's depends are all tested and unlocked.
+
+=back
+
+=cut
+
sub get_ready_port {
my $arch = $Magus::Machine->arch;
- return shift->search_ready_ports(($Magus::Machine->arch) x 3)->next;
+ return shift->search_ready_ports(($Magus::Machine->arch) x 4)->next;
}
+=head2 $port->origin
+
+Return the absolute directory where this port lives, such as:
+
+ /usr/mports/foo/bar
+
+=cut
+
sub origin {
return join('/', $Mport::Globals::ROOT, $_[0]->name);
}
+
+=head2 $port->current_result
+
+Returns the result for the current version and arch, if any.
+
+=cut
+
sub current_result {
my ($self) = @_;
return $self->results(arch => $Magus::Machine->arch, version => $self->version)->next;
}
+=head2 $port->all_depends
+
+Returns a list of every port in this port's depends tree.
+
+=cut
+
sub all_depends {
my ($self) = @_;
More information about the Midnightbsd-cvs
mailing list