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

Modified Files:
        ChangeLog Engine.pm Services.pm 
Log Message:
Stub for future 'cleanup --dpkg-status' mode.
Error-checking for Services::get_options parameters.
Doc-fixes.


Index: Services.pm
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/Services.pm,v
retrieving revision 1.204
retrieving revision 1.205
diff -u -d -r1.204 -r1.205
--- Services.pm 31 May 2006 19:11:28 -0000      1.204
+++ Services.pm 23 Jun 2006 07:37:26 -0000      1.205
@@ -2095,6 +2095,10 @@
                                @$options;
                },
                opts => sub {
+                       if (my @missing_opts = grep {!exists $opts{$_}} @_) {
+                               die "Options (@missing_opts) from [EMAIL 
PROTECTED] not defined in option list ("
+                                       . (join ' ', keys %opts) . ")\n";
+                       }
                        chomp (my $ret = join '', map { _get_option_help($_, 
$optlen) }
                                @[EMAIL PROTECTED] );
                        $ret;

Index: Engine.pm
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/Engine.pm,v
retrieving revision 1.373
retrieving revision 1.374
diff -u -d -r1.373 -r1.374
--- Engine.pm   4 Apr 2006 22:45:43 -0000       1.373
+++ Engine.pm   23 Jun 2006 07:37:26 -0000      1.374
@@ -1011,11 +1011,12 @@
 }
 
 sub cmd_cleanup {
-       # TODO - option that steers which file to keep/delete: keep all files 
that
-       #                                are refered by any .info file; keep 
only those refered to by the
-       #                                current version of any package; etc.
-       #                                Delete all .deb and delete all src? 
Not really needed, this can be
-       #                                achieved each with single line CLI 
commands.
+       # TODO - option that steers which file to keep/delete: keep all
+       #        files that are refered by any .info file vs keep only
+       #        those refered to by the current version of any package,
+       #        etc. Delete all .deb and delete all src? Not really
+       #        needed, this can be achieved each with single line CLI
+       #        commands.
 
        my(%opts, %modes);
        
@@ -1024,15 +1025,17 @@
                [ 'debs'          => \$modes{debs},
                        "Delete .deb (compiled binary package) files." ],
                [ 'buildlocks|bl' => \$modes{bl},       "Delete stale buildlock 
packages." ],
-#              [ 'obsoletes'     => \$modes{obs},      "Delete obsolete 
packages." ],
+#              [ 'obsoletes'     => \$modes{obs},      "Uninstall obsolete 
packages." ],
+#              [ 'dpkg-status'   => \$modes{dpkg_status},
+#                      "Remove uninstalled packages from dpkg status 
database." ],
                [ 'keep-src|k'    => \$opts{keep_old},
                        "Move old source files to $basepath/src/old/ instead of 
deleting them." ],
                [ 'dry-run|d'     => \$opts{dryrun},
-                       "Print the files that would be removed, but do not 
actually remove them." ],
+                       "Print the items that would be removed, but do not 
actually remove them." ],
        ], [EMAIL PROTECTED], helpformat => <<FORMAT,
 %intro{[mode(s) and options]}
 One or more of the following modes must be specified:
-%opts{debs,sources,buildlocks}
+%opts{sources,debs,buildlocks}
 
 Options:
 %opts{keep-src,dry-run,help}
@@ -1047,6 +1050,7 @@
        $modes{debs} && &cleanup_debs(%opts);
        $modes{bl}   && &cleanup_buildlocks(%opts, internally=>0);
        $modes{obs}  && &cleanup_obsoletes(%opts);
+       $modes{dpkg} && &cleanup_dpkg_status(%opts);
 }
 
 =item cleanup_*
@@ -1406,6 +1410,32 @@
        return 1;
 }
 
+=item cleanup_dpkg_status
+
+Remove entries for purged packages from the dpkg "status" database. A
+backup of the original file is kept in the same location with a
+timestamp in its filename. Standard dpkg-compatible locking of the
+database file is used to prevent race conditions or other concurrency
+problems that could result in file corruption. The following option is
+known:
+
+=over 4
+
+=item dryrun
+
+If true, don't actually remove them.
+
+=back
+
+=cut
+
+sub cleanup_dpkg_status {
+       my %opts = (dryrun => 0, @_);
+
+       print "cleanup --dpkg is not yet available.\n";
+       return 1;
+}
+
 =back
 
 =cut

Index: ChangeLog
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/ChangeLog,v
retrieving revision 1.1336
retrieving revision 1.1337
diff -u -d -r1.1336 -r1.1337
--- ChangeLog   22 Jun 2006 17:47:48 -0000      1.1336
+++ ChangeLog   23 Jun 2006 07:37:26 -0000      1.1337
@@ -1,3 +1,9 @@
+2006-06-23  Daniel Macks  <[EMAIL PROTECTED]>
+
+       * Engine.pm: Lay groundwork for cleanup --dpkg-status
+       * Services.pm: _expand_help: sanity-check the %opts{} passed to
+       get_options.
+
 2006-06-22  Dave Morrison  <[EMAIL PROTECTED]>
 
        * Bootstrap.pm: don't internationalize dpkg-bootstrap


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Fink-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fink-commits

Reply via email to