Bladeren bron

adding osx mocks & fixing the module::install files

Aditya Ivaturi 14 jaren geleden
bovenliggende
commit
f26720cba9

+ 13 - 108
inc/Module/AutoInstall.pm

@@ -7,7 +7,7 @@ use ExtUtils::MakeMaker ();
 
 use vars qw{$VERSION};
 BEGIN {
-	$VERSION = '1.04';
+	$VERSION = '1.03';
 }
 
 # special map on pre-defined feature sets
@@ -17,14 +17,11 @@ my %FeatureMap = (
 );
 
 # various lexical flags
-my ( @Missing, @Existing,  %DisabledTests, $UnderCPAN, $InstallDepsTarget, $HasCPANPLUS );
+my ( @Missing, @Existing,  %DisabledTests, $UnderCPAN,     $HasCPANPLUS );
 my (
-    $Config, $CheckOnly, $SkipInstall, $AcceptDefault, $TestOnly, $AllDeps,
-    $UpgradeDeps
+    $Config, $CheckOnly, $SkipInstall, $AcceptDefault, $TestOnly, $AllDeps
 );
-my ( $PostambleActions, $PostambleActionsNoTest, $PostambleActionsUpgradeDeps,
-    $PostambleActionsUpgradeDepsNoTest, $PostambleActionsListDeps,
-    $PostambleActionsListAllDeps, $PostambleUsed, $NoTest);
+my ( $PostambleActions, $PostambleUsed );
 
 # See if it's a testing or non-interactive session
 _accept_default( $ENV{AUTOMATED_TESTING} or ! -t STDIN ); 
@@ -34,10 +31,6 @@ sub _accept_default {
     $AcceptDefault = shift;
 }
 
-sub _installdeps_target {
-    $InstallDepsTarget = shift;
-}
-
 sub missing_modules {
     return @Missing;
 }
@@ -70,11 +63,6 @@ sub _init {
             __PACKAGE__->install( $Config, @Missing = split( /,/, $1 ) );
             exit 0;
         }
-	elsif ( $arg =~ /^--upgradedeps=(.*)$/ ) {
-	    $UpgradeDeps = 1;
-	    __PACKAGE__->install( $Config, @Missing = split( /,/, $1 ) );
-	    exit 0;
-	}
         elsif ( $arg =~ /^--default(?:deps)?$/ ) {
             $AcceptDefault = 1;
         }
@@ -137,7 +125,7 @@ sub import {
     # check entirely since we don't want to have to load (and configure)
     # an old CPAN just for a cosmetic message
 
-    $UnderCPAN = _check_lock(1) unless $SkipInstall || $InstallDepsTarget;
+    $UnderCPAN = _check_lock(1) unless $SkipInstall;
 
     while ( my ( $feature, $modules ) = splice( @args, 0, 2 ) ) {
         my ( @required, @tests, @skiptests );
@@ -219,7 +207,6 @@ sub import {
                 $CheckOnly
                 or ($mandatory and $UnderCPAN)
                 or $AllDeps
-                or $InstallDepsTarget
                 or _prompt(
                     qq{==> Auto-install the }
                       . ( @required / 2 )
@@ -250,17 +237,10 @@ sub import {
         }
     }
 
-    if ( @Missing and not( $CheckOnly or $UnderCPAN) ) {
+    if ( @Missing and not( $CheckOnly or $UnderCPAN ) ) {
         require Config;
-        my $make = $Config::Config{make};
-        if ($InstallDepsTarget) {
-            print
-"*** To install dependencies type '$make installdeps' or '$make installdeps_notest'.\n";
-        }
-        else {
-            print
-"*** Dependencies will be installed the next time you type '$make'.\n";
-        }
+        print
+"*** Dependencies will be installed the next time you type '$Config::Config{make}'.\n";
 
         # make an educated guess of whether we'll need root permission.
         print "    (You may need to do that as the 'root' user.)\n"
@@ -291,10 +271,6 @@ END_MESSAGE
 sub _check_lock {
     return unless @Missing or @_;
 
-    if ($ENV{PERL5_CPANM_IS_RUNNING}) {
-        return _running_under('cpanminus');
-    }
-
     my $cpan_env = $ENV{PERL5_CPAN_IS_RUNNING};
 
     if ($ENV{PERL5_CPANPLUS_IS_RUNNING}) {
@@ -356,11 +332,6 @@ sub install {
         }
     }
 
-    if ($UpgradeDeps) {
-	push @modules, @installed;
-	@installed = ();
-    }
-
     return @installed unless @modules;  # nothing to do
     return @installed if _check_lock(); # defer to the CPAN shell
 
@@ -492,11 +463,6 @@ sub _cpanplus_config {
 			} else {
 				die "*** Cannot convert option $key = '$value' to CPANPLUS version.\n";
 			}
-			push @config, 'prereqs', $value;
-		} elsif ( $key eq 'force' ) {
-		    push @config, $key, $value;
-		} elsif ( $key eq 'notest' ) {
-		    push @config, 'skiptest', $value;
 		} else {
 			die "*** Cannot convert option $key to CPANPLUS version.\n";
 		}
@@ -531,14 +497,10 @@ sub _install_cpan {
     # set additional options
     while ( my ( $opt, $arg ) = splice( @config, 0, 2 ) ) {
         ( $args{$opt} = $arg, next )
-          if $opt =~ /^(?:force|notest)$/;    # pseudo-option
+          if $opt =~ /^force$/;    # pseudo-option
         $CPAN::Config->{$opt} = $arg;
     }
 
-    if ($args{notest} && (not CPAN::Shell->can('notest'))) {
-	die "Your version of CPAN is too old to support the 'notest' pragma";
-    }
-
     local $CPAN::Config->{prerequisites_policy} = 'follow';
 
     while ( my ( $pkg, $ver ) = splice( @modules, 0, 2 ) ) {
@@ -557,16 +519,8 @@ sub _install_cpan {
                 delete $INC{$inc};
             }
 
-            my $rv = do {
-		if ($args{force}) {
-		    CPAN::Shell->force( install => $pkg )
-		} elsif ($args{notest}) {
-		    CPAN::Shell->notest( install => $pkg )
-		} else {
-		    CPAN::Shell->install($pkg)
-		}
-	    };
-
+            my $rv = $args{force} ? CPAN::Shell->force( install => $pkg )
+                                  : CPAN::Shell->install($pkg);
             $rv ||= eval {
                 $CPAN::META->instance( 'CPAN::Distribution', $obj->cpan_file, )
                   ->{install}
@@ -809,35 +763,6 @@ sub _make_args {
         : "\$(NOECHO) \$(NOOP)"
     );
 
-    my $deps_list = join( ',', @Missing, @Existing );
-
-    $PostambleActionsUpgradeDeps =
-        "\$(PERL) $0 --config=$config --upgradedeps=$deps_list";
-
-    my $config_notest =
-      join( ',', (UNIVERSAL::isa( $Config, 'HASH' ) ? %{$Config} : @{$Config}),
-	  'notest', 1 )
-      if $Config;
-
-    $PostambleActionsNoTest = (
-        ($missing and not $UnderCPAN)
-        ? "\$(PERL) $0 --config=$config_notest --installdeps=$missing"
-        : "\$(NOECHO) \$(NOOP)"
-    );
-
-    $PostambleActionsUpgradeDepsNoTest =
-        "\$(PERL) $0 --config=$config_notest --upgradedeps=$deps_list";
-
-    $PostambleActionsListDeps =
-        '@$(PERL) -le "print for @ARGV" '
-            . join(' ', map $Missing[$_], grep $_ % 2 == 0, 0..$#Missing);
-
-    my @all = (@Missing, @Existing);
-
-    $PostambleActionsListAllDeps =
-        '@$(PERL) -le "print for @ARGV" '
-            . join(' ', map $all[$_], grep $_ % 2 == 0, 0..$#all);
-
     return %args;
 }
 
@@ -872,15 +797,11 @@ sub Write {
 
 sub postamble {
     $PostambleUsed = 1;
-    my $fragment;
 
-    $fragment .= <<"AUTO_INSTALL" if !$InstallDepsTarget;
+    return <<"END_MAKE";
 
 config :: installdeps
 \t\$(NOECHO) \$(NOOP)
-AUTO_INSTALL
-
-    $fragment .= <<"END_MAKE";
 
 checkdeps ::
 \t\$(PERL) $0 --checkdeps
@@ -888,28 +809,12 @@ checkdeps ::
 installdeps ::
 \t$PostambleActions
 
-installdeps_notest ::
-\t$PostambleActionsNoTest
-
-upgradedeps ::
-\t$PostambleActionsUpgradeDeps
-
-upgradedeps_notest ::
-\t$PostambleActionsUpgradeDepsNoTest
-
-listdeps ::
-\t$PostambleActionsListDeps
-
-listalldeps ::
-\t$PostambleActionsListAllDeps
-
 END_MAKE
 
-    return $fragment;
 }
 
 1;
 
 __END__
 
-#line 1178
+#line 1071

+ 2 - 2
inc/Module/Install.pm

@@ -31,7 +31,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 = '1.04';
+	$VERSION = '1.01';
 
 	# Storage for the pseudo-singleton
 	$MAIN    = undef;
@@ -451,7 +451,7 @@ sub _version ($) {
 }
 
 sub _cmp ($$) {
-	_version($_[1]) <=> _version($_[2]);
+	_version($_[0]) <=> _version($_[1]);
 }
 
 # Cloned from Params::Util::_CLASS

+ 1 - 12
inc/Module/Install/AutoInstall.pm

@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.04';
+	$VERSION = '1.01';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
@@ -73,17 +73,6 @@ sub auto_install {
     );
 }
 
-sub installdeps_target {
-    my ($self, @args) = @_;
-
-    $self->include('Module::AutoInstall');
-    require Module::AutoInstall;
-
-    Module::AutoInstall::_installdeps_target(1);
-
-    $self->auto_install(@args);
-}
-
 sub auto_install_now {
     my $self = shift;
     $self->auto_install(@_);

+ 1 - 1
inc/Module/Install/Base.pm

@@ -4,7 +4,7 @@ package Module::Install::Base;
 use strict 'vars';
 use vars qw{$VERSION};
 BEGIN {
-	$VERSION = '1.04';
+	$VERSION = '1.01';
 }
 
 # Suspend handler for "redefined" warnings

+ 1 - 1
inc/Module/Install/Can.pm

@@ -9,7 +9,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.04';
+	$VERSION = '1.01';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }

+ 1 - 1
inc/Module/Install/Fetch.pm

@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.04';
+	$VERSION = '1.01';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }

+ 1 - 1
inc/Module/Install/Include.pm

@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.04';
+	$VERSION = '1.01';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }

+ 8 - 14
inc/Module/Install/Metadata.pm

@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.04';
+	$VERSION = '1.01';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
@@ -151,21 +151,15 @@ sub install_as_site   { $_[0]->installdirs('site')   }
 sub install_as_vendor { $_[0]->installdirs('vendor') }
 
 sub dynamic_config {
-	my $self  = shift;
-	my $value = @_ ? shift : 1;
-	if ( $self->{values}->{dynamic_config} ) {
-		# Once dynamic we never change to static, for safety
-		return 0;
+	my $self = shift;
+	unless ( @_ ) {
+		warn "You MUST provide an explicit true/false value to dynamic_config\n";
+		return $self;
 	}
-	$self->{values}->{dynamic_config} = $value ? 1 : 0;
+	$self->{values}->{dynamic_config} = $_[0] ? 1 : 0;
 	return 1;
 }
 
-# Convenience command
-sub static_config {
-	shift->dynamic_config(0);
-}
-
 sub perl_version {
 	my $self = shift;
 	return $self->{values}->{perl_version} unless @_;
@@ -176,7 +170,7 @@ sub perl_version {
 	# Normalize the version
 	$version = $self->_perl_version($version);
 
-	# We don't support the really old versions
+	# We don't support the reall old versions
 	unless ( $version >= 5.005 ) {
 		die "Module::Install only supports 5.005 or newer (use ExtUtils::MakeMaker)\n";
 	}
@@ -588,7 +582,7 @@ sub bugtracker_from {
 sub requires_from {
 	my $self     = shift;
 	my $content  = Module::Install::_readperl($_[0]);
-	my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+(v?[\d\.]+)/mg;
+	my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+([\d\.]+)/mg;
 	while ( @requires ) {
 		my $module  = shift @requires;
 		my $version = shift @requires;

+ 1 - 1
inc/Module/Install/Win32.pm

@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.04';
+	$VERSION = '1.01';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }

+ 1 - 1
inc/Module/Install/WriteAll.pm

@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.04';
+	$VERSION = '1.01';
 	@ISA     = qw{Module::Install::Base};
 	$ISCORE  = 1;
 }

File diff suppressed because it is too large
+ 0 - 0
t/mock-recordings/01-driver-mock-darwin.json


File diff suppressed because it is too large
+ 0 - 0
t/mock-recordings/02-webelement-mock-darwin.json


Some files were not shown because too many files changed in this diff