[Bps-public-commit] Shipwright branch, master, updated. b2f11b255afb5a38e54cbd51cfa7c604f0186571

? sunnavy sunnavy at bestpractical.com
Mon May 10 22:26:57 EDT 2010


The branch, master has been updated
       via  b2f11b255afb5a38e54cbd51cfa7c604f0186571 (commit)
       via  fd7c51bdb4ec6425465ebf7d964e46ad13f1e878 (commit)
       via  2c5c6af56d8ff855c859e9dde2671460346a05e8 (commit)
      from  5b65eefbf426b9dd8a70bfc05fcecad0cd0dd47a (commit)

Summary of changes:
 Changes                           |    7 +++-
 META.yml                          |    5 ++-
 Makefile.PL                       |    1 +
 inc/Module/AutoInstall.pm         |   17 +++++++++-
 inc/Module/Install.pm             |   37 ++++++++++++++++-------
 inc/Module/Install/AutoInstall.pm |    2 +-
 inc/Module/Install/Base.pm        |    2 +-
 inc/Module/Install/Can.pm         |    2 +-
 inc/Module/Install/Fetch.pm       |    2 +-
 inc/Module/Install/Include.pm     |    2 +-
 inc/Module/Install/Makefile.pm    |   58 ++++++++++++++++++++++++++++--------
 inc/Module/Install/Metadata.pm    |   57 +++++++++++++++++++++++++-----------
 inc/Module/Install/Scripts.pm     |    2 +-
 inc/Module/Install/Share.pm       |    2 +-
 inc/Module/Install/Win32.pm       |    2 +-
 inc/Module/Install/WriteAll.pm    |    2 +-
 lib/Shipwright.pm                 |   13 ++++----
 lib/Shipwright/Logger.pm          |    2 +-
 share/bin/shipwright-builder      |   51 +++++++++++++++++++++++++-------
 19 files changed, 191 insertions(+), 75 deletions(-)

- Log -----------------------------------------------------------------
commit 2c5c6af56d8ff855c859e9dde2671460346a05e8
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue May 11 09:34:21 2010 +0800

    tiny tweak

diff --git a/lib/Shipwright/Logger.pm b/lib/Shipwright/Logger.pm
index a975ca5..c1577bf 100644
--- a/lib/Shipwright/Logger.pm
+++ b/lib/Shipwright/Logger.pm
@@ -55,7 +55,7 @@ sub _initialize_log4perl {
         $log_file  = $hash{log_file};
     }
 
-    $log_level = uc $log_level || 'FATAL';
+    $log_level = $log_level ? uc $log_level : 'FATAL';
     $log_file ||= '-';
     my %default = (
         'log4perl.rootLogger'             => "$log_level,File",

commit fd7c51bdb4ec6425465ebf7d964e46ad13f1e878
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue May 11 10:20:51 2010 +0800

    let's use which utility to make shipwright happier in windows

diff --git a/Makefile.PL b/Makefile.PL
index 1c589f5..56bdb55 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -34,6 +34,7 @@ requires 'Archive::Tar' => 0;
 requires 'Archive::Extract' => 0;
 requires 'File::Compare' => 0;
 requires 'File::Path' => 2.07;
+requires 'File::Which' => 0;
 
 no_index( directory => 't' );
 no_index( directory => 'xt' );
diff --git a/lib/Shipwright.pm b/lib/Shipwright.pm
index 06aa254..a2b9ef4 100644
--- a/lib/Shipwright.pm
+++ b/lib/Shipwright.pm
@@ -10,12 +10,13 @@ __PACKAGE__->mk_accessors(qw/backend source build log_level log_file/);
 
 use Shipwright::Logger;
 use File::Spec::Functions qw/catfile tmpdir/;
-
+use Shipwright::Util;
 # strawberry perl's build make is 'dmake'
-$ENV{SHIPWRIGHT_MAKE} ||= $^O =~ /MSWin/ ? 'dmake' : 'make';
-$ENV{SHIPWRIGHT_SVK} ||= 'svk';
-$ENV{SHIPWRIGHT_SVN} ||= 'svn';
-$ENV{SHIPWRIGHT_GIT} ||= 'git';
+use File::Which 'which';
+$ENV{SHIPWRIGHT_MAKE} ||= which('make') || which('dmake') || which( 'nmake' ) || 'make';
+$ENV{SHIPWRIGHT_SVK} ||= which 'svk';
+$ENV{SHIPWRIGHT_SVN} ||= which 'svn';
+$ENV{SHIPWRIGHT_GIT} ||= which 'git';
 $ENV{SHIPWRIGHT_LWP_TIMEOUT} ||= 1200;
 
 $ENV{PERL_MM_USE_DEFAULT} = 1; # always true
@@ -36,7 +37,7 @@ sub new {
         source     => undef,
         @_
     );
-    $args{log_level} = uc $args{log_level} || 'FATAL';
+    $args{log_level} = $args{log_level} ? uc $args{log_level} : 'FATAL';
 
     $args{log_file} = '-' unless $args{log_file};
 
diff --git a/share/bin/shipwright-builder b/share/bin/shipwright-builder
index 27eee0a..8e81a86 100755
--- a/share/bin/shipwright-builder
+++ b/share/bin/shipwright-builder
@@ -4,7 +4,7 @@ use warnings;
 use strict;
 
 use lib 'inc';
-use File::Spec::Functions qw/catfile catdir splitdir rel2abs/;
+use File::Spec::Functions qw/catfile catdir splitdir rel2abs path/;
 use File::Temp qw/tempdir/;
 use File::Copy::Recursive qw/rmove rcopy/;
 use File::Find qw/find/;
@@ -92,7 +92,7 @@ Less commonly needed options:
                 Ex: --with svn=dir:/home/foo/svn
                 'svn' is the dist name, 'dir:/home/foo/svn' is its source code,
                 in the format of a Shipwright source distribution.
-  --make        The path of your make command, default is \$ENV{SHIPWRIGHT_MAKE}' if that's defined, else 'make'
+  --make        The path of your make command, default is \$ENV{SHIPWRIGHT_MAKE}
                 Ex: --make /usr/bin/make
   --branches    Specify the branch of a given package in the vessel you want 
                 to build.
@@ -126,16 +126,12 @@ $args{flags} = {
 $args{with}     = { map { split /=/ } split /\s*,\s*/, $args{with}     || '' };
 $args{branches} = { map { split /=/ } split /\s*,\s*/, $args{branches} || '' };
 
-$args{make} ||= $ENV{SHIPWRIGHT_MAKE};
-unless ( $args{make} ) {
-    if ( is_on_windows() ) {
-        $args{make} ||= 'dmake'; # strawberry perl distribution has dmake.exe
-    }
-    else {
-        $args{make} ||= 'make';
-    }
-}
-
+$args{make} ||=
+     $ENV{SHIPWRIGHT_MAKE}
+  || which('make')
+  || which('dmake')
+  || which('nmake')
+  || 'make';
 
 if ( is_on_windows() ) {
     $args{as} ||= 'MSWin';
@@ -865,3 +861,34 @@ sub is_on_windows {
     return $^O =~ /MSWin/;
 }
 
+my $bin_quote = is_on_windows() ? q{"} : q{'};
+my $bin_ext = $Config{_exe};
+sub which {
+    my $name = shift;
+
+    my $path;
+    eval '$path = `which $name`';
+    chomp $path;
+    if ( !$path ) {
+
+        # fallback to our way
+LINE:
+        for my $dir ( path() ) {
+            my $path = catfile( $dir, $name );
+
+            # XXX  any other names need to try?
+            my @try = grep { -x } ( $path, $path .= $bin_ext );
+            for my $try (@try) {
+                $path = $try;
+                last LINE;
+            }
+        }
+    }
+
+    return unless $path;
+    if ( $path =~ /\s/ && $path !~ /^$bin_quote/ ) {
+        $path = $bin_quote . $path . $bin_quote;
+    }
+
+    return $path;
+}

commit b2f11b255afb5a38e54cbd51cfa7c604f0186571
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue May 11 10:25:58 2010 +0800

    update package file

diff --git a/Changes b/Changes
index a5b22fb..a5f7f2e 100644
--- a/Changes
+++ b/Changes
@@ -1,8 +1,11 @@
 Revision history for Shipwright
 
-2.4.9
+2.4.9 Tue May 11 02:21:28 UTC 2010
 
-2.4.8 Mon Mar 15 04:38:29 GMT 2010
+* add env SHIPWRIGHT_DEVEL to control error output's verboseness
+* to make windows happy, try make, dmake and nmake to find make utility
+
+2.4.8 Mon Mar 15 04:38:29 UTC 2010
 
 * make defaults to "dmake" in windows
 
diff --git a/META.yml b/META.yml
index bc1bdd4..abc49c0 100644
--- a/META.yml
+++ b/META.yml
@@ -9,7 +9,7 @@ build_requires:
 configure_requires:
   ExtUtils::MakeMaker: 6.42
 distribution_type: module
-generated_by: 'Module::Install version 0.91'
+generated_by: 'Module::Install version 0.92'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -37,6 +37,7 @@ requires:
   File::Slurp: 0
   File::Spec: 0
   File::Temp: 0
+  File::Which: 0
   IO::Uncompress::Bunzip2: 0
   IO::Uncompress::RawInflate: 2.012
   IPC::Run3: 0
@@ -52,4 +53,4 @@ requires:
 resources:
   license: http://dev.perl.org/licenses/
   repository: git://github.com/bestpractical/shipwright.git
-version: 2.004005
+version: 2.004009
diff --git a/inc/Module/AutoInstall.pm b/inc/Module/AutoInstall.pm
index dfb8ef7..32c2cf3 100644
--- a/inc/Module/AutoInstall.pm
+++ b/inc/Module/AutoInstall.pm
@@ -672,7 +672,20 @@ sub _load {
 sub _load_cpan {
     return if $CPAN::VERSION and $CPAN::Config and not @_;
     require CPAN;
-    if ( $CPAN::HandleConfig::VERSION ) {
+
+    # CPAN-1.82+ adds CPAN::Config::AUTOLOAD to redirect to
+    #    CPAN::HandleConfig->load. CPAN reports that the redirection
+    #    is deprecated in a warning printed at the user.
+
+    # CPAN-1.81 expects CPAN::HandleConfig->load, does not have
+    #   $CPAN::HandleConfig::VERSION but cannot handle
+    #   CPAN::Config->load
+
+    # Which "versions expect CPAN::Config->load?
+
+    if ( $CPAN::HandleConfig::VERSION
+        || CPAN::HandleConfig->can('load')
+    ) {
         # Newer versions of CPAN have a HandleConfig module
         CPAN::HandleConfig->load;
     } else {
@@ -802,4 +815,4 @@ END_MAKE
 
 __END__
 
-#line 1056
+#line 1069
diff --git a/inc/Module/Install.pm b/inc/Module/Install.pm
index 51eda5d..aceb4de 100644
--- a/inc/Module/Install.pm
+++ b/inc/Module/Install.pm
@@ -28,7 +28,7 @@ BEGIN {
 	# 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.91';
+	$VERSION = '0.92';
 
 	# Storage for the pseudo-singleton
 	$MAIN    = undef;
@@ -348,17 +348,24 @@ sub _caller {
 	return $call;
 }
 
+# Done in evals to avoid confusing Perl::MinimumVersion
+eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@;
 sub _read {
 	local *FH;
-	if ( $] >= 5.006 ) {
-		open( FH, '<', $_[0] ) or die "open($_[0]): $!";
-	} else {
-		open( FH, "< $_[0]"  ) or die "open($_[0]): $!";
-	}
+	open( FH, '<', $_[0] ) or die "open($_[0]): $!";
+	my $string = do { local $/; <FH> };
+	close FH or die "close($_[0]): $!";
+	return $string;
+}
+END_NEW
+sub _read {
+	local *FH;
+	open( FH, "< $_[0]"  ) or die "open($_[0]): $!";
 	my $string = do { local $/; <FH> };
 	close FH or die "close($_[0]): $!";
 	return $string;
 }
+END_OLD
 
 sub _readperl {
 	my $string = Module::Install::_read($_[0]);
@@ -379,18 +386,26 @@ sub _readpod {
 	return $string;
 }
 
+# Done in evals to avoid confusing Perl::MinimumVersion
+eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@;
 sub _write {
 	local *FH;
-	if ( $] >= 5.006 ) {
-		open( FH, '>', $_[0] ) or die "open($_[0]): $!";
-	} else {
-		open( FH, "> $_[0]"  ) or die "open($_[0]): $!";
+	open( FH, '>', $_[0] ) or die "open($_[0]): $!";
+	foreach ( 1 .. $#_ ) {
+		print FH $_[$_] or die "print($_[0]): $!";
 	}
+	close FH or die "close($_[0]): $!";
+}
+END_NEW
+sub _write {
+	local *FH;
+	open( FH, "> $_[0]"  ) or die "open($_[0]): $!";
 	foreach ( 1 .. $#_ ) {
 		print FH $_[$_] or die "print($_[0]): $!";
 	}
 	close FH or die "close($_[0]): $!";
 }
+END_OLD
 
 # _version is for processing module versions (eg, 1.03_05) not
 # Perl versions (eg, 5.8.1).
@@ -427,4 +442,4 @@ sub _CLASS ($) {
 
 1;
 
-# Copyright 2008 - 2009 Adam Kennedy.
+# Copyright 2008 - 2010 Adam Kennedy.
diff --git a/inc/Module/Install/AutoInstall.pm b/inc/Module/Install/AutoInstall.pm
index 58dd026..f04ca1e 100644
--- a/inc/Module/Install/AutoInstall.pm
+++ b/inc/Module/Install/AutoInstall.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.91';
+	$VERSION = '0.92';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
diff --git a/inc/Module/Install/Base.pm b/inc/Module/Install/Base.pm
index 60a74d2..618bf57 100644
--- a/inc/Module/Install/Base.pm
+++ b/inc/Module/Install/Base.pm
@@ -4,7 +4,7 @@ package Module::Install::Base;
 use strict 'vars';
 use vars qw{$VERSION};
 BEGIN {
-	$VERSION = '0.91';
+	$VERSION = '0.92';
 }
 
 # Suspend handler for "redefined" warnings
diff --git a/inc/Module/Install/Can.pm b/inc/Module/Install/Can.pm
index e65e4f6..75b8a27 100644
--- a/inc/Module/Install/Can.pm
+++ b/inc/Module/Install/Can.pm
@@ -9,7 +9,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.91';
+	$VERSION = '0.92';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
diff --git a/inc/Module/Install/Fetch.pm b/inc/Module/Install/Fetch.pm
index 05f2079..e3d6800 100644
--- a/inc/Module/Install/Fetch.pm
+++ b/inc/Module/Install/Fetch.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.91';
+	$VERSION = '0.92';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
diff --git a/inc/Module/Install/Include.pm b/inc/Module/Install/Include.pm
index 7e792e0..69a0cf9 100644
--- a/inc/Module/Install/Include.pm
+++ b/inc/Module/Install/Include.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.91';
+	$VERSION = '0.92';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
diff --git a/inc/Module/Install/Makefile.pm b/inc/Module/Install/Makefile.pm
index 98779db..acf10ef 100644
--- a/inc/Module/Install/Makefile.pm
+++ b/inc/Module/Install/Makefile.pm
@@ -7,7 +7,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.91';
+	$VERSION = '0.92';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
@@ -34,6 +34,17 @@ sub prompt {
 	}
 }
 
+# Store a cleaned up version of the MakeMaker version,
+# since we need to behave differently in a variety of
+# ways based on the MM version.
+my $makemaker = eval $ExtUtils::MakeMaker::VERSION;
+
+# If we are passed a param, do a "newer than" comparison.
+# Otherwise, just return the MakeMaker version.
+sub makemaker {
+	( @_ < 2 or $makemaker >= eval($_[1]) ) ? $makemaker : 0
+}
+
 sub makemaker_args {
 	my $self = shift;
 	my $args = ( $self->{makemaker_args} ||= {} );
@@ -44,7 +55,7 @@ sub makemaker_args {
 # For mm args that take multiple space-seperated args,
 # append an argument to the current list.
 sub makemaker_append {
-	my $self = sShift;
+	my $self = shift;
 	my $name = shift;
 	my $args = $self->makemaker_args;
 	$args->{name} = defined $args->{$name}
@@ -130,12 +141,13 @@ sub write {
 		# an underscore, even though its own version may contain one!
 		# Hence the funny regexp to get rid of it.  See RT #35800
 		# for details.
-		$self->build_requires( 'ExtUtils::MakeMaker' => $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/ );
-		$self->configure_requires( 'ExtUtils::MakeMaker' => $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/ );
+		my $v = $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/;
+		$self->build_requires(     'ExtUtils::MakeMaker' => $v );
+		$self->configure_requires( 'ExtUtils::MakeMaker' => $v );
 	} else {
 		# Allow legacy-compatibility with 5.005 by depending on the
 		# most recent EU:MM that supported 5.005.
-		$self->build_requires( 'ExtUtils::MakeMaker' => 6.42 );
+		$self->build_requires(     'ExtUtils::MakeMaker' => 6.42 );
 		$self->configure_requires( 'ExtUtils::MakeMaker' => 6.42 );
 	}
 
@@ -152,42 +164,62 @@ sub write {
 		$args->{ABSTRACT} = $self->abstract;
 		$args->{AUTHOR}   = $self->author;
 	}
-	if ( eval($ExtUtils::MakeMaker::VERSION) >= 6.10 ) {
+	if ( $self->makemaker(6.10) ) {
 		$args->{NO_META} = 1;
 	}
-	if ( eval($ExtUtils::MakeMaker::VERSION) > 6.17 and $self->sign ) {
+	if ( $self->makemaker(6.17) and $self->sign ) {
 		$args->{SIGN} = 1;
 	}
 	unless ( $self->is_admin ) {
 		delete $args->{SIGN};
 	}
 
-	# Merge both kinds of requires into prereq_pm
 	my $prereq = ($args->{PREREQ_PM} ||= {});
 	%$prereq = ( %$prereq,
-		map { @$_ }
+		map { @$_ } # flatten [module => version]
 		map { @$_ }
 		grep $_,
-		($self->configure_requires, $self->build_requires, $self->requires)
+		($self->requires)
 	);
 
 	# Remove any reference to perl, PREREQ_PM doesn't support it
 	delete $args->{PREREQ_PM}->{perl};
 
-	# merge both kinds of requires into prereq_pm
+	# Merge both kinds of requires into BUILD_REQUIRES
+	my $build_prereq = ($args->{BUILD_REQUIRES} ||= {});
+	%$build_prereq = ( %$build_prereq,
+		map { @$_ } # flatten [module => version]
+		map { @$_ }
+		grep $_,
+		($self->configure_requires, $self->build_requires)
+	);
+
+	# Remove any reference to perl, BUILD_REQUIRES doesn't support it
+	delete $args->{BUILD_REQUIRES}->{perl};
+
+	# Delete bundled dists from prereq_pm
 	my $subdirs = ($args->{DIR} ||= []);
 	if ($self->bundles) {
 		foreach my $bundle (@{ $self->bundles }) {
 			my ($file, $dir) = @$bundle;
 			push @$subdirs, $dir if -d $dir;
-			delete $prereq->{$file};
+			delete $build_prereq->{$file}; #Delete from build prereqs only
 		}
 	}
 
+	unless ( $self->makemaker('6.55_03') ) {
+		%$prereq = (%$prereq,%$build_prereq);
+		delete $args->{BUILD_REQUIRES};
+	}
+
 	if ( my $perl_version = $self->perl_version ) {
 		eval "use $perl_version; 1"
 			or die "ERROR: perl: Version $] is installed, "
 			. "but we need version >= $perl_version";
+
+		if ( $self->makemaker(6.48) ) {
+			$args->{MIN_PERL_VERSION} = $perl_version;
+		}
 	}
 
 	$args->{INSTALLDIRS} = $self->installdirs;
@@ -265,4 +297,4 @@ sub postamble {
 
 __END__
 
-#line 394
+#line 426
diff --git a/inc/Module/Install/Metadata.pm b/inc/Module/Install/Metadata.pm
index 653193d..b00e6b1 100644
--- a/inc/Module/Install/Metadata.pm
+++ b/inc/Module/Install/Metadata.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.91';
+	$VERSION = '0.92';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
@@ -230,6 +230,8 @@ sub all_from {
 		die("The path '$file' does not exist, or is not a file");
 	}
 
+    $self->{values}{all_from} = $file;
+
 	# Some methods pull from POD instead of code.
 	# If there is a matching .pod, use that instead
 	my $pod = $file;
@@ -385,11 +387,10 @@ sub name_from {
 	}
 }
 
-sub perl_version_from {
-	my $self = shift;
+sub _extract_perl_version {
 	if (
-		Module::Install::_read($_[0]) =~ m/
-		^
+		$_[0] =~ m/
+		^\s*
 		(?:use|require) \s*
 		v?
 		([\d_\.]+)
@@ -398,6 +399,16 @@ sub perl_version_from {
 	) {
 		my $perl_version = $1;
 		$perl_version =~ s{_}{}g;
+		return $perl_version;
+	} else {
+		return;
+	}
+}
+
+sub perl_version_from {
+	my $self = shift;
+	my $perl_version=_extract_perl_version(Module::Install::_read($_[0]));
+	if ($perl_version) {
 		$self->perl_version($perl_version);
 	} else {
 		warn "Cannot determine perl version info from $_[0]\n";
@@ -425,13 +436,12 @@ sub author_from {
 	}
 }
 
-sub license_from {
-	my $self = shift;
+sub _extract_license {
 	if (
-		Module::Install::_read($_[0]) =~ m/
+		$_[0] =~ m/
 		(
 			=head \d \s+
-			(?:licen[cs]e|licensing|copyright|legal)\b
+			(?:licen[cs]e|licensing|copyrights?|legal)\b
 			.*?
 		)
 		(=head\\d.*|=cut.*|)
@@ -439,7 +449,8 @@ sub license_from {
 	/ixms ) {
 		my $license_text = $1;
 		my @phrases      = (
-			'under the same (?:terms|license) as (?:perl|the perl programming language) itself' => 'perl', 1,
+			'under the same (?:terms|license) as (?:perl|the perl programming language)' => 'perl', 1,
+			'under the terms of (?:perl|the perl programming language) itself' => 'perl', 1,
 			'GNU general public license'         => 'gpl',         1,
 			'GNU public license'                 => 'gpl',         1,
 			'GNU lesser general public license'  => 'lgpl',        1,
@@ -456,20 +467,32 @@ sub license_from {
 			'proprietary'                        => 'proprietary', 0,
 		);
 		while ( my ($pattern, $license, $osi) = splice(@phrases, 0, 3) ) {
-			$pattern =~ s{\s+}{\\s+}g;
+			$pattern =~ s#\s+#\\s+#gs;
 			if ( $license_text =~ /\b$pattern\b/i ) {
-				$self->license($license);
-				return 1;
+			        return $license;
 			}
 		}
+	} else {
+	        return;
 	}
+}
 
-	warn "Cannot determine license info from $_[0]\n";
-	return 'unknown';
+sub license_from {
+	my $self = shift;
+	if (my $license=_extract_license(Module::Install::_read($_[0]))) {
+		$self->license($license);
+	} else {
+		warn "Cannot determine license info from $_[0]\n";
+		return 'unknown';
+	}
 }
 
 sub _extract_bugtracker {
-	my @links   = $_[0] =~ m#L<(\Qhttp://rt.cpan.org/\E[^>]+)>#g;
+	my @links   = $_[0] =~ m#L<(
+	 \Qhttp://rt.cpan.org/\E[^>]+|
+	 \Qhttp://github.com/\E[\w_]+/[\w_]+/issues|
+	 \Qhttp://code.google.com/p/\E[\w_\-]+/issues/list
+	 )>#gx;
 	my %links;
 	@links{@links}=();
 	@links=keys %links;
@@ -485,7 +508,7 @@ sub bugtracker_from {
 		return 0;
 	}
 	if ( @links > 1 ) {
-		warn "Found more than on rt.cpan.org link in $_[0]\n";
+		warn "Found more than one bugtracker link in $_[0]\n";
 		return 0;
 	}
 
diff --git a/inc/Module/Install/Scripts.pm b/inc/Module/Install/Scripts.pm
index a1001f5..77d7c77 100644
--- a/inc/Module/Install/Scripts.pm
+++ b/inc/Module/Install/Scripts.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.91';
+	$VERSION = '0.92';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
diff --git a/inc/Module/Install/Share.pm b/inc/Module/Install/Share.pm
index f7e877c..f649079 100644
--- a/inc/Module/Install/Share.pm
+++ b/inc/Module/Install/Share.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.91';
+	$VERSION = '0.92';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
diff --git a/inc/Module/Install/Win32.pm b/inc/Module/Install/Win32.pm
index f2f99df..89f16f0 100644
--- a/inc/Module/Install/Win32.pm
+++ b/inc/Module/Install/Win32.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.91';
+	$VERSION = '0.92';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
diff --git a/inc/Module/Install/WriteAll.pm b/inc/Module/Install/WriteAll.pm
index 12471e5..af3ea05 100644
--- a/inc/Module/Install/WriteAll.pm
+++ b/inc/Module/Install/WriteAll.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.91';;
+	$VERSION = '0.92';;
 	@ISA     = qw{Module::Install::Base};
 	$ISCORE  = 1;
 }

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list