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

Modified Files:
        ChangeLog PkgVersion.pm Validation.pm 
Log Message:
Perform %-expansion on Description.
Clear extraneous hyphens when parsing Package to validate .info filename.
Resolve some "use of uninitialized value" during validation of very broken .info files.


Index: PkgVersion.pm
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/PkgVersion.pm,v
retrieving revision 1.252
retrieving revision 1.253
diff -u -d -r1.252 -r1.253
--- PkgVersion.pm       29 Mar 2004 03:34:44 -0000      1.252
+++ PkgVersion.pm       11 Apr 2004 20:01:26 -0000      1.253
@@ -182,6 +182,10 @@
 
        $self->{_bootstrap} = 0;
 
+       # Description is used by 'fink list' so better to get it expanded now
+       # also keeps %type_[] out of all list and search fields of pdb
+       $self->expand_percent_if_available("Description");
+
        # from here on we have to distinguish between "real" packages and splitoffs
        if (exists $self->{parent}) {
                # so it's a splitoff

Index: Validation.pm
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/Validation.pm,v
retrieving revision 1.116
retrieving revision 1.117
diff -u -d -r1.116 -r1.117
--- Validation.pm       9 Apr 2004 06:10:44 -0000       1.116
+++ Validation.pm       11 Apr 2004 20:01:26 -0000      1.117
@@ -333,7 +333,9 @@
        }
 
        $pkgversion = $properties->{version};
+       $pkgversion = '' unless defined $pkgversion;
        $pkgrevision = $properties->{revision};
+       $pkgrevision = '' unless defined $pkgrevision;
        $pkgfullname = "$pkgname-$pkgversion-$pkgrevision";
        $pkgdestdir = "$buildpath/root-".$pkgfullname;
        
@@ -377,9 +379,16 @@
        #
        # Now check for other mistakes
        #
-       
-       unless (("$pkgfullname.info" eq $filename) || ("$pkgname.info" eq $filename)) {
-               print "Warning: File name should be $pkgfullname.info or $pkgname.info 
($filename)\n";
+
+       # variants with Package: foo-%type[bar] leave escess hyphens
+       my @ok_filenames = $pkgname;
+       $ok_filenames[0] =~ s/-+/-/g;
+       $ok_filenames[0] =~ s/-*$//g;
+       $ok_filenames[1] = "$ok_filenames[0]-$pkgversion-$pkgrevision";
+       map $_ .= ".info", @ok_filenames;
+
+       unless (1 == grep $filename eq $_, @ok_filenames) {
+               print "Warning: File name should be ", join( " or ", @ok_filenames 
),"\n";
                $looks_good = 0;
        }
        

Index: ChangeLog
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/ChangeLog,v
retrieving revision 1.598
retrieving revision 1.599
diff -u -d -r1.598 -r1.599
--- ChangeLog   9 Apr 2004 07:18:56 -0000       1.598
+++ ChangeLog   11 Apr 2004 20:01:25 -0000      1.599
@@ -1,3 +1,11 @@
+2004-04-11  Daniel Macks  <[EMAIL PROTECTED]>
+
+       * PkgVersion.pm: Perform %-expansion on Description (during indexing).
+       * Validation.pm: When constructing allowed .info filenames, clear out
+       strings of multiple hyphens or hyphens at the end. Also resolve some
+       some "use of uninitialized value" warnings when certain fields are
+       missing from the .info.
+
 2004-04-09  Daniel Macks  <[EMAIL PROTECTED]>
 
        * Engine.pm: Fix dumpinfo so when run on a SplitOff package it



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Fink-commits mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/fink-commits

Reply via email to