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

Modified Files:
      Tag: branch_0_20
        PkgVersion.pm ChangeLog 
Log Message:
All "Type" keys are now converted to lowercase.
Fix is_type() and get_subtype() to make sure Type has been parsed.
(backport from HEAD)


Index: PkgVersion.pm
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/PkgVersion.pm,v
retrieving revision 1.252.2.2
retrieving revision 1.252.2.3
diff -u -d -r1.252.2.2 -r1.252.2.3
--- PkgVersion.pm       4 May 2004 19:14:57 -0000       1.252.2.2
+++ PkgVersion.pm       7 May 2004 20:22:53 -0000       1.252.2.3
@@ -726,12 +726,19 @@
 }
 
 # returns whether this fink package is of a given Type:
-# presumes the field is already been parsed into $self->{_type_hash}
 
 sub is_type {
        my $self = shift;
        my $type = shift;
 
+       return 0 unless defined $type;
+       return 0 unless length $type;
+       $type = lc $type;
+
+       if (!exists $self->{_type_hash}) {
+               $self->{_type_hash} = 
$self->type_hash_from_string($self->param_default("Type", ""));
+       }
+
        if (defined $self->{_type_hash}->{$type} and length 
$self->{_type_hash}->{$type}) {
                return 1;
        }
@@ -745,6 +752,10 @@
        my $self = shift;
        my $type = shift;
 
+       if (!exists $self->{_type_hash}) {
+               $self->{_type_hash} = 
$self->type_hash_from_string($self->param_default("Type", ""));
+       }
+
        return $self->{_type_hash}->{$type};
 }
 
@@ -761,10 +772,10 @@
        foreach (split /\s*,\s*/, $string) {
                if (/^(\S+)$/) {
                        # no subtype so use type as subtype
-                       $hash{$1} = $1;
+                       $hash{lc $1} = lc $1;
                } elsif (/^(\S+)\s+(\S+)$/) {
                        # have subtype
-                       $hash{$1} = $2;
+                       $hash{lc $1} = $2;
                } else {
                        warn "Bad Type specifier '$_' in $filename\n";
                }

Index: ChangeLog
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/ChangeLog,v
retrieving revision 1.592.2.3
retrieving revision 1.592.2.4
diff -u -d -r1.592.2.3 -r1.592.2.4
--- ChangeLog   4 May 2004 19:14:56 -0000       1.592.2.3
+++ ChangeLog   7 May 2004 20:22:53 -0000       1.592.2.4
@@ -1,5 +1,11 @@
 2004-05-04  Daniel Macks  <[EMAIL PROTECTED]>
 
+       * PkgVersion.pm: All Type are now converted to all-lowercase. Make
+       sure Type has been parsed into _type_hash during is_type() and
+       get_subtype() calls (backport from HEAD).
+
+2004-05-04  Daniel Macks  <[EMAIL PROTECTED]>
+
        * PkgVersion.pm: .deb/control Source field corrected to contain
        parent pkg (if there is one) instead of always same as pkg itself.
        See fink-devel "Source field in var/lib/dpkg/available" April 2004



-------------------------------------------------------
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to deliver
higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3
_______________________________________________
Fink-commits mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/fink-commits

Reply via email to