[Midnightbsd-cvs] mports: Port.pm: add can_reset method.

ctriv at midnightbsd.org ctriv at midnightbsd.org
Tue Mar 25 01:13:26 EDT 2008


Log Message:
-----------
add can_reset method.

Modified Files:
--------------
    mports/Tools/lib/Magus:
        Port.pm (r1.17 -> r1.18)

-------------- next part --------------
Index: Port.pm
===================================================================
RCS file: /home/cvs/mports/Tools/lib/Magus/Port.pm,v
retrieving revision 1.17
retrieving revision 1.18
diff -L Tools/lib/Magus/Port.pm -L Tools/lib/Magus/Port.pm -u -r1.17 -r1.18
--- Tools/lib/Magus/Port.pm
+++ Tools/lib/Magus/Port.pm
@@ -218,6 +218,19 @@
   $self->update;
 }
 
+=head2 $port->can_reset
+
+Returns true is reseting this port makes sense (the port is tested
+and its run is active).  Returns false otherwise.
+
+=cut
+
+sub can_reset {
+  return if $_[0]->status eq 'untested'
+         || $_[0]->run->status ne 'active';
+  return 1;
+}
+
 =head2 $port->log
 
 Returns the log data for this port, if any.  Returns undef if there is no log.


More information about the Midnightbsd-cvs mailing list