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

Modified Files:
      Tag: selfupdate_classes
        Base.pm CVS.pm point.pm rsync.pm 
Log Message:
Abolish all use of stamp-* files, since they duplicate data already in
the VERSION file. Scrap all package-info version handlers from
FinkVersion.pm.in, put useful functionality from them solely in
SelfUpdate.pm.


Index: Base.pm
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/SelfUpdate/Attic/Base.pm,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -u -d -r1.1.2.4 -r1.1.2.5
--- Base.pm     9 Mar 2007 07:54:10 -0000       1.1.2.4
+++ Base.pm     20 Mar 2007 07:13:44 -0000      1.1.2.5
@@ -93,35 +93,15 @@
 
 sub clear_metadata {}
 
-=item stamp_set
-
-  Fink::SelfUpdate::$method->stamp_set();
-
-=item stamp_clear
-
-  Fink::SelfUpdate::$method->stamp_clear();
-
-=item stamp_check
-
-  my $boolean = Fink::SelfUpdate::$method->stamp_check();
-
-Create, remove, or check presence of stamp file for this selfupdate
-class. I don't know what these are for.
-
-=cut
-
-sub stamp_set {}
-
-sub stamp_clear {}
-
-sub stamp_check { return 0; }
-
 =item do_direct
 
-       Fink::SelfUpdate::$method->do_direct();
+       my $data = Fink::SelfUpdate::$method->do_direct();
 
 This implements the actual selfupdate sync process. Must be
-over-ridden (obviously).
+over-ridden (obviously). If successful, returns a defined (but
+possibly null) string that contains method-specific information about
+the selfupdate...a point-update version number, a remote server name,
+etc.
 
 =cut
 

Index: point.pm
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/SelfUpdate/Attic/point.pm,v
retrieving revision 1.1.2.7
retrieving revision 1.1.2.8
diff -u -d -r1.1.2.7 -r1.1.2.8
--- point.pm    9 Mar 2007 07:54:10 -0000       1.1.2.7
+++ point.pm    20 Mar 2007 07:13:44 -0000      1.1.2.8
@@ -30,7 +30,6 @@
 use Fink::CLI qw(&print_breaking);
 use Fink::Config qw($basepath $config $distribution);
 use Fink::NetAccess qw(&fetch_url);
-use Fink::FinkVersion qw(&pkginfo_version);
 use Fink::Command qw(cat);
 
 use strict;
@@ -46,6 +45,8 @@
 
 See documentation for the Fink::SelfUpdate base class.
 
+=over 4
+
 =cut
 
 sub desc_short {
@@ -54,12 +55,24 @@
        return 'Stick to point releases';
 }
 
+=item system_check
+
+No requirements checked.
+
+=cut
+
 sub system_check {
        my $class = shift;  # class method for now
 
        return 1;
 }
 
+=item do_direct
+
+Returns point version string.
+
+=cut
+
 sub do_direct {
        my $class = shift;  # class method for now
 
@@ -81,18 +94,21 @@
        }
        my $latest_fink = cat "$srcdir/$currentfink";
        chomp($latest_fink);
-       if ($class->stamp_check()) {
-               # on-disk package descriptions are a point/tarball release,
-               # therefore can skip doing another point/tarball release if we
-               # already have the latest release version
-               my $installed_version = &pkginfo_version();
-               if (&version_cmp($latest_fink . '-1', '<=', $distribution . '-' 
. $installed_version . '-1')) {
+
+       require Fink::SelfUpdate;
+       my @last_selfupdate = &Fink::SelfUpdate::last_done;
+       if ($last_selfupdate[0] ne 'point') {
                        print "\n";
-                       &print_breaking("You already have the package 
descriptions from ".
-                                                       "the latest Fink point 
release. ".
-                                                       
"(installed:$installed_version available:$latest_fink)");
+                       &print_breaking('Fink does not presently support 
switching to selfupdate-point from any other selfupdate method');
                        return;
-               }
+       }
+       
+       if (&version_cmp($latest_fink . '-1', '<=', $distribution . '-' . 
$last_selfupdate[2] . '-1')) {
+               print "\n";
+               &print_breaking("You already have the package descriptions from 
".
+                                               "the latest Fink point release. 
".
+                                               "(installed:$last_selfupdate[2] 
available:$latest_fink)");
+               return;
        }
        
        my $newversion = $latest_fink;
@@ -151,9 +167,11 @@
        if (-e $dir) {
                rm_rf $dir;
        }
+
+       return $newversion;
 }
 
-### TODO: implement stampfile handling somehow
+=back
 
 =head2 Private Methods
 

Index: rsync.pm
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/SelfUpdate/Attic/rsync.pm,v
retrieving revision 1.1.2.9
retrieving revision 1.1.2.10
diff -u -d -r1.1.2.9 -r1.1.2.10
--- rsync.pm    20 Mar 2007 00:25:07 -0000      1.1.2.9
+++ rsync.pm    20 Mar 2007 07:13:44 -0000      1.1.2.10
@@ -45,6 +45,13 @@
 
 See documentation for the Fink::SelfUpdate base class.
 
+=over 4
+
+=item system_check
+
+This method builds packages from source, so it requires the
+"dev-tools" virtual package.
+
 =cut
 
 sub system_check {
@@ -64,26 +71,11 @@
        return 1;
 }
 
-sub stamp_set {
-       my $class = shift;  # class method for now
-
-       my $finkdir = "$basepath/fink";
-       touch "$finkdir/dists/stamp-rsync-live";
-}
-
-sub stamp_clear {
-       my $class = shift;  # class method for now
-
-       my $finkdir = "$basepath/fink";
-       rm_f "$finkdir/stamp-rsync-live", "$finkdir/dists/stamp-rsync-live";
-}
+=item do_direct
 
-sub stamp_check {
-       my $class = shift;  # class method for now
+Returns a null string.
 
-       my $finkdir = "$basepath/fink";
-       return (-f "$finkdir/stamp-rsync-live" || -f 
"$finkdir/dists/stamp-rsync-live");
-}
+=cut
 
 sub do_direct {
        my $class = shift;  # class method for now
@@ -211,13 +203,15 @@
                }
        }
 
-       $class->stamp_set();
-
        # cleanup after ourselves
        unlink "$descdir/TIMESTAMP";
        rename "$descdir/TIMESTAMP.tmp", "$descdir/TIMESTAMP";
+
+       return '';
 }
 
+=back
+
 =head2 Private Methods
 
 None yet.

Index: CVS.pm
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/SelfUpdate/Attic/CVS.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
--- CVS.pm      8 Mar 2007 18:26:11 -0000       1.1.2.6
+++ CVS.pm      20 Mar 2007 07:13:44 -0000      1.1.2.7
@@ -46,6 +46,13 @@
 
 See documentation for the Fink::SelfUpdate base class.
 
+=over 4
+
+=item system_check
+
+This method builds packages from source, so it requires the
+"dev-tools" virtual package.
+
 =cut
 
 sub system_check {
@@ -66,26 +73,11 @@
        &execute("/usr/bin/find $finkdir -name CVS -type d -print0 | xargs -0 
/bin/rm -rf");
 }
 
-sub stamp_set {
-       my $class = shift;  # class method for now
-
-       my $finkdir = "$basepath/fink";
-       touch "$finkdir/dists/stamp-cvs-live";
-}
-
-sub stamp_clear {
-       my $class = shift;  # class method for now
-
-       my $finkdir = "$basepath/fink";
-       rm_f "$finkdir/stamp-cvs-live", "$finkdir/dists/stamp-cvs-live";
-}
+=item do_direct
 
-sub stamp_check {
-       my $class = shift;  # class method for now
+Returns a null string.
 
-       my $finkdir = "$basepath/fink";
-       return (-f "$finkdir/stamp-cvs-live" || -f 
"$finkdir/dists/stamp-cvs-live");
-}
+=cut
 
 sub do_direct {
        my $class = shift;  # class method for now
@@ -98,6 +90,8 @@
        }
 }
 
+=back
+
 =head2 Private Methods
 
 =cut


-------------------------------------------------------------------------
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