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

Modified Files:
      Tag: selfupdate_classes
        Base.pm CVS.pm point.pm rsync.pm 
Log Message:
Replace &SU::need_devtools and other hard-coded tests in SU with
method-specific ones in each subclass


Index: Base.pm
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/SelfUpdate/Attic/Base.pm,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -d -r1.1.2.2 -r1.1.2.3
--- Base.pm     7 Mar 2007 09:41:17 -0000       1.1.2.2
+++ Base.pm     8 Mar 2007 08:02:08 -0000       1.1.2.3
@@ -39,6 +39,17 @@
 
 =over 4
 
+=item system_check
+
+       my $boolean = Fink::SelfUpdate::$method->system_check();
+
+Determine whether this method can be used on this machine. Make sure
+needed external executables are present, etc. Must be over-ridden.
+
+=cut
+
+sub system_check { warn "Not implemented\n"; return 0; }
+
 =item clear_metadata
 
   Fink::SelfUpdate::$method->clear_metadata();
@@ -77,11 +88,12 @@
 
        Fink::SelfUpdate::$method->do_direct();
 
-This implements the actual selfupdate sync process.
+This implements the actual selfupdate sync process. Must be
+over-ridden (obviously).
 
 =cut
 
-sub do_direct { die "Not implemented\n" };
+sub do_direct { die "Not implemented\n" }
 
 =back
 

Index: point.pm
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/SelfUpdate/Attic/point.pm,v
retrieving revision 1.1.2.5
retrieving revision 1.1.2.6
diff -u -d -r1.1.2.5 -r1.1.2.6
--- point.pm    8 Mar 2007 07:28:54 -0000       1.1.2.5
+++ point.pm    8 Mar 2007 08:02:09 -0000       1.1.2.6
@@ -48,6 +48,12 @@
 
 =cut
 
+sub system_check {
+       my $class = shift;  # class method for now
+
+       return 1;
+}
+
 sub do_direct {
        my $class = shift;  # class method for now
 

Index: rsync.pm
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/SelfUpdate/Attic/rsync.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
--- rsync.pm    8 Mar 2007 07:28:55 -0000       1.1.2.6
+++ rsync.pm    8 Mar 2007 08:02:09 -0000       1.1.2.7
@@ -46,6 +46,23 @@
 
 =cut
 
+sub system_check {
+       my $class = shift;  # class method for now
+
+       # We temporarily disable rsync updating for 10.5, until we've decided 
how to handle it
+       if ($distribution eq '10.5') {
+               warn "Sorry, fink doesn't support rsync updating in the 10.5 
distribution at present.\n";
+               return 0;
+       }
+
+       if (not Fink::VirtPackage->query_package("dev-tools")) {
+               warn "Selfupdate method 'rsync' requires the package 
'dev-tools'\n";
+               return 0;
+       }
+
+       return 1;
+}
+
 sub stamp_set {
        my $class = shift;  # class method for now
 

Index: CVS.pm
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/SelfUpdate/Attic/CVS.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
--- CVS.pm      6 Mar 2007 21:18:53 -0000       1.1.2.3
+++ CVS.pm      8 Mar 2007 08:02:09 -0000       1.1.2.4
@@ -45,6 +45,17 @@
 
 =cut
 
+sub system_check {
+       my $class = shift;  # class method for now
+
+       if (not Fink::VirtPackage->query_package("dev-tools")) {
+               warn "Selfupdate method 'cvs' requires the package 
'dev-tools'\n";
+               return 0;
+       }
+
+       return 1;
+}
+
 sub clear_metadata {
        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