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

Modified Files:
        ChangeLog Engine.pm 
Log Message:
Make the 'fetch' command support the same arguments as 'fetch-all'.
Such as --dry-run, --help, and -i to ignore restrictive licenses.


Index: Engine.pm
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/Engine.pm,v
retrieving revision 1.212
retrieving revision 1.213
diff -u -d -r1.212 -r1.213
--- Engine.pm   29 Nov 2004 03:30:30 -0000      1.212
+++ Engine.pm   2 Dec 2004 15:01:13 -0000       1.213
@@ -592,13 +592,32 @@
 sub cmd_fetch {
        my ($package, @plist);
 
+       my (%options, $norestrictive, $dryrun);
+       my @sav = @_;
+       %options = &parse_fetch_options("fetch", @_);
+       $norestrictive = $options{"norestrictive"} || 0;
+       $dryrun = $options{"dryrun"} || 0;
+
+       @_ = @sav;
+       if( $dryrun ) {
+               shift;
+       }
+       if( $norestrictive ) {
+               shift;
+       }
+
        @plist = &expand_packages(@_);
        if ($#plist < 0) {
                die "no package specified for command 'fetch'!\n";
        }
 
        foreach $package (@plist) {
-               $package->phase_fetch(0, 0);
+               my $pname = $package->get_name();
+               if ($norestrictive && $package->has_param("license") && 
$package->param("license") =~ m/Restrictive\s*$/i) {
+                               print "Ignoring $pname due to License: 
Restrictive\n";
+                               next;
+               }
+               $package->phase_fetch(0, $dryrun);
        }
 }
 

Index: ChangeLog
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/ChangeLog,v
retrieving revision 1.765
retrieving revision 1.766
diff -u -d -r1.765 -r1.766
--- ChangeLog   30 Nov 2004 21:49:53 -0000      1.765
+++ ChangeLog   2 Dec 2004 15:01:13 -0000       1.766
@@ -1,3 +1,7 @@
+2004-12-02  Rob Braun <[EMAIL PROTECTED]>
+
+       * Engine.pm: Make 'fetch' support the same arguments as 'fetch-all'.
+
 2004-11-30  Daniel Macks  <[EMAIL PROTECTED]>
 
        * PkgVersion.pm: Fixed &execute() result-code handling when



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
Fink-commits mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/fink-commits

Reply via email to