Update of /cvsroot/fink/experimental/chrisdolan/lib/Fink/CPANPLUS
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14113/lib/Fink/CPANPLUS

Modified Files:
        Module.pm 
Log Message:

v1.20 of mkpkg.pl
 * added difference mode (useful for updates)
 * improvements to prereq determination
 * many bugfixes and a little more documentation


Index: Module.pm
===================================================================
RCS file: /cvsroot/fink/experimental/chrisdolan/lib/Fink/CPANPLUS/Module.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- Module.pm   20 Feb 2005 04:34:08 -0000      1.1
+++ Module.pm   21 Feb 2005 04:30:42 -0000      1.2
@@ -103,6 +103,8 @@
                            Makefile(\.PL|) |
                            MANIFEST\.SKIP |
                            test\.pl |
+                           [Ii]nstall.* |
+                           INSTALL.* |
                            .*\.(bat|xs|pm|pl)
                            )$/x, $self->root_files();
    return @docfiles;
@@ -161,20 +163,22 @@
    if (!$self->{libs})
    {
       $self->{libs} = {};
+      my @check = (
+                   $self->prereqs(),
+                   $self->makefile(),
+                   $self->yml(),
+                   );
       foreach my $type (qw(depends recommends conflicts builddepends 
buildconflicts))
       {
          $self->{libs}->{$type} = {};
 
-         my $p = $self->prereqs->{$type};
-         if ($p)
-         {
-            $self->{libs}->{$type} = {%{$self->{libs}->{$type}}, %$p};
-         }
-
-         my $y = $self->yml->{$type};
-         if ($y)
+         foreach my $o (@check)
          {
-            $self->{libs}->{$type} = {%{$self->{libs}->{$type}}, %$y};
+            my $p = $o->{$type};
+            if ($p)
+            {
+               $self->{libs}->{$type} = {%{$self->{libs}->{$type}}, %$p};
+            }
          }
       }
    }
@@ -221,6 +225,32 @@
          {
             $self->{makefile}->{bin} = 1;
          }
+         # Check for prereqs
+         if ($makefile =~ /([\'\"]?)PREREQ_PM\1\s*(?:=>|,)\s*(\{.*?\})/s)
+         {
+            my $hash = $2;
+            $hash =~ s/\s+/ /g;
+            my $libs = eval $hash;
+            if (!$@)
+            {
+               foreach my $type ("depends")
+               {
+                  $self->{makefile}->{$type} = {};
+                  foreach my $key (keys %$libs)
+                  {
+                     my $pkg = $self->get_dep_pkg($key, $libs->{$key}, $type);
+                     if ($pkg)
+                     {
+                        $self->{makefile}->{$type}->{$pkg} = $libs->{$key};
+                     }
+                  }
+               }
+            }
+            else
+            {
+               print "Eval error for PREREQ_PM: [EMAIL PROTECTED]" if 
($self->verbose);
+            }
+         }
       }
    }
    return $self->{makefile};
@@ -315,7 +345,9 @@
          $self->extract();
          my $dist = $self->{mod}->dist(format => 
$self->{mod}->get_installer_type(),
                                        target => TARGET_PREPARE);
-         my $prereqs = $dist->_find_prereqs();
+         # The file arg is happily ignored for Build.PL packages
+         my $prereqs = $dist->_find_prereqs(file => 
$self->extract_dir()."/Makefile.PL",
+                                            verbose => $self->verbose);
          foreach my $type (qw(depends))
          {
             foreach my $key (sort keys %$prereqs)



-------------------------------------------------------
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://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Fink-commits mailing list
Fink-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fink-commits

Reply via email to