r5348 - in /packages/libpar-perl/trunk: ./ debian/ inc/Module/Install/ inc/Test/ inc/Test/Builder/ lib/ lib/PAR/ t/

eloy at users.alioth.debian.org eloy at users.alioth.debian.org
Fri May 4 09:40:39 UTC 2007


Author: eloy
Date: Fri May  4 09:40:38 2007
New Revision: 5348

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=5348
Log:
new upstream version

Added:
    packages/libpar-perl/trunk/t/50-autoloaderfix.t
      - copied unchanged from r5347, packages/libpar-perl/branches/upstream/current/t/50-autoloaderfix.t
Modified:
    packages/libpar-perl/trunk/AUTHORS
    packages/libpar-perl/trunk/ChangeLog
    packages/libpar-perl/trunk/MANIFEST
    packages/libpar-perl/trunk/META.yml
    packages/libpar-perl/trunk/Makefile.PL
    packages/libpar-perl/trunk/SIGNATURE
    packages/libpar-perl/trunk/debian/changelog
    packages/libpar-perl/trunk/inc/Module/Install/Makefile.pm
    packages/libpar-perl/trunk/inc/Module/Install/Metadata.pm
    packages/libpar-perl/trunk/inc/Test/Builder.pm
    packages/libpar-perl/trunk/inc/Test/Builder/Module.pm
    packages/libpar-perl/trunk/inc/Test/More.pm
    packages/libpar-perl/trunk/lib/PAR.pm
    packages/libpar-perl/trunk/lib/PAR/Heavy.pm

Modified: packages/libpar-perl/trunk/AUTHORS
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libpar-perl/trunk/AUTHORS?rev=5348&op=diff
==============================================================================
--- packages/libpar-perl/trunk/AUTHORS (original)
+++ packages/libpar-perl/trunk/AUTHORS Fri May  4 09:40:38 2007
@@ -1,7 +1,12 @@
 Here is a list of people and their CPAN id, extracted from the Changes
 file and the mailing list archives.  These people have either submitted
 patches or suggestions, or their bug reports or comments have inspired
-the appropriate patches.  Corrections, additions, deletions welcome:
+the appropriate patches.  
+
+Note that this list applies to both PAR and the now separate PAR-Packer
+distribution.
+
+Corrections, additions, deletions welcome:
 
 Abe Timmerman                 (ABELTJE)
 Abhijit Menon-Sen             (AMS)
@@ -40,6 +45,8 @@
 Edward S. Peschko
 Edward Wildgoose
 Eric Paulson
+Eric Wilhelm
+Gaal Yahas                    (GAAL)
 Gerald Richter                (GRICHTER)
 Germain Garand                (GGARAND)
 Glenn Mabbutt
@@ -54,6 +61,7 @@
 James Muir
 Jan Dubois                    (JDB)
 Jeff Goff                     (JGOFF)
+Jerrad Pierce
 Jerry Veldhuis
 Jesse Schoch
 Jesse Vincent                 (JESSE)

Modified: packages/libpar-perl/trunk/ChangeLog
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libpar-perl/trunk/ChangeLog?rev=5348&op=diff
==============================================================================
--- packages/libpar-perl/trunk/ChangeLog (original)
+++ packages/libpar-perl/trunk/ChangeLog Fri May  4 09:40:38 2007
@@ -1,3 +1,42 @@
+
+[Changes for 0.973 - Feb  3, 2007]
+* New features
+    - A new option for the "use PAR { ... };" use case:
+      "no_shlib_unpack" signals that for this particular .par file,
+      shared libraries that were added with the --lib option should
+      not be extracted. This allows users to do their own cache
+      handling for these libraries.
+    - PAR no longer unpacks *all* shared libraries by default but only
+      those in the shlib/ directory (i.e. added with --lib).
+      The shared libraries in auto/ should be picked up by the DynaLoader
+      hack.
+    - If available, the prefork.pm module will be used to declare
+      run-time dependencies for better memory use in forking
+      environments.
+    - PAR now uses a caching mechanism to speed up the extraction process.
+      This should particularly impact users of the "use PAR {file =>...}"
+      form.
+
+* Bug fixes, etc.
+    - Applied an optimization of the unpacking process on case insensitive
+      file systems.
+
+[Changes for 0.972 - Jan 16, 2007]
+* Bug fixes, etc.
+    - Removed PAR::AutoLoaderFix again. It wasn't working as expected
+      all the time.
+    - To fix the problem AutoLoaderFix was supposed to fix, we now
+      require AutoLoader 5.62 or newer which was just recently released
+      to CPAN. (Previously only available from blead perl.)
+
+[Changes for 0.971 - Jan 12, 2007]
+* Bug fixes, etc.
+    - Fixed typo in the POD. (Jerrad Pierce)
+    - Included fix for a bug in AutoLoader.pm as shipped with all
+      perl versions up to and including 5.8.8 as PAR::AutoLoaderFix.
+      This cures a problem of endless looping when the %INC entry of a
+      module doesn't point to a file of the same name.
+      This may happen during "use PAR 'foo.par'".
 
 [Changes for 0.970 - Dec  3, 2006]
 * This release introduces some rather radical changes, so read carefully:

Modified: packages/libpar-perl/trunk/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libpar-perl/trunk/MANIFEST?rev=5348&op=diff
==============================================================================
--- packages/libpar-perl/trunk/MANIFEST (original)
+++ packages/libpar-perl/trunk/MANIFEST Fri May  4 09:40:38 2007
@@ -27,6 +27,7 @@
 t/00-pod.t
 t/01-basic.t
 t/40-par-hashref.t
+t/50-autoloaderfix.t
 t/hello.par
 t/Hello.pm
 TODO

Modified: packages/libpar-perl/trunk/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libpar-perl/trunk/META.yml?rev=5348&op=diff
==============================================================================
--- packages/libpar-perl/trunk/META.yml (original)
+++ packages/libpar-perl/trunk/META.yml Fri May  4 09:40:38 2007
@@ -1,8 +1,12 @@
+--- 
 abstract: Perl Archive Tookit
 author: Audrey Tang <cpan at audreyt.org>
 distribution_type: module
 generated_by: Module::Install version 0.640
 license: perl
+meta-spec: 
+  url: http://module-build.sourceforge.net/META-spec-v1.3.html
+  version: 1.3
 name: PAR
 no_index: 
   directory: 
@@ -12,7 +16,7 @@
 provides: 
   PAR: 
     file: lib/PAR.pm
-    version: 0.970
+    version: 0.973
   PAR::Heavy: 
     file: lib/PAR/Heavy.pm
     version: 0.09
@@ -20,8 +24,9 @@
   Digest: Module::Signature
 requires: 
   Archive::Zip: 1
+  AutoLoader: 5.62
   Compress::Zlib: 1.3
   File::Temp: 0.05
   PAR::Dist: 0.21
   perl: 5.6.0
-version: 0.970
+version: 0.973

Modified: packages/libpar-perl/trunk/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libpar-perl/trunk/Makefile.PL?rev=5348&op=diff
==============================================================================
--- packages/libpar-perl/trunk/Makefile.PL (original)
+++ packages/libpar-perl/trunk/Makefile.PL Fri May  4 09:40:38 2007
@@ -11,6 +11,7 @@
 requires    'Compress::Zlib'    => ($^O eq 'MSWin32') ? 1.16 : 1.30;
 requires    'Archive::Zip'      => 1.00;
 requires    'PAR::Dist'         => 0.21;
+requires    'AutoLoader'        => 5.62;
 
 if (can_use('Crypt::OpenPGP') or can_run('gpg')) {
     my $has_sha1 = (

Modified: packages/libpar-perl/trunk/SIGNATURE
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libpar-perl/trunk/SIGNATURE?rev=5348&op=diff
==============================================================================
--- packages/libpar-perl/trunk/SIGNATURE (original)
+++ packages/libpar-perl/trunk/SIGNATURE Fri May  4 09:40:38 2007
@@ -14,11 +14,11 @@
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
-SHA1 97ae61ef8c3eedba7be1360e4cdd5274c9e381d5 AUTHORS
-SHA1 e7f154622d57623f1a6ca5777c652b6a1f666374 ChangeLog
-SHA1 ec41e643f2f59c03202f5f2a5b6c145c0bcf3746 MANIFEST
-SHA1 d0c0e75a24cfd89f351ffafd59d192e4b396bb78 META.yml
-SHA1 823ad5a9fecaf217864959398d09b6172c754210 Makefile.PL
+SHA1 9290c4f868a296d885cb7e910655f529d9495267 AUTHORS
+SHA1 d33cde20aeb90fa9de642e51332a16f494eb5863 ChangeLog
+SHA1 5afb185c341a24de5329030913379ffc82b8c9a5 MANIFEST
+SHA1 273f0c0742a32216d41b239e425b6f2f88f18fdf META.yml
+SHA1 0de31bcebf24eb4152cebfcf3493d2f6e58fea42 Makefile.PL
 SHA1 8c2f9ec457ddd9089b1e2ca642a7e139d620c76e README
 SHA1 886fa7bf70cf69d8b6050355754f6d9ec2567115 TODO
 SHA1 603bb9de29fb8cba7f13409c546750972eff645d inc/Module/AutoInstall.pm
@@ -28,27 +28,28 @@
 SHA1 95b81d1e91bd634467bf633571eff4420e9c04eb inc/Module/Install/Can.pm
 SHA1 1fe98c63cf9d7271c8cb4183ba230f152df69e26 inc/Module/Install/Fetch.pm
 SHA1 0606a8b02a420600bc3e2b65ab82f70266784926 inc/Module/Install/Include.pm
-SHA1 2249171a2b72cd73ff2c0a06597d29f86e5df456 inc/Module/Install/Makefile.pm
-SHA1 381bb98ea3877bba49ae85e7a7ea130645fd3dbf inc/Module/Install/Metadata.pm
+SHA1 aa4a3d87cedc972e3dc0d5d156809624e6db9416 inc/Module/Install/Makefile.pm
+SHA1 f1d4e1bbcb40bb269f36e6dc011b3ca25d3829b7 inc/Module/Install/Metadata.pm
 SHA1 0c2118868ef82ac517eb6d9c3bd93e6eb9bbf83e inc/Module/Install/Win32.pm
 SHA1 e827d6d43771032fa3df35c0ad5e5698d0e54cda inc/Module/Install/WriteAll.pm
-SHA1 ae96dc4c051a202e5db3fa73133e6183ee4910b2 inc/Test/Builder.pm
-SHA1 a9037004a2c3096d77169a16da95743eeb813539 inc/Test/Builder/Module.pm
-SHA1 45d0149fee8d12082d0aa00fd9202f4b29126824 inc/Test/More.pm
-SHA1 bbaa53e28a211707f7d88b0250fef089d37c3a6f lib/PAR.pm
+SHA1 c9b5788f3d1e3df0d470f5e62b301c6a4ee90be3 inc/Test/Builder.pm
+SHA1 656ce4d8b5b4f48309912d0482faa9e8cfeb06bd inc/Test/Builder/Module.pm
+SHA1 5afdf0a16fd053bfb06cec60ca754be03d87e179 inc/Test/More.pm
+SHA1 4a0c75ec0b5b4d4c1043dd2959040e35f3c61ec8 lib/PAR.pm
 SHA1 457e7dcab77a9a1a1ba77ea155be709598296326 lib/PAR/Environment.pod
 SHA1 1d7e734ec9cfec7a53b13e63542308c799881c5d lib/PAR/FAQ.pod
-SHA1 e153f2a9808b2d1c78af6d4f065209b52be502ff lib/PAR/Heavy.pm
+SHA1 8d79f62ce93bcc82f478d2690008c42bce34b4ff lib/PAR/Heavy.pm
 SHA1 44d0f288e8c9a7362697b5d64c4272da16cfe0c9 lib/PAR/Tutorial.pod
 SHA1 3467e6bd4b5227f8e1e21f45832b279c2e8c5b7f t/00-pod.t
 SHA1 dc1c8eb9ff09172ea1df02257b68032695673e2e t/01-basic.t
 SHA1 82548e8de5a8d7a451d33cfcdece13f613d0efc2 t/40-par-hashref.t
+SHA1 550e7f3685242e47e9d47be45495417a7597e11c t/50-autoloaderfix.t
 SHA1 0ebe6181affc8afe78fad4446075d8f0ee420cfd t/Hello.pm
 SHA1 a0258484d56cc699190be4cd93a16d145a0e1d16 t/hello.par
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.3 (GNU/Linux)
 
-iD8DBQFFcwimZCuimE51gxcRAuKLAJwOkLTslxePnKVP+Na873+nzo1DXgCeMjB2
-iyUUZOP7CAaXHxC9NNRILbQ=
-=sUbQ
+iD8DBQFFxG/gZCuimE51gxcRAnZEAKCYwVugHWNqWnC8DInnnjETCveXVACgyb/3
+CSCsyE+zcG4xogIM4Lu2cKY=
+=BmAm
 -----END PGP SIGNATURE-----

Modified: packages/libpar-perl/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libpar-perl/trunk/debian/changelog?rev=5348&op=diff
==============================================================================
--- packages/libpar-perl/trunk/debian/changelog (original)
+++ packages/libpar-perl/trunk/debian/changelog Fri May  4 09:40:38 2007
@@ -1,7 +1,12 @@
+libpar-perl (0.973-1) UNRELEASED; urgency=low
+
+  * (NOT RELEASED YET) New upstream release
+
+ -- Krzysztof Krzyzaniak (eloy) <eloy at debian.org>  Fri, 04 May 2007 11:33:41 +0200
+
 libpar-perl (0.970-1) UNRELEASED; urgency=low
 
-  * (NOT RELEASED YET) New upstream release
-  * Not ready for upload yet, check ChangeLog
+  * New upstream release
 
  -- Krzysztof Krzyzaniak (eloy) <eloy at debian.org>  Fri,  8 Dec 2006 14:13:20 +0100
 

Modified: packages/libpar-perl/trunk/inc/Module/Install/Makefile.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libpar-perl/trunk/inc/Module/Install/Makefile.pm?rev=5348&op=diff
==============================================================================
--- packages/libpar-perl/trunk/inc/Module/Install/Makefile.pm (original)
+++ packages/libpar-perl/trunk/inc/Module/Install/Makefile.pm Fri May  4 09:40:38 2007
@@ -137,8 +137,10 @@
     }
 
     my %args = map { ( $_ => $args->{$_} ) } grep {defined($args->{$_})} keys %$args;
-    if ($self->admin->preop) {
-        $args{dist} = $self->admin->preop;
+
+    my $user_preop = delete $args{dist}->{PREOP};
+    if (my $preop = $self->admin->preop($user_preop)) {
+        $args{dist} = $preop;
     }
 
     my $mm = ExtUtils::MakeMaker::WriteMakefile(%args);
@@ -205,4 +207,4 @@
 
 __END__
 
-#line 334
+#line 336

Modified: packages/libpar-perl/trunk/inc/Module/Install/Metadata.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libpar-perl/trunk/inc/Module/Install/Metadata.pm?rev=5348&op=diff
==============================================================================
--- packages/libpar-perl/trunk/inc/Module/Install/Metadata.pm (original)
+++ packages/libpar-perl/trunk/inc/Module/Install/Metadata.pm Fri May  4 09:40:38 2007
@@ -279,9 +279,11 @@
 
     if (
         $self->_slurp($file) =~ m/
-        =head \d \s+
-        (?:licen[cs]e|licensing|copyright|legal)\b
-        (.*?)
+        (
+            =head \d \s+
+            (?:licen[cs]e|licensing|copyright|legal)\b
+            .*?
+        )
         (=head\\d.*|=cut.*|)
         \z
     /ixms
@@ -298,6 +300,7 @@
             'LGPL'                                            => 'lgpl',
             'BSD'                                             => 'bsd',
             'Artistic'                                        => 'artistic',
+            'MIT'                                             => 'MIT',
         );
         while ( my ( $pattern, $license ) = splice( @phrases, 0, 2 ) ) {
             $pattern =~ s{\s+}{\\s+}g;

Modified: packages/libpar-perl/trunk/inc/Test/Builder.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libpar-perl/trunk/inc/Test/Builder.pm?rev=5348&op=diff
==============================================================================
--- packages/libpar-perl/trunk/inc/Test/Builder.pm (original)
+++ packages/libpar-perl/trunk/inc/Test/Builder.pm Fri May  4 09:40:38 2007
@@ -9,14 +9,15 @@
 
 use strict;
 use vars qw($VERSION);
-$VERSION = '0.33';
+$VERSION = '0.35';
 $VERSION = eval $VERSION;    # make the alpha version come out as a number
 
 # Make Test::Builder thread-safe for ithreads.
 BEGIN {
     use Config;
-    # Load threads::shared when threads are turned on
-    if( $] >= 5.008 && $Config{useithreads} && $INC{'threads.pm'}) {
+    # Load threads::shared when threads are turned on.
+    # 5.8.0's threads are so busted we no longer support them.
+    if( $] >= 5.008001 && $Config{useithreads} && $INC{'threads.pm'}) {
         require threads::shared;
 
         # Hack around YET ANOTHER threads::shared bug.  It would 
@@ -36,7 +37,7 @@
                 $$data = ${$_[0]};
             }
             else {
-                die "Unknown type: ".$type;
+                die("Unknown type: ".$type);
             }
 
             $_[0] = &threads::shared::share($_[0]);
@@ -51,14 +52,14 @@
                 ${$_[0]} = $$data;
             }
             else {
-                die "Unknown type: ".$type;
+                die("Unknown type: ".$type);
             }
 
             return $_[0];
         };
     }
-    # 5.8.0's threads::shared is busted when threads are off.
-    # We emulate it here.
+    # 5.8.0's threads::shared is busted when threads are off
+    # and earlier Perls just don't have that module at all.
     else {
         *share = sub { return $_[0] };
         *lock  = sub { 0 };
@@ -66,7 +67,7 @@
 }
 
 
-#line 127
+#line 128
 
 my $Test = Test::Builder->new;
 sub new {
@@ -76,7 +77,7 @@
 }
 
 
-#line 149
+#line 150
 
 sub create {
     my $class = shift;
@@ -87,7 +88,7 @@
     return $self;
 }
 
-#line 168
+#line 169
 
 use vars qw($Level);
 
@@ -122,7 +123,7 @@
     return undef;
 }
 
-#line 220
+#line 221
 
 sub exported_to {
     my($self, $pack) = @_;
@@ -133,16 +134,17 @@
     return $self->{Exported_To};
 }
 
-#line 242
+#line 243
 
 sub plan {
     my($self, $cmd, $arg) = @_;
 
     return unless $cmd;
 
+    local $Level = $Level + 1;
+
     if( $self->{Have_Plan} ) {
-        die sprintf "You tried to plan twice!  Second plan at %s line %d\n",
-          ($self->caller)[1,2];
+        $self->croak("You tried to plan twice");
     }
 
     if( $cmd eq 'no_plan' ) {
@@ -153,33 +155,32 @@
     }
     elsif( $cmd eq 'tests' ) {
         if( $arg ) {
+            local $Level = $Level + 1;
             return $self->expected_tests($arg);
         }
         elsif( !defined $arg ) {
-            die "Got an undefined number of tests.  Looks like you tried to ".
-                "say how many tests you plan to run but made a mistake.\n";
+            $self->croak("Got an undefined number of tests");
         }
         elsif( !$arg ) {
-            die "You said to run 0 tests!  You've got to run something.\n";
+            $self->croak("You said to run 0 tests");
         }
     }
     else {
-        require Carp;
         my @args = grep { defined } ($cmd, $arg);
-        Carp::croak("plan() doesn't understand @args");
+        $self->croak("plan() doesn't understand @args");
     }
 
     return 1;
 }
 
-#line 289
+#line 290
 
 sub expected_tests {
     my $self = shift;
     my($max) = @_;
 
     if( @_ ) {
-        die "Number of tests must be a postive integer.  You gave it '$max'.\n"
+        $self->croak("Number of tests must be a positive integer.  You gave it '$max'")
           unless $max =~ /^\+?\d+$/ and $max > 0;
 
         $self->{Expected_Tests} = $max;
@@ -191,7 +192,7 @@
 }
 
 
-#line 314
+#line 315
 
 sub no_plan {
     my $self = shift;
@@ -200,7 +201,7 @@
     $self->{Have_Plan} = 1;
 }
 
-#line 329
+#line 330
 
 sub has_plan {
     my $self = shift;
@@ -211,7 +212,7 @@
 };
 
 
-#line 347
+#line 348
 
 sub skip_all {
     my($self, $reason) = @_;
@@ -226,7 +227,7 @@
     exit(0);
 }
 
-#line 380
+#line 381
 
 sub ok {
     my($self, $test, $name) = @_;
@@ -235,10 +236,7 @@
     # store, so we turn it into a boolean.
     $test = $test ? 1 : 0;
 
-    unless( $self->{Have_Plan} ) {
-        require Carp;
-        Carp::croak("You tried to run a test without a plan!  Gotta have a plan.");
-    }
+    $self->_plan_check;
 
     lock $self->{Curr_Test};
     $self->{Curr_Test}++;
@@ -300,10 +298,10 @@
 
 	if( defined $name ) {
 	    $self->diag(qq[  $msg test '$name'\n]);
-	    $self->diag(qq[  in $file at line $line.\n]);
+	    $self->diag(qq[  at $file line $line.\n]);
 	}
 	else {
-	    $self->diag(qq[  $msg test in $file at line $line.\n]);
+	    $self->diag(qq[  $msg test at $file line $line.\n]);
 	}
     } 
 
@@ -367,7 +365,7 @@
 
 
 
-#line 535
+#line 533
 
 sub is_eq {
     my($self, $got, $expect, $name) = @_;
@@ -431,7 +429,7 @@
 
 }    
 
-#line 613
+#line 611
 
 sub isnt_eq {
     my($self, $got, $dont_expect, $name) = @_;
@@ -466,7 +464,7 @@
 }
 
 
-#line 665
+#line 663
 
 sub like {
     my($self, $this, $regex, $name) = @_;
@@ -482,7 +480,7 @@
     $self->_regex_ok($this, $regex, '!~', $name);
 }
 
-#line 706
+#line 704
 
 
 sub maybe_regex {
@@ -549,7 +547,7 @@
     return $ok;
 }
 
-#line 781
+#line 779
 
 
 my %numeric_cmps = map { ($_, 1) } 
@@ -618,7 +616,7 @@
 }
 
 
-#line 860
+#line 858
 
 sub BAIL_OUT {
     my($self, $reason) = @_;
@@ -628,22 +626,19 @@
     exit 255;
 }
 
-#line 873
+#line 871
 
 *BAILOUT = \&BAIL_OUT;
 
 
-#line 885
+#line 883
 
 sub skip {
     my($self, $why) = @_;
     $why ||= '';
     $self->_unoverload_str(\$why);
 
-    unless( $self->{Have_Plan} ) {
-        require Carp;
-        Carp::croak("You tried to run tests without a plan!  Gotta have a plan.");
-    }
+    $self->_plan_check;
 
     lock($self->{Curr_Test});
     $self->{Curr_Test}++;
@@ -668,16 +663,13 @@
 }
 
 
-#line 930
+#line 925
 
 sub todo_skip {
     my($self, $why) = @_;
     $why ||= '';
 
-    unless( $self->{Have_Plan} ) {
-        require Carp;
-        Carp::croak("You tried to run tests without a plan!  Gotta have a plan.");
-    }
+    $self->_plan_check;
 
     lock($self->{Curr_Test});
     $self->{Curr_Test}++;
@@ -700,7 +692,7 @@
 }
 
 
-#line 1001
+#line 993
 
 sub level {
     my($self, $level) = @_;
@@ -712,7 +704,7 @@
 }
 
 
-#line 1036
+#line 1026
 
 sub use_numbers {
     my($self, $use_nums) = @_;
@@ -724,7 +716,7 @@
 }
 
 
-#line 1070
+#line 1060
 
 foreach my $attribute (qw(No_Header No_Ending No_Diag)) {
     my $method = lc $attribute;
@@ -743,7 +735,7 @@
 }
 
 
-#line 1124
+#line 1114
 
 sub diag {
     my($self, @msgs) = @_;
@@ -770,7 +762,7 @@
     return 0;
 }
 
-#line 1161
+#line 1151
 
 sub _print {
     my($self, @msgs) = @_;
@@ -794,8 +786,7 @@
     print $fh $msg;
 }
 
-
-#line 1192
+#line 1185
 
 sub _print_diag {
     my $self = shift;
@@ -805,13 +796,13 @@
     print $fh @_;
 }    
 
-#line 1229
+#line 1222
 
 sub output {
     my($self, $fh) = @_;
 
     if( defined $fh ) {
-        $self->{Out_FH} = _new_fh($fh);
+        $self->{Out_FH} = $self->_new_fh($fh);
     }
     return $self->{Out_FH};
 }
@@ -820,7 +811,7 @@
     my($self, $fh) = @_;
 
     if( defined $fh ) {
-        $self->{Fail_FH} = _new_fh($fh);
+        $self->{Fail_FH} = $self->_new_fh($fh);
     }
     return $self->{Fail_FH};
 }
@@ -829,23 +820,24 @@
     my($self, $fh) = @_;
 
     if( defined $fh ) {
-        $self->{Todo_FH} = _new_fh($fh);
+        $self->{Todo_FH} = $self->_new_fh($fh);
     }
     return $self->{Todo_FH};
 }
 
 
 sub _new_fh {
+    my $self = shift;
     my($file_or_fh) = shift;
 
     my $fh;
-    if( _is_fh($file_or_fh) ) {
+    if( $self->_is_fh($file_or_fh) ) {
         $fh = $file_or_fh;
     }
     else {
         $fh = do { local *FH };
-        open $fh, ">$file_or_fh" or 
-            die "Can't open test output log $file_or_fh: $!";
+        open $fh, ">$file_or_fh" or
+            $self->croak("Can't open test output log $file_or_fh: $!");
 	_autoflush($fh);
     }
 
@@ -854,6 +846,7 @@
 
 
 sub _is_fh {
+    my $self = shift;
     my $maybe_fh = shift;
     return 0 unless defined $maybe_fh;
 
@@ -904,7 +897,36 @@
 }
 
 
-#line 1347
+#line 1337
+
+sub _message_at_caller {
+    my $self = shift;
+
+    local $Level = $Level + 1;
+    my($pack, $file, $line) = $self->caller;
+    return join("", @_) . " at $file line $line.\n";
+}
+
+sub carp {
+    my $self = shift;
+    warn $self->_message_at_caller(@_);
+}
+
+sub croak {
+    my $self = shift;
+    die $self->_message_at_caller(@_);
+}
+
+sub _plan_check {
+    my $self = shift;
+
+    unless( $self->{Have_Plan} ) {
+        local $Level = $Level + 2;
+        $self->croak("You tried to run a test without a plan");
+    }
+}
+
+#line 1385
 
 sub current_test {
     my($self, $num) = @_;
@@ -912,8 +934,7 @@
     lock($self->{Curr_Test});
     if( defined $num ) {
         unless( $self->{Have_Plan} ) {
-            require Carp;
-            Carp::croak("Can't change the current test number without a plan!");
+            $self->croak("Can't change the current test number without a plan!");
         }
 
         $self->{Curr_Test} = $num;
@@ -941,7 +962,7 @@
 }
 
 
-#line 1393
+#line 1430
 
 sub summary {
     my($self) = shift;
@@ -949,14 +970,14 @@
     return map { $_->{'ok'} } @{ $self->{Test_Results} };
 }
 
-#line 1448
+#line 1485
 
 sub details {
     my $self = shift;
     return @{ $self->{Test_Results} };
 }
 
-#line 1473
+#line 1510
 
 sub todo {
     my($self, $pack) = @_;
@@ -969,7 +990,7 @@
                                      : 0;
 }
 
-#line 1494
+#line 1531
 
 sub caller {
     my($self, $height) = @_;
@@ -979,34 +1000,35 @@
     return wantarray ? @caller : $caller[0];
 }
 
-#line 1506
-
-#line 1520
+#line 1543
+
+#line 1557
 
 #'#
 sub _sanity_check {
     my $self = shift;
 
-    _whoa($self->{Curr_Test} < 0,  'Says here you ran a negative number of tests!');
-    _whoa(!$self->{Have_Plan} and $self->{Curr_Test}, 
+    $self->_whoa($self->{Curr_Test} < 0,  'Says here you ran a negative number of tests!');
+    $self->_whoa(!$self->{Have_Plan} and $self->{Curr_Test}, 
           'Somehow your tests ran without a plan!');
-    _whoa($self->{Curr_Test} != @{ $self->{Test_Results} },
+    $self->_whoa($self->{Curr_Test} != @{ $self->{Test_Results} },
           'Somehow you got a different number of results than tests ran!');
 }
 
-#line 1541
+#line 1578
 
 sub _whoa {
-    my($check, $desc) = @_;
+    my($self, $check, $desc) = @_;
     if( $check ) {
-        die <<WHOA;
+        local $Level = $Level + 1;
+        $self->croak(<<"WHOA");
 WHOA!  $desc
 This should never happen!  Please contact the author immediately!
 WHOA
     }
 }
 
-#line 1562
+#line 1600
 
 sub _my_exit {
     $? = $_[0];
@@ -1015,7 +1037,7 @@
 }
 
 
-#line 1575
+#line 1613
 
 $SIG{__DIE__} = sub {
     # We don't want to muck with death in an eval, but $^S isn't
@@ -1135,6 +1157,6 @@
     $Test->_ending if defined $Test and !$Test->no_ending;
 }
 
-#line 1747
+#line 1788
 
 1;

Modified: packages/libpar-perl/trunk/inc/Test/Builder/Module.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libpar-perl/trunk/inc/Test/Builder/Module.pm?rev=5348&op=diff
==============================================================================
--- packages/libpar-perl/trunk/inc/Test/Builder/Module.pm (original)
+++ packages/libpar-perl/trunk/inc/Test/Builder/Module.pm Fri May  4 09:40:38 2007
@@ -6,7 +6,7 @@
 require Exporter;
 @ISA = qw(Exporter);
 
-$VERSION = '0.03';
+$VERSION = '0.05';
 
 use strict;
 

Modified: packages/libpar-perl/trunk/inc/Test/More.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libpar-perl/trunk/inc/Test/More.pm?rev=5348&op=diff
==============================================================================
--- packages/libpar-perl/trunk/inc/Test/More.pm (original)
+++ packages/libpar-perl/trunk/inc/Test/More.pm Fri May  4 09:40:38 2007
@@ -17,7 +17,7 @@
 
 
 use vars qw($VERSION @ISA @EXPORT %EXPORT_TAGS $TODO);
-$VERSION = '0.64';
+$VERSION = '0.66';
 $VERSION = eval $VERSION;    # make the alpha version come out as a number
 
 use Test::Builder::Module;
@@ -332,21 +332,21 @@
 	return $tb->ok(0);
     }
 
-    my($this, $that, $name) = @_;
-
-    $tb->_unoverload_str(\$that, \$this);
+    my($got, $expected, $name) = @_;
+
+    $tb->_unoverload_str(\$expected, \$got);
 
     my $ok;
-    if( !ref $this and !ref $that ) {  		# neither is a reference
-        $ok = $tb->is_eq($this, $that, $name);
-    }
-    elsif( !ref $this xor !ref $that ) {  	# one's a reference, one isn't
+    if( !ref $got and !ref $expected ) {  		# neither is a reference
+        $ok = $tb->is_eq($got, $expected, $name);
+    }
+    elsif( !ref $got xor !ref $expected ) {  	# one's a reference, one isn't
         $ok = $tb->ok(0, $name);
-	$tb->diag( _format_stack({ vals => [ $this, $that ] }) );
+	$tb->diag( _format_stack({ vals => [ $got, $expected ] }) );
     }
     else {			       		# both references
         local @Data_Stack = ();
-        if( _deep_check($this, $that) ) {
+        if( _deep_check($got, $expected) ) {
             $ok = $tb->ok(1, $name);
         }
         else {
@@ -663,6 +663,6 @@
     );
 }
 
-#line 1545
+#line 1547
 
 1;

Modified: packages/libpar-perl/trunk/lib/PAR.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libpar-perl/trunk/lib/PAR.pm?rev=5348&op=diff
==============================================================================
--- packages/libpar-perl/trunk/lib/PAR.pm (original)
+++ packages/libpar-perl/trunk/lib/PAR.pm Fri May  4 09:40:38 2007
@@ -1,5 +1,5 @@
 package PAR;
-$PAR::VERSION = '0.970';
+$PAR::VERSION = '0.973';
 
 use 5.006;
 use strict;
@@ -7,19 +7,36 @@
 use Config '%Config';
 use Carp qw/croak/;
 
+# If the 'prefork' module is available, we
+# register various run-time loaded modules with it.
+# That way, there is more shared memory in a forking
+# environment.
+BEGIN {
+    if (eval 'require prefork') {
+        prefork->import($_) for qw/
+            Archive::Zip
+            File::Glob
+            File::Spec
+            File::Temp
+            LWP::Simple
+            PAR::Heavy
+        /;
+    }
+}
+
 =head1 NAME
 
 PAR - Perl Archive Toolkit
 
 =head1 VERSION
 
-This document describes version 0.970 of PAR, released December  3, 2006.
+This document describes version 0.972 of PAR, released January 16, 2007.
 
 =head1 SYNOPSIS
 
 (If you want to make an executable that contains all module, scripts and
 data files, please consult the L<pp> utility instead. L<pp> used to be
-part of the PAR distribution but is not shipped as part of the L<PAR::Packer>
+part of the PAR distribution but is now shipped as part of the L<PAR::Packer>
 distribution instead.)
 
 Following examples assume a F<foo.par> file in Zip format.
@@ -98,7 +115,7 @@
 you can defer this to runtime: (otherwise equivalent)
 
     require PAR;
-    PAR->import( { file => 'foo.par', run => 'myscript' };
+    PAR->import( { file => 'foo.par', run => 'myscript' } );
 
 If you have L<PAR::Repository::Client> installed, you can do this:
 
@@ -233,6 +250,47 @@
 that causes trouble, you can turn this off by setting the
 environment variable C<PAR_VERBATIM> to C<1>.
 
+=head2 import options
+
+When you "use PAR {...}" or call PAR->import({...}), the following
+options are available.
+
+  PAR->import({ file => 'foo.par' });
+  # or
+  PAR->import({ repository => 'http://foo/bar/' });
+
+=over
+
+=item file
+
+The par filename.
+
+You must pass I<one> option of either 'file' or 'repository'.
+
+=item repository
+
+A par repository (exclusive of file)
+
+=item fallback
+
+Search the system @INC before the par.
+
+=item run
+
+The name of a script to run in the par.  Exits when done.
+
+=item no_shlib_unpack
+
+Skip unpacking bundled dynamic libraries from shlib/$archname.  The
+client may have them installed, or you may wish to cache them yourself.
+In either case, they must end up in the standard install location (such
+as /usr/local/lib/) or in $ENV{PAR_TEMP} I<before> you require the
+module which needs them.  If they are not accessible before you require
+the dependent module, perl will die with a message such as "cannot open
+shared object file..." 
+
+=back
+
 =cut
 
 use vars qw(@PAR_INC);              # explicitly stated PAR library files (prefered)
@@ -242,6 +300,9 @@
 use vars qw($LastAccessedPAR $LastTempFile);
 use vars qw(@RepositoryObjects);    # If we have PAR::Repository::Client support, we
                                     # put the ::Client objects in here.
+use vars qw(%FileCache);            # The Zip-file file-name-cache
+                                    # Layout:
+                                    # $FileCache{$ZipObj}{$FileName} = $Member
 
 my $ver  = $Config{version};
 my $arch = $Config{archname};
@@ -253,6 +314,8 @@
 );
 my $par_temp;
 
+# lexical for import(), and _import_foo() functions to control unpar()
+my %unpar_options;
 
 # called on "use PAR"
 sub import {
@@ -346,6 +409,10 @@
 # import() helper for the "use PAR {...};" syntax.
 sub _import_hash_ref {
     my $opt = shift;
+
+    # hash slice assignment -- pass all of the options into unpar
+    local @unpar_options{keys(%$opt)} = values(%$opt);
+
     # check for incompatible options:
     if ( exists $opt->{repository} and exists $opt->{file} ) {
         croak("Invalid PAR loading options. Cannot have a 'repository' and 'file' option at the same time.");
@@ -452,14 +519,15 @@
     return $obj;
 }
 
+# Given an Archive::Zip obj and a list of files/paths,
+# this function returns the Archive::Zip::Member for the
+# first of the files found in the ZIP. If none is found,
+# returns the empty list.
 sub _first_member {
     my $zip = shift;
-    my %names = map { ( $_->fileName => $_ ) } $zip->members;
-    my %lc_names;
-    %lc_names = map { ( lc($_->fileName) => $_ ) } $zip->members if $is_insensitive_fs;
     foreach my $name (@_) {
-        return $names{$name} if $names{$name};
-        return $lc_names{lc($name)} if $is_insensitive_fs and $lc_names{lc($name)};
+        my $member = _cached_member_named($zip, $name);
+        return $member if $member;
     }
     return;
 }
@@ -493,6 +561,12 @@
 sub _extract_inc {
     my $file = shift;
     my $inc = "$par_temp/inc";
+    # FIXME: What the hell is the following code doing?
+    # There is a "use Config '%Config'" at the top of PAR.pm
+    # I'll probably replace it by
+    # my $dlext = defined($Config{dlext}) ? $Config{dlext} : '';
+    # eventually!
+    # -- Steffen
     my $dlext = do {
         require Config;
         (defined %Config::Config) ? $Config::Config{dlext} : '';
@@ -596,6 +670,7 @@
     foreach my $par (@par_files) {
         my $inc_ref = $PAR_INC{$par} or next;
         delete $LibCache{$par};
+        delete $FileCache{$par};
         foreach my $file (sort keys %$inc_ref) {
             delete $INC{$file};
             require $file;
@@ -626,10 +701,12 @@
     my $zip = $LibCache{$par};
     my @rv = $par;
 
+    # a guard against (currently unimplemented) recursion
     return if $PAR::__unpar;
     local $PAR::__unpar = 1;
 
     unless ($zip) {
+        # URL use case ==> download
         if ($par =~ m!^\w+://!) {
             require File::Spec;
             require LWP::Simple;
@@ -637,6 +714,7 @@
             # reflector support
             $par .= "pm=$file" if $par =~ /[?&;]/;
 
+            # prepare cache directory
             $ENV{PAR_CACHE} ||= '_par';
             mkdir $ENV{PAR_CACHE}, 0777;
             if (!-d $ENV{PAR_CACHE}) {
@@ -645,6 +723,12 @@
                 return unless -d $ENV{PAR_CACHE};
             }
 
+            # Munge URL into local file name
+            # FIXME: This might result in unbelievably long file names!
+            # I have run into the file/path length limitations of linux
+            # with similar code in PAR::Repository::Client.
+            # I suspect this is even worse on Win32.
+            # -- Steffen
             my $file = $par;
             if (!%escapes) {
                 $escapes{chr($_)} = sprintf("%%%02X", $_) for 0..255;
@@ -653,16 +737,20 @@
                 use bytes;
                 $file =~ s/([^\w\.])/$escapes{$1}/g;
             }
+
             $file = File::Spec->catfile( $ENV{PAR_CACHE}, $file);
             LWP::Simple::mirror( $par, $file );
-            return unless -e $file;
+            return unless -e $file and -f _;
             $par = $file;
         }
+        # Got the .par as a string. (reference to scalar, of course)
         elsif (ref($par) eq 'SCALAR') {
             my ($fh) = _tempfile();
             print $fh $$par;
             $par = $fh;
         }
+        # If the par is not a valid .par file name and we're being strict
+        # about this, then also check whether "$par.par" exists
         elsif (!(($allow_other_ext or $par =~ /\.par\z/i) and -f $par)) {
             $par .= ".par";
             return unless -f $par;
@@ -689,8 +777,10 @@
 
         push @LibCache, $zip;
         $LibCache{$_[0]} = $zip;
-
-        foreach my $member ( $zip->membersMatching(
+        $FileCache{$_[0]} = _make_file_cache($zip);
+
+        # only recursive case -- appears to be unused and unimplemented
+        foreach my $member ( _cached_members_matching($zip, 
             "^par/(?:$Config{version}/)?(?:$Config{archname}/)?"
         ) ) {
             next if $member->isDirectory;
@@ -699,24 +789,32 @@
             push @rv, unpar(\$content, undef, undef, 1);
         }
         
-        # extract all dlls from the .par to $ENV{PAR_TEMP}!
-        # XXX is this correct?
+        # extract all shlib dlls from the .par to $ENV{PAR_TEMP}
         # Intended to fix problem with Alien::wxWidgets/Wx...
-        # for all zip members that end in .dll/.so (depending on platform)
-        foreach my $member ( $zip->membersMatching(
-            '\.'.quotemeta($Config{dlext}).'$'
-        ) ) {
-            next if $member->isDirectory or !$ENV{PAR_TEMP};
-            my $member_name = $member->fileName;
-            next unless $member_name =~ m{
-                    \/([^/]+)$
-                }x
-                or $member_name =~ m{
-                    ^([^/]+)$
-                };
-            my $extract_name = $1;
-            my $dest_name = File::Spec->catfile($ENV{PAR_TEMP}, $extract_name);
-            $member->extractToFileNamed($dest_name);
+        # NOTE auto/foo/foo.so|dll will get handled by the dynaloader
+        # hook, so no need to pull it out here.
+        # Allow this to be disabled so caller can do their own caching
+        # via import({no_shlib_unpack => 1, file => foo.par})
+        unless($unpar_options{no_shlib_unpack}) {
+            my @members = _cached_members_matching( $zip,
+              qr#^shlib/$Config{archname}/.*\.\Q$Config{dlext}\E(?:\.|$)#
+            );
+            foreach my $member (@members) {
+                next if $member->isDirectory or !$ENV{PAR_TEMP};
+                my $member_name = $member->fileName;
+                next unless $member_name =~ m{
+                        \/([^/]+)$
+                    }x
+                    or $member_name =~ m{
+                        ^([^/]+)$
+                    };
+                my $extract_name = $1;
+                my $dest_name =
+                    File::Spec->catfile($ENV{PAR_TEMP}, $extract_name);
+                # but don't extract it if we've already got one
+                $member->extractToFileNamed($dest_name)
+                    unless(-e $dest_name);
+            }
         }
 
         # Now push this path into usual library search paths
@@ -902,7 +1000,58 @@
 }
 
 
+# Given an Archive::Zip object, this generates a hash of
+#   file_name_in_zip => file object
+# and returns a reference to that.
+# If we broke the encapsulation of A::Zip::Member and
+# accessed $member->{fileName} directly, that would be
+# *significantly* faster.
+sub _make_file_cache {
+    my $zip = shift;
+    if (not ref($zip)) {
+        croak("_make_file_cache needs an Archive::Zip object as argument.");
+    }
+    my $cache = {};
+    foreach my $member ($zip->members) {
+        $cache->{$member->fileName()} = $member;
+    }
+    return $cache;
+}
+
+# given an Archive::Zip object, this finds the cached hash
+# of Archive::Zip member names => members,
+# and returns all member objects whose file names match
+# a regexp
+# Without file caching, it just uses $zip->membersMatching
+sub _cached_members_matching {
+    my $zip = shift;
+    my $regex = shift;
+
+    my $cache = $FileCache{$zip};
+    $cache = $FileCache{$zip} = _make_file_cache($zip) if not $cache;
+
+    return map {$cache->{$_}}
+        grep { $_ =~ $regex }
+        keys %$cache;
+}
+
+# access named zip file member through cache. Fall
+# back to using Archive::Zip (slow)
+sub _cached_member_named {
+    my $zip = shift;
+    my $name = shift;
+
+    my $cache = $FileCache{$zip};
+    $cache = $FileCache{$zip} = _make_file_cache($zip) if not $cache;
+    return $cache->{$name};
+}
+
+
+
+
 1;
+
+__END__
 
 =head1 SEE ALSO
 
@@ -922,6 +1071,10 @@
 L<Archive::Zip>, L<perlfunc/require>
 
 L<ex::lib::zip>, L<Acme::use::strict::with::pride>
+
+PAR supports the L<prefork> module. It declares various run-time
+dependencies so you can use the L<prefork> module to get streamlined
+processes in a forking environment.
 
 =head1 ACKNOWLEDGMENTS
 
@@ -954,7 +1107,7 @@
 
 =head1 COPYRIGHT
 
-Copyright 2002, 2003, 2004, 2005, 2006 by Audrey Tang
+Copyright 2002-2007 by Audrey Tang
 E<lt>cpan at audreyt.orgE<gt>.
 
 This program is free software; you can redistribute it and/or modify it

Modified: packages/libpar-perl/trunk/lib/PAR/Heavy.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libpar-perl/trunk/lib/PAR/Heavy.pm?rev=5348&op=diff
==============================================================================
--- packages/libpar-perl/trunk/lib/PAR/Heavy.pm (original)
+++ packages/libpar-perl/trunk/lib/PAR/Heavy.pm Fri May  4 09:40:38 2007
@@ -68,6 +68,7 @@
     }
 
     # XXX: Multi-platform .dll support in PARs needs better than $Config.
+    # FIXME: Config is always loaded by PAR.pm!
     $dlext ||= do {
         require Config;
         (defined %Config::Config) ? $Config::Config{dlext} : '';




More information about the Pkg-perl-cvs-commits mailing list