Update of /cvsroot/fink/fink/perlmod/Fink/SelfUpdate
In directory 
sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv5460/perlmod/Fink/SelfUpdate

Modified Files:
      Tag: selfupdate_classes
        Base.pm point.pm 
Log Message:
Auto-detect SU:: subclasses and let them declare their own descriptions
SU is now fully method-agnostic and plugin-ready


Index: Base.pm
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/SelfUpdate/Attic/Base.pm,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -d -r1.1.2.3 -r1.1.2.4
--- Base.pm     8 Mar 2007 08:02:08 -0000       1.1.2.3
+++ Base.pm     9 Mar 2007 07:54:10 -0000       1.1.2.4
@@ -39,6 +39,38 @@
 
 =over 4
 
+=item method_name
+
+       my $method = Fink::SelfUpdate::$method->method_name();
+       $config->set_param("SelfUpdateMethod", $method);
+
+Returns a string for the name of this selfupdate method, suitable for
+use in F<fink.conf>. This value will be handled case-insensitively
+within fink (converted to all lower-case). Defaults to the subclass
+name, converted to lower-case.
+
+=cut
+
+sub method_name {
+       my $class = shift;
+
+       $class = ref($class) if ref($class);  # find class if called as object
+       $class =~ s/.*:://;  # just the subclass
+
+       return lc($class);
+}
+
+=item desc_short
+
+       my $label = Fink::SelfUpdate::$method->desc_short();
+
+Returns a brief label for this method, something shorter than a
+package Description field. Defaults to the method_name.
+
+=cut
+
+sub desc_short { $_[0]->method_name() }
+
 =item system_check
 
        my $boolean = Fink::SelfUpdate::$method->system_check();

Index: point.pm
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/SelfUpdate/Attic/point.pm,v
retrieving revision 1.1.2.6
retrieving revision 1.1.2.7
diff -u -d -r1.1.2.6 -r1.1.2.7
--- point.pm    8 Mar 2007 08:02:09 -0000       1.1.2.6
+++ point.pm    9 Mar 2007 07:54:10 -0000       1.1.2.7
@@ -48,6 +48,12 @@
 
 =cut
 
+sub desc_short {
+       my $class = shift;  # class method for now
+
+       return 'Stick to point releases';
+}
+
 sub system_check {
        my $class = shift;  # class method for now
 


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Fink-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fink-commits

Reply via email to