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

Modified Files:
        ChangeLog Engine.pm 
Log Message:
Use named constants for fink list/apropos option bits.


Index: Engine.pm
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/Engine.pm,v
retrieving revision 1.206
retrieving revision 1.207
diff -u -d -r1.206 -r1.207
--- Engine.pm   18 Oct 2004 12:31:10 -0000      1.206
+++ Engine.pm   25 Oct 2004 06:28:33 -0000      1.207
@@ -298,6 +298,10 @@
        (
         "installedstate" => 0
        );
+       # bits used by $options{intalledstate}
+       my $ISTATE_OUTDATED = 1;
+       my $ISTATE_CURRENT  = 2;
+       my $ISTATE_ABSENT   = 4;
        my ($width, $namelen, $verlen, $dotab);
        my $cmd = shift;
        use Getopt::Long;
@@ -310,10 +314,10 @@
                GetOptions(
                                   'width|w=s'          => \$width,
                                   'tab|t'                      => \$dotab,
-                                  'installed|i'        => sub 
{$options{installedstate} |=3;},
-                                  'uptodate|u'         => sub 
{$options{installedstate} |=2;},
-                                  'outdated|o'         => sub 
{$options{installedstate} |=1;},
-                                  'notinstalled|n'     => sub 
{$options{installedstate} |=4;},
+                                  'installed|i'        => sub 
{$options{installedstate} |= $ISTATE_OUTDATED | $ISTATE_CURRENT ;},
+                                  'uptodate|u'         => sub 
{$options{installedstate} |= $ISTATE_CURRENT  ;},
+                                  'outdated|o'         => sub 
{$options{installedstate} |= $ISTATE_OUTDATED ;},
+                                  'notinstalled|n'     => sub 
{$options{installedstate} |= $ISTATE_ABSENT   ;},
                                   'buildonly|b'        => \$buildonly,
                                   'section|s=s'        => \$section,
                                   'maintainer|m=s'     => \$maintainer,
@@ -327,7 +331,9 @@
                                   'help|h'                     => sub 
{&help_list_apropos($cmd)}
                ) or die "fink list: unknown option\nType 'fink $cmd --help' for more 
information.\n";
        }
-       if ($options{installedstate} == 0) {$options{installedstate} = 7;}
+       if ($options{installedstate} == 0) {
+               $options{installedstate} = $ISTATE_OUTDATED | $ISTATE_CURRENT | 
$ISTATE_ABSENT;
+       }
 
        # By default or if --width=auto, compute the output width to fit exactly into 
the terminal
        if ((not defined $width and not $dotab) or (defined $width and
@@ -388,7 +394,7 @@
                        $iflag = "   ";
                        $description = "[virtual package]";
                        next if ($cmd eq "apropos"); 
-                       next unless ($options{installedstate} & 4);
+                       next unless ($options{installedstate} & $ISTATE_ABSENT);
                        next if (defined $buildonly);
                        next if (defined $section);
                        next if (defined $maintainer);
@@ -397,14 +403,14 @@
                        $lversion = &latest_version($package->list_versions());
                        $vo = $package->get_version($lversion);
                        if ($vo->is_installed()) {
-                               next unless ($options{installedstate} & 2);
+                               next unless ($options{installedstate} & 
$ISTATE_CURRENT);
                                $iflag = " i ";
                        } elsif ($package->is_any_installed()) {
                                $iflag = "(i)";
-                               next unless ($options{installedstate} & 1);
+                               next unless ($options{installedstate} & 
$ISTATE_OUTDATED);
                        } else {
                                $iflag = "   ";
-                               next unless ($options{installedstate} & 4);
+                               next unless ($options{installedstate} & 
$ISTATE_ABSENT);
                        }
 
                        $description = $vo->get_shortdescription($desclen);

Index: ChangeLog
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/ChangeLog,v
retrieving revision 1.725
retrieving revision 1.726
diff -u -d -r1.725 -r1.726
--- ChangeLog   22 Oct 2004 16:42:01 -0000      1.725
+++ ChangeLog   25 Oct 2004 06:28:33 -0000      1.726
@@ -1,3 +1,7 @@
+2004-10-25  Daniel Macks  <[EMAIL PROTECTED]>
+
+       * Engine.pm: Use named constants for fink list/apropos option bits.
+
 2004-10-22  Daniel Macks  <[EMAIL PROTECTED]>
 
        * Services.pm: Fixed ignoring of null OR clusters in lol2pkglist.



-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
Fink-commits mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/fink-commits

Reply via email to