r33692 - in /trunk/libpar-perl: ./ debian/ inc/Module/ inc/Module/Install/ lib/ t/

eloy at users.alioth.debian.org eloy at users.alioth.debian.org
Wed Apr 22 08:29:37 UTC 2009


Author: eloy
Date: Wed Apr 22 08:29:32 2009
New Revision: 33692

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

Added:
    trunk/libpar-perl/t/60-cleanup.t
      - copied unchanged from r33691, branches/upstream/libpar-perl/current/t/60-cleanup.t
Modified:
    trunk/libpar-perl/ChangeLog
    trunk/libpar-perl/MANIFEST
    trunk/libpar-perl/META.yml
    trunk/libpar-perl/Makefile.PL
    trunk/libpar-perl/debian/changelog
    trunk/libpar-perl/inc/Module/Install.pm
    trunk/libpar-perl/inc/Module/Install/Base.pm
    trunk/libpar-perl/inc/Module/Install/Can.pm
    trunk/libpar-perl/inc/Module/Install/Fetch.pm
    trunk/libpar-perl/inc/Module/Install/Include.pm
    trunk/libpar-perl/inc/Module/Install/Makefile.pm
    trunk/libpar-perl/inc/Module/Install/Metadata.pm
    trunk/libpar-perl/inc/Module/Install/Win32.pm
    trunk/libpar-perl/inc/Module/Install/WriteAll.pm
    trunk/libpar-perl/lib/PAR.pm

Modified: trunk/libpar-perl/ChangeLog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpar-perl/ChangeLog?rev=33692&op=diff
==============================================================================
--- trunk/libpar-perl/ChangeLog (original)
+++ trunk/libpar-perl/ChangeLog Wed Apr 22 08:29:32 2009
@@ -1,3 +1,5 @@
+[Changes for 0.992 - Apr  5, 2009]
+  - Support for non-fallback repositories.
 
 [Changes for 0.991 - Mar 10, 2009]
   - Promote previous release to stable release.

Modified: trunk/libpar-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpar-perl/MANIFEST?rev=33692&op=diff
==============================================================================
--- trunk/libpar-perl/MANIFEST (original)
+++ trunk/libpar-perl/MANIFEST Wed Apr 22 08:29:32 2009
@@ -29,6 +29,7 @@
 t/01-basic.t
 t/40-par-hashref.t
 t/50-autoloaderfix.t
+t/60-cleanup.t
 t/hello.par
 t/Hello.pm
 TODO

Modified: trunk/libpar-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpar-perl/META.yml?rev=33692&op=diff
==============================================================================
--- trunk/libpar-perl/META.yml (original)
+++ trunk/libpar-perl/META.yml Wed Apr 22 08:29:32 2009
@@ -2,8 +2,10 @@
 abstract: 'Perl Archive Tookit'
 author:
   - 'Audrey Tang <cpan at audreyt.org>'
+configure_requires:
+  ExtUtils::MakeMaker: 6.50
 distribution_type: module
-generated_by: 'Module::Install version 0.79'
+generated_by: 'Module::Install version 0.81'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -16,7 +18,7 @@
 provides:
   PAR:
     file: lib/PAR.pm
-    version: 0.991
+    version: 0.992
   PAR::Heavy:
     file: lib/PAR/Heavy.pm
     version: 0.11
@@ -35,4 +37,4 @@
   perl: 5.6.0
 resources:
   license: http://dev.perl.org/licenses/
-version: 0.991
+version: 0.992

Modified: trunk/libpar-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpar-perl/Makefile.PL?rev=33692&op=diff
==============================================================================
--- trunk/libpar-perl/Makefile.PL (original)
+++ trunk/libpar-perl/Makefile.PL Wed Apr 22 08:29:32 2009
@@ -32,4 +32,4 @@
 no_index            directory => 'contrib';
 auto_provides;
 
-WriteAll sign => 1;
+WriteAll sign => 0;

Modified: trunk/libpar-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpar-perl/debian/changelog?rev=33692&op=diff
==============================================================================
--- trunk/libpar-perl/debian/changelog (original)
+++ trunk/libpar-perl/debian/changelog Wed Apr 22 08:29:32 2009
@@ -1,8 +1,12 @@
-libpar-perl (0.991-2) UNRELEASED; urgency=low
-
+libpar-perl (0.992-1) UNRELEASED; urgency=low
+
+  [ Krzysztof Krzyżaniak (eloy) ]
+  * (NOT RELEASED YET) New upstream release
+
+  [ gregor herrmann ]
   * Remove Florian Ragwitz from Uploaders (closes: #523283).
-
- -- gregor herrmann <gregoa at debian.org>  Thu, 09 Apr 2009 15:55:11 +0200
+  
+ -- Krzysztof Krzyżaniak (eloy) <eloy at debian.org>  Wed, 22 Apr 2009 10:26:53 +0200
 
 libpar-perl (0.991-1) unstable; urgency=low
 

Modified: trunk/libpar-perl/inc/Module/Install.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpar-perl/inc/Module/Install.pm?rev=33692&op=diff
==============================================================================
--- trunk/libpar-perl/inc/Module/Install.pm (original)
+++ trunk/libpar-perl/inc/Module/Install.pm Wed Apr 22 08:29:32 2009
@@ -30,7 +30,7 @@
 	# This is not enforced yet, but will be some time in the next few
 	# releases once we can make sure it won't clash with custom
 	# Module::Install extensions.
-	$VERSION = '0.79';
+	$VERSION = '0.81';
 
 	*inc::Module::Install::VERSION = *VERSION;
 	@inc::Module::Install::ISA     = __PACKAGE__;
@@ -69,16 +69,26 @@
 # again. This is bad. Rather than taking action to touch it (which
 # is unreliable on some platforms and requires write permissions)
 # for now we should catch this and refuse to run.
-if ( -f $0 and (stat($0))[9] > time ) { die <<"END_DIE" }
-
-Your installer $0 has a modification time in the future.
+if ( -f $0 ) {
+	my $s = (stat($0))[9];
+
+	# If the modification time is only slightly in the future,
+	# sleep briefly to remove the problem.
+	my $a = $s - time;
+	if ( $a > 0 and $a < 5 ) { sleep 5 }
+
+	# Too far in the future, throw an error.
+	my $t = time;
+	if ( $s > $t ) { die <<"END_DIE" }
+
+Your installer $0 has a modification time in the future ($s > $t).
 
 This is known to create infinite loops in make.
 
 Please correct this, then run $0 again.
 
 END_DIE
-
+}
 
 
 
@@ -314,7 +324,7 @@
 
 
 #####################################################################
-# Utility Functions
+# Common Utility Functions
 
 sub _caller {
 	my $depth = 0;
@@ -328,29 +338,68 @@
 
 sub _read {
 	local *FH;
-	open FH, "< $_[0]" or die "open($_[0]): $!";
-	my $str = do { local $/; <FH> };
+	if ( $] >= 5.006 ) {
+		open( FH, '<', $_[0] ) or die "open($_[0]): $!";
+	} else {
+		open( FH, "< $_[0]"  ) or die "open($_[0]): $!";	
+	}
+	my $string = do { local $/; <FH> };
 	close FH or die "close($_[0]): $!";
-	return $str;
+	return $string;
+}
+
+sub _readperl {
+	my $string = Module::Install::_read($_[0]);
+	$string =~ s/(?:\015{1,2}\012|\015|\012)/\n/sg;
+	$string =~ s/(\n)\n*__(?:DATA|END)__\b.*\z/$1/s;
+	$string =~ s/\n\n=\w+.+?\n\n=cut\b.+?\n+/\n\n/sg;
+	return $string;
+}
+
+sub _readpod {
+	my $string = Module::Install::_read($_[0]);
+	$string =~ s/(?:\015{1,2}\012|\015|\012)/\n/sg;
+	return $string if $_[0] =~ /\.pod\z/;
+	$string =~ s/(^|\n=cut\b.+?\n+)[^=\s].+?\n(\n=\w+|\z)/$1$2/sg;
+	$string =~ s/\n*=pod\b[^\n]*\n+/\n\n/sg;
+	$string =~ s/\n*=cut\b[^\n]*\n+/\n\n/sg;
+	$string =~ s/^\n+//s;
+	return $string;
 }
 
 sub _write {
 	local *FH;
-	open FH, "> $_[0]" or die "open($_[0]): $!";
-	foreach ( 1 .. $#_ ) { print FH $_[$_] or die "print($_[0]): $!" }
+	if ( $] >= 5.006 ) {
+		open( FH, '>', $_[0] ) or die "open($_[0]): $!";
+	} else {
+		open( FH, "> $_[0]"  ) or die "open($_[0]): $!";	
+	}
+	foreach ( 1 .. $#_ ) {
+		print FH $_[$_] or die "print($_[0]): $!";
+	}
 	close FH or die "close($_[0]): $!";
 }
 
 # _version is for processing module versions (eg, 1.03_05) not
 # Perl versions (eg, 5.8.1).
-
 sub _version ($) {
 	my $s = shift || 0;
-	   $s =~ s/^(\d+)\.?//;
+	my $d =()= $s =~ /(\.)/g;
+	if ( $d >= 2 ) {
+		# Normalise multipart versions
+		$s =~ s/(\.)(\d{1,3})/sprintf("$1%03d",$2)/eg;
+	}
+	$s =~ s/^(\d+)\.?//;
 	my $l = $1 || 0;
-	my @v = map { $_ . '0' x (3 - length $_) } $s =~ /(\d{1,3})\D?/g;
-	   $l = $l . '.' . join '', @v if @v;
+	my @v = map {
+		$_ . '0' x (3 - length $_)
+	} $s =~ /(\d{1,3})\D?/g;
+	$l = $l . '.' . join '', @v if @v;
 	return $l + 0;
+}
+
+sub _cmp ($$) {
+	_version($_[0]) <=> _version($_[1]);
 }
 
 # Cloned from Params::Util::_CLASS
@@ -360,7 +409,7 @@
 		and
 		! ref $_[0]
 		and
-		$_[0] =~ m/^[^\W\d]\w*(?:::\w+)*$/s
+		$_[0] =~ m/^[^\W\d]\w*(?:::\w+)*\z/s
 	) ? $_[0] : undef;
 }
 

Modified: trunk/libpar-perl/inc/Module/Install/Base.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpar-perl/inc/Module/Install/Base.pm?rev=33692&op=diff
==============================================================================
--- trunk/libpar-perl/inc/Module/Install/Base.pm (original)
+++ trunk/libpar-perl/inc/Module/Install/Base.pm Wed Apr 22 08:29:32 2009
@@ -1,7 +1,7 @@
 #line 1
 package Module::Install::Base;
 
-$VERSION = '0.79';
+$VERSION = '0.81';
 
 # Suspend handler for "redefined" warnings
 BEGIN {

Modified: trunk/libpar-perl/inc/Module/Install/Can.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpar-perl/inc/Module/Install/Can.pm?rev=33692&op=diff
==============================================================================
--- trunk/libpar-perl/inc/Module/Install/Can.pm (original)
+++ trunk/libpar-perl/inc/Module/Install/Can.pm Wed Apr 22 08:29:32 2009
@@ -3,15 +3,13 @@
 
 use strict;
 use Module::Install::Base;
-use Config ();
-### This adds a 5.005 Perl version dependency.
-### This is a bug and will be fixed.
-use File::Spec ();
+use Config              ();
+use File::Spec          ();
 use ExtUtils::MakeMaker ();
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.79';
+	$VERSION = '0.81';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }
@@ -80,4 +78,4 @@
 
 __END__
 
-#line 158
+#line 156

Modified: trunk/libpar-perl/inc/Module/Install/Fetch.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpar-perl/inc/Module/Install/Fetch.pm?rev=33692&op=diff
==============================================================================
--- trunk/libpar-perl/inc/Module/Install/Fetch.pm (original)
+++ trunk/libpar-perl/inc/Module/Install/Fetch.pm Wed Apr 22 08:29:32 2009
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.79';
+	$VERSION = '0.81';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }

Modified: trunk/libpar-perl/inc/Module/Install/Include.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpar-perl/inc/Module/Install/Include.pm?rev=33692&op=diff
==============================================================================
--- trunk/libpar-perl/inc/Module/Install/Include.pm (original)
+++ trunk/libpar-perl/inc/Module/Install/Include.pm Wed Apr 22 08:29:32 2009
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.79';
+	$VERSION = '0.81';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }

Modified: trunk/libpar-perl/inc/Module/Install/Makefile.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpar-perl/inc/Module/Install/Makefile.pm?rev=33692&op=diff
==============================================================================
--- trunk/libpar-perl/inc/Module/Install/Makefile.pm (original)
+++ trunk/libpar-perl/inc/Module/Install/Makefile.pm Wed Apr 22 08:29:32 2009
@@ -7,7 +7,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.79';
+	$VERSION = '0.81';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }

Modified: trunk/libpar-perl/inc/Module/Install/Metadata.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpar-perl/inc/Module/Install/Metadata.pm?rev=33692&op=diff
==============================================================================
--- trunk/libpar-perl/inc/Module/Install/Metadata.pm (original)
+++ trunk/libpar-perl/inc/Module/Install/Metadata.pm Wed Apr 22 08:29:32 2009
@@ -4,12 +4,17 @@
 use strict 'vars';
 use Module::Install::Base;
 
-use vars qw{$VERSION $ISCORE @ISA};
+use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.79';
+	$VERSION = '0.81';
+	@ISA     = qw{Module::Install::Base};
 	$ISCORE  = 1;
-	@ISA     = qw{Module::Install::Base};
-}
+}
+
+my @boolean_keys = qw{
+	sign
+	mymeta
+};
 
 my @scalar_keys = qw{
 	name
@@ -37,16 +42,43 @@
 	repository
 };
 
+my @array_keys = qw{
+	keywords
+};
+
 sub Meta              { shift          }
+sub Meta_BooleanKeys  { @boolean_keys  }
 sub Meta_ScalarKeys   { @scalar_keys   }
 sub Meta_TupleKeys    { @tuple_keys    }
 sub Meta_ResourceKeys { @resource_keys }
+sub Meta_ArrayKeys    { @array_keys    }
+
+foreach my $key ( @boolean_keys ) {
+	*$key = sub {
+		my $self = shift;
+		if ( defined wantarray and not @_ ) {
+			return $self->{values}->{$key};
+		}
+		$self->{values}->{$key} = ( @_ ? $_[0] : 1 );
+		return $self;
+	};
+}
 
 foreach my $key ( @scalar_keys ) {
 	*$key = sub {
 		my $self = shift;
-		return $self->{values}{$key} if defined wantarray and !@_;
-		$self->{values}{$key} = shift;
+		return $self->{values}->{$key} if defined wantarray and !@_;
+		$self->{values}->{$key} = shift;
+		return $self;
+	};
+}
+
+foreach my $key ( @array_keys ) {
+	*$key = sub {
+		my $self = shift;
+		return $self->{values}->{$key} if defined wantarray and !@_;
+		$self->{values}->{$key} ||= [];
+		push @{$self->{values}->{$key}}, @_;
 		return $self;
 	};
 }
@@ -55,12 +87,12 @@
 	*$key = sub {
 		my $self = shift;
 		unless ( @_ ) {
-			return () unless $self->{values}{resources};
+			return () unless $self->{values}->{resources};
 			return map  { $_->[1] }
 			       grep { $_->[0] eq $key }
-			       @{ $self->{values}{resources} };
-		}
-		return $self->{values}{resources}{$key} unless @_;
+			       @{ $self->{values}->{resources} };
+		}
+		return $self->{values}->{resources}->{$key} unless @_;
 		my $uri = shift or die(
 			"Did not provide a value to $key()"
 		);
@@ -69,54 +101,19 @@
 	};
 }
 
-sub requires {
-	my $self = shift;
-	while ( @_ ) {
-		my $module  = shift or last;
-		my $version = shift || 0;
-		push @{ $self->{values}{requires} }, [ $module, $version ];
-	}
-	$self->{values}{requires};
-}
-
-sub build_requires {
-	my $self = shift;
-	while ( @_ ) {
-		my $module  = shift or last;
-		my $version = shift || 0;
-		push @{ $self->{values}{build_requires} }, [ $module, $version ];
-	}
-	$self->{values}{build_requires};
-}
-
-sub configure_requires {
-	my $self = shift;
-	while ( @_ ) {
-		my $module  = shift or last;
-		my $version = shift || 0;
-		push @{ $self->{values}{configure_requires} }, [ $module, $version ];
-	}
-	$self->{values}{configure_requires};
-}
-
-sub recommends {
-	my $self = shift;
-	while ( @_ ) {
-		my $module  = shift or last;
-		my $version = shift || 0;
-		push @{ $self->{values}{recommends} }, [ $module, $version ];
-	}
-	$self->{values}{recommends};
-}
-
-sub bundles {
-	my $self = shift;
-	while ( @_ ) {
-		my $module  = shift or last;
-		my $version = shift || 0;
-		push @{ $self->{values}{bundles} }, [ $module, $version ];
-	}
-	$self->{values}{bundles};
+foreach my $key ( grep { $_ ne "resources" } @tuple_keys) {
+	*$key = sub {
+		my $self = shift;
+		return $self->{values}->{$key} unless @_;
+		my @added;
+		while ( @_ ) {
+			my $module  = shift or last;
+			my $version = shift || 0;
+			push @added, [ $module, $version ];
+		}
+		push @{ $self->{values}->{$key} }, @added;
+		return map {@$_} @added;
+	};
 }
 
 # Resource handling
@@ -135,29 +132,22 @@
 		if ( $name eq lc $name and ! $lc_resource{$name} ) {
 			die("Unsupported reserved lowercase resource '$name'");
 		}
-		$self->{values}{resources} ||= [];
-		push @{ $self->{values}{resources} }, [ $name, $value ];
-	}
-	$self->{values}{resources};
+		$self->{values}->{resources} ||= [];
+		push @{ $self->{values}->{resources} }, [ $name, $value ];
+	}
+	$self->{values}->{resources};
 }
 
 # Aliases for build_requires that will have alternative
 # meanings in some future version of META.yml.
-sub test_requires      { shift->build_requires(@_) }
-sub install_requires   { shift->build_requires(@_) }
+sub test_requires     { shift->build_requires(@_) }
+sub install_requires  { shift->build_requires(@_) }
 
 # Aliases for installdirs options
-sub install_as_core    { $_[0]->installdirs('perl')   }
-sub install_as_cpan    { $_[0]->installdirs('site')   }
-sub install_as_site    { $_[0]->installdirs('site')   }
-sub install_as_vendor  { $_[0]->installdirs('vendor') }
-
-sub sign {
-	my $self = shift;
-	return $self->{values}{sign} if defined wantarray and ! @_;
-	$self->{values}{sign} = ( @_ ? $_[0] : 1 );
-	return $self;
-}
+sub install_as_core   { $_[0]->installdirs('perl')   }
+sub install_as_cpan   { $_[0]->installdirs('site')   }
+sub install_as_site   { $_[0]->installdirs('site')   }
+sub install_as_vendor { $_[0]->installdirs('vendor') }
 
 sub dynamic_config {
 	my $self = shift;
@@ -165,13 +155,13 @@
 		warn "You MUST provide an explicit true/false value to dynamic_config\n";
 		return $self;
 	}
-	$self->{values}{dynamic_config} = $_[0] ? 1 : 0;
+	$self->{values}->{dynamic_config} = $_[0] ? 1 : 0;
 	return 1;
 }
 
 sub perl_version {
 	my $self = shift;
-	return $self->{values}{perl_version} unless @_;
+	return $self->{values}->{perl_version} unless @_;
 	my $version = shift or die(
 		"Did not provide a value to perl_version()"
 	);
@@ -184,20 +174,41 @@
 		die "Module::Install only supports 5.005 or newer (use ExtUtils::MakeMaker)\n";
 	}
 
-	$self->{values}{perl_version} = $version;
-}
+	$self->{values}->{perl_version} = $version;
+}
+
+#Stolen from M::B
+my %license_urls = (
+    perl         => 'http://dev.perl.org/licenses/',
+    apache       => 'http://apache.org/licenses/LICENSE-2.0',
+    artistic     => 'http://opensource.org/licenses/artistic-license.php',
+    artistic_2   => 'http://opensource.org/licenses/artistic-license-2.0.php',
+    lgpl         => 'http://opensource.org/licenses/lgpl-license.php',
+    lgpl2        => 'http://opensource.org/licenses/lgpl-2.1.php',
+    lgpl3        => 'http://opensource.org/licenses/lgpl-3.0.html',
+    bsd          => 'http://opensource.org/licenses/bsd-license.php',
+    gpl          => 'http://opensource.org/licenses/gpl-license.php',
+    gpl2         => 'http://opensource.org/licenses/gpl-2.0.php',
+    gpl3         => 'http://opensource.org/licenses/gpl-3.0.html',
+    mit          => 'http://opensource.org/licenses/mit-license.php',
+    mozilla      => 'http://opensource.org/licenses/mozilla1.1.php',
+    open_source  => undef,
+    unrestricted => undef,
+    restrictive  => undef,
+    unknown      => undef,
+);
 
 sub license {
 	my $self = shift;
-	return $self->{values}{license} unless @_;
+	return $self->{values}->{license} unless @_;
 	my $license = shift or die(
 		'Did not provide a value to license()'
 	);
-	$self->{values}{license} = $license;
+	$self->{values}->{license} = $license;
 
 	# Automatically fill in license URLs
-	if ( $license eq 'perl' ) {
-		$self->resources( license => 'http://dev.perl.org/licenses/' );
+	if ( $license_urls{$license} ) {
+		$self->resources( license => $license_urls{$license} );
 	}
 
 	return 1;
@@ -239,7 +250,7 @@
 
 sub provides {
 	my $self     = shift;
-	my $provides = ( $self->{values}{provides} ||= {} );
+	my $provides = ( $self->{values}->{provides} ||= {} );
 	%$provides = (%$provides, @_) if @_;
 	return $provides;
 }
@@ -268,7 +279,7 @@
 sub feature {
 	my $self     = shift;
 	my $name     = shift;
-	my $features = ( $self->{values}{features} ||= [] );
+	my $features = ( $self->{values}->{features} ||= [] );
 	my $mods;
 
 	if ( @_ == 1 and ref( $_[0] ) ) {
@@ -296,16 +307,16 @@
 	while ( my ( $name, $mods ) = splice( @_, 0, 2 ) ) {
 		$self->feature( $name, @$mods );
 	}
-	return $self->{values}{features}
-		? @{ $self->{values}{features} }
+	return $self->{values}->{features}
+		? @{ $self->{values}->{features} }
 		: ();
 }
 
 sub no_index {
 	my $self = shift;
 	my $type = shift;
-	push @{ $self->{values}{no_index}{$type} }, @_ if $type;
-	return $self->{values}{no_index};
+	push @{ $self->{values}->{no_index}->{$type} }, @_ if $type;
+	return $self->{values}->{no_index};
 }
 
 sub read {
@@ -458,10 +469,18 @@
 	return 'unknown';
 }
 
+sub _extract_bugtracker {
+	my @links   = $_[0] =~ m#L<(\Qhttp://rt.cpan.org/\E[^>]+)>#g;
+	my %links;
+	@links{@links}=();
+	@links=keys %links;
+	return @links;
+}
+
 sub bugtracker_from {
 	my $self    = shift;
 	my $content = Module::Install::_read($_[0]);
-	my @links   = $content =~ m/L\<(http\:\/\/rt\.cpan\.org\/[^>]+)\>/g;
+	my @links   = _extract_bugtracker($content);
 	unless ( @links ) {
 		warn "Cannot determine bugtracker info from $_[0]\n";
 		return 0;
@@ -474,6 +493,17 @@
 	# Set the bugtracker
 	bugtracker( $links[0] );
 	return 1;
+}
+
+sub requires_from {
+	my $self     = shift;
+	my $content  = Module::Install::_readperl($_[0]);
+	my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+([\d\.]+)/mg;
+	while ( @requires ) {
+		my $module  = shift @requires;
+		my $version = shift @requires;
+		$self->requires( $module => $version );
+	}
 }
 
 # Convert triple-part versions (eg, 5.6.1 or 5.8.9) to
@@ -499,7 +529,7 @@
 # MYMETA.yml Support
 
 sub WriteMyMeta {
-	$_[0]->write_mymeta;
+	die "WriteMyMeta has been deprecated";
 }
 
 sub write_mymeta {
@@ -507,6 +537,11 @@
 	
 	# If there's no existing META.yml there is nothing we can do
 	return unless -f 'META.yml';
+
+	# We need YAML::Tiny to write the MYMETA.yml file
+	unless ( eval { require YAML::Tiny; 1; } ) {
+		return 1;
+	}
 
 	# Merge the perl version into the dependencies
 	my $val  = $self->Meta->{values};
@@ -523,7 +558,6 @@
 	}
 
 	# Load the advisory META.yml file
-	require YAML::Tiny;
 	my @yaml = YAML::Tiny::LoadFile('META.yml');
 	my $meta = $yaml[0];
 
@@ -539,7 +573,8 @@
 	}
 
 	# Save as the MYMETA.yml file
-	YAML::Tiny::DumpFile('MYMETA.yml', $meta);
+	print "Writing MYMETA.yml\n";
+	YAML::Tiny::DumpFile('MYMETA.yml', $meta);	
 }
 
 1;

Modified: trunk/libpar-perl/inc/Module/Install/Win32.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpar-perl/inc/Module/Install/Win32.pm?rev=33692&op=diff
==============================================================================
--- trunk/libpar-perl/inc/Module/Install/Win32.pm (original)
+++ trunk/libpar-perl/inc/Module/Install/Win32.pm Wed Apr 22 08:29:32 2009
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.79';
+	$VERSION = '0.81';
 	@ISA     = qw{Module::Install::Base};
 	$ISCORE  = 1;
 }

Modified: trunk/libpar-perl/inc/Module/Install/WriteAll.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpar-perl/inc/Module/Install/WriteAll.pm?rev=33692&op=diff
==============================================================================
--- trunk/libpar-perl/inc/Module/Install/WriteAll.pm (original)
+++ trunk/libpar-perl/inc/Module/Install/WriteAll.pm Wed Apr 22 08:29:32 2009
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.79';
+	$VERSION = '0.81';
 	@ISA     = qw{Module::Install::Base};
 	$ISCORE  = 1;
 }
@@ -22,7 +22,6 @@
 	);
 
 	$self->sign(1)                if $args{sign};
-	$self->Meta->write            if $args{meta};
 	$self->admin->WriteAll(%args) if $self->is_admin;
 
 	$self->check_nmake if $args{check_nmake};
@@ -30,11 +29,22 @@
 		$self->makemaker_args( PL_FILES => {} );
 	}
 
+	# Until ExtUtils::MakeMaker support MYMETA.yml, make sure
+	# we clean it up properly ourself.
+	$self->realclean_files('MYMETA.yml');
+
 	if ( $args{inline} ) {
 		$self->Inline->write;
 	} else {
 		$self->Makefile->write;
 	}
+
+	# The Makefile write process adds a couple of dependencies,
+	# so write the META.yml files after the Makefile.
+	$self->Meta->write        if $args{meta};
+	$self->Meta->write_mymeta if $self->mymeta;
+
+	return 1;
 }
 
 1;

Modified: trunk/libpar-perl/lib/PAR.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpar-perl/lib/PAR.pm?rev=33692&op=diff
==============================================================================
--- trunk/libpar-perl/lib/PAR.pm (original)
+++ trunk/libpar-perl/lib/PAR.pm Wed Apr 22 08:29:32 2009
@@ -1,5 +1,5 @@
 package PAR;
-$PAR::VERSION = '0.991';
+$PAR::VERSION = '0.992';
 
 use 5.006;
 use strict;
@@ -33,10 +33,6 @@
 
 PAR - Perl Archive Toolkit
 
-=head1 VERSION
-
-This document describes release 0.989_01 of PAR, released March 2, 2009.
-
 =head1 SYNOPSIS
 
 (If you want to make an executable that contains all module, scripts and
@@ -285,7 +281,15 @@
 
 =item fallback
 
-Search the system @INC before the par.
+Search the system C<@INC> before the par.
+
+Off by default for loading F<.par> files via C<file => ...>.
+On by default for PAR repositories.
+
+To prefer loading modules from a repository over the locally
+installed modules, you can load the repository as follows:
+
+  use PAR { repository => 'http://foo/bar/', fallback => 0 };
 
 =item run
 
@@ -305,15 +309,16 @@
 
 =cut
 
-use vars qw(@PAR_INC);              # explicitly stated PAR library files (prefered)
+use vars qw(@PAR_INC);              # explicitly stated PAR library files (preferred)
 use vars qw(@PAR_INC_LAST);         # explicitly stated PAR library files (fallback)
 use vars qw(%PAR_INC);              # sets {$par}{$file} for require'd modules
 use vars qw(@LibCache %LibCache);   # I really miss pseudohash.
 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(@UpgradeRepositoryObjects); # If we have PAR::Repository::Client's in upgrade mode
-                                        # put the ::Client objects in here *as well*.
+use vars qw(@PriorityRepositoryObjects); # repositories which are preferred over local stuff
+use vars qw(@UpgradeRepositoryObjects);  # If we have PAR::Repository::Client's in upgrade mode
+                                         # put the ::Client objects in here *as well*.
 use vars qw(%FileCache);            # The Zip-file file-name-cache
                                     # Layout:
                                     # $FileCache{$ZipObj}{$FileName} = $Member
@@ -544,7 +549,11 @@
         );
     }
 
-    push @RepositoryObjects, $obj;
+    if (exists($opt->{fallback}) and not $opt->{fallback}) {
+        push @PriorityRepositoryObjects, $obj; # repository beats local stuff
+    } else {
+        push @RepositoryObjects, $obj; # local stuff beats repository
+    }
     # these are tracked separately so we can check for upgrades early
     push @UpgradeRepositoryObjects, $obj if $opt->{upgrade};
 
@@ -715,7 +724,7 @@
 sub find_par {
     my @args = @_;
 
-    # if there are repositories win upgrade mode, check them
+    # if there are repositories in upgrade mode, check them
     # first. If so, this is expensive, of course!
     if (@UpgradeRepositoryObjects) {
         my $module = $args[1];
@@ -740,8 +749,21 @@
             }
         }
     }
-
-    return _find_par_internals(\@PAR_INC, @args);
+    my $rv = _find_par_internals(\@PAR_INC, @args);
+
+    return $rv if defined $rv or not @PriorityRepositoryObjects;
+
+    # the repositories that are prefered over locally installed modules
+    my $module = $args[1];
+    $module =~ s/\.pm$//;
+    $module =~ s/\//::/g;
+    foreach my $client (@PriorityRepositoryObjects) {
+        my $local_file = $client->get_module($module, 1); # 1 == fallback
+        if ($local_file) {
+            return _find_par_internals([$PAR_INC_LAST[-1]], @args);
+        }
+    }
+    return();
 }
 
 # This is the hook placed in @INC for loading PAR's




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