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

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


Index: SelfUpdate.pm
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/SelfUpdate.pm,v
retrieving revision 1.117.2.6
retrieving revision 1.117.2.7
diff -u -d -r1.117.2.6 -r1.117.2.7
--- SelfUpdate.pm       8 Mar 2007 07:28:54 -0000       1.117.2.6
+++ SelfUpdate.pm       8 Mar 2007 08:02:04 -0000       1.117.2.7
@@ -178,27 +178,16 @@
                }
        }
 
-       # We temporarily disable rsync updating for 10.5, until we've decided 
how to handle it
-       if ($method eq 'rsync' and $distribution eq '10.5') {
-               die "Sorry, fink doesn't support rsync updating in the 10.5 
distribution at present.\n";
-       }
-
        my ($subclass_use)  = grep { $method eq lc($_) } @known_method_classes;
-       die "SelfUpdateMethod '$method' is not implemented\n" unless( defined 
$subclass_use && length $subclass_use );
+       die "Selfupdate method '$method' is not implemented\n" unless( defined 
$subclass_use && length $subclass_use );
 
        $subclass_use = "Fink::SelfUpdate::$subclass_use";
-       eval { require $subclass_use };
-       die "SelfUpdateMethod '$method' could not be loaded: [EMAIL PROTECTED]" 
if $@;
 
-       &need_devtools($method);        # TODO: query the subclass to have it
-                                                               # determine if 
its needed support
-                                                               # programs 
(including devtools for
-                                                               # 
build-from-source methods) are
-                                                               # available
+       $subclass_use->system_check() or die "Selfupdate mthod '$method' cannot 
be used\n";
 
        if ($method ne $prev_method) {
                # save new selection (explicit change or being set for first 
time)
-               &print_breaking("fink is setting your default update method to 
$method \n");
+               &print_breaking("fink is setting your default update method to 
$method\n");
                $config->set_param("SelfUpdateMethod", $method);
                $config->save();
        }
@@ -226,26 +215,6 @@
        &do_finish();
 }
 
-=item need_devtools
-
-  Fink::SelfUpdate::need_devtools($method);
-
-If selfupdating using the given $method (passed by name) requires
-components of Apple dev-tools (xcode) instead of just standard
-components of OS X, check that the "dev-tools" virtual package is
-installed. If it is required for the $method but is not present, die.
-
-=cut
-
-sub need_devtools {
-       my $method = shift;
-
-       if ($method eq 'cvs' || $method eq 'rsync') {
-               Fink::VirtPackage->query_package("dev-tools")
-                       or die "selfupdate method '$method' requires the 
package 'dev-tools'\n";
-       }
-}
-
 ### set up direct cvs
 
 sub setup_direct_cvs {
@@ -254,6 +223,7 @@
        my ($use_hardlinks, $cutoff, $cmd);
        my ($cmdd);
 
+       Fink::SelfUpdate::CVS->system_check() || die;
 
        $username = "root";
        if (exists $ENV{SUDO_USER}) {
@@ -440,6 +410,8 @@
 sub do_direct_cvs {
        my ($descdir, @sb, $cmd, $cmd_recursive, $username, $msg);
 
+       Fink::SelfUpdate::CVS->system_check() || die;
+
        # add cvs quiet flag if verbosity level permits
        my $verbosity = "-q";
        if ($config->verbosity_level() > 1) {

Index: ChangeLog
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/ChangeLog,v
retrieving revision 1.1439.2.7
retrieving revision 1.1439.2.8
diff -u -d -r1.1439.2.7 -r1.1439.2.8
--- ChangeLog   8 Mar 2007 07:28:53 -0000       1.1439.2.7
+++ ChangeLog   8 Mar 2007 08:02:04 -0000       1.1439.2.8
@@ -1,5 +1,11 @@
 2007-03-08  Daniel Macks  <[EMAIL PROTECTED]>
 
+       * SelfUpdate/Base.pm: add system_check to public API
+       * SelfUpdate.pm, SelfUpdate/*: let each method handle its own
+       system sanity-checking; nuke &SU::need_devtools
+
+2007-03-08  Daniel Macks  <[EMAIL PROTECTED]>
+
        * SelfUpdate.pm: completely redo check(), removing most
        special-case method tests
        * SelfUpdate.pm, SelfUpdate/*: remove all cross-method interactions


-------------------------------------------------------------------------
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
Fink-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fink-commits

Reply via email to