Acme-Blarghy-McBlarghBlargh

 view release on metacpan or  search on metacpan

inc/Module/AutoInstall.pm  view on Meta::CPAN

3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use strict;
use Cwd                 ();
 
use vars qw{$VERSION};
BEGIN {
        $VERSION = '1.03';
}
 
# special map on pre-defined feature sets
my %FeatureMap = (
    ''      => 'Core Features',    # XXX: deprecated
    '-core' => 'Core Features',
);
 
# various lexical flags
my ( @Missing, @Existing%DisabledTests, $UnderCPAN,     $HasCPANPLUS );
my ( $Config$CheckOnly, $SkipInstall,   $AcceptDefault, $TestOnly );
my ( $PostambleActions, $PostambleUsed );

inc/Module/AutoInstall.pm  view on Meta::CPAN

119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
my ( @required, @tests, @skiptests );
my $default  = 1;
my $conflict = 0;
 
if ( $feature =~ m/^-(\w+)$/ ) {
    my $option = lc($1);
 
    # check for a newer version of myself
    _update_to( $modules, @_ ) and return if $option eq 'version';
 
    # sets CPAN configuration options
    $Config = $modules if $option eq 'config';
 
    # promote every features to core status
    $core_all = ( $modules =~ /^all$/i ) and next
      if $option eq 'core';
 
    next unless $option eq 'core';
}
 
print "[" . ( $FeatureMap{ lc($feature) } || $feature ) . "]\n";

inc/Module/AutoInstall.pm  view on Meta::CPAN

341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
my @config    = _cpanplus_config( @{ +shift } );
my $installed = 0;
 
my $cp   = CPANPLUS::Backend->new;
my $conf = $cp->configure_object;
 
return unless $conf->can('conf') # 0.05x+ with "sudo" support
           or _can_write($conf->_get_build('base'));  # 0.04x
 
# if we're root, set UNINST=1 to avoid trouble unless user asked for it.
my $makeflags = $conf->get_conf('makeflags') || '';
if ( UNIVERSAL::isa( $makeflags, 'HASH' ) ) {
    # 0.03+ uses a hashref here
    $makeflags->{UNINST} = 1 unless exists $makeflags->{UNINST};
 
} else {
    # 0.02 and below uses a scalar
    $makeflags = join( ' ', split( ' ', $makeflags ), 'UNINST=1' )
      if ( $makeflags !~ /\bUNINST\b/ and eval qq{ $> eq '0' } );
 
}
$conf->set_conf( makeflags => $makeflags );
$conf->set_conf( prereqs   => 1 );
 
 
 
while ( my ( $key, $val ) = splice( @config, 0, 2 ) ) {
    $conf->set_conf( $key, $val );
}
 
my $modtree = $cp->module_tree;
while ( my ( $pkg, $ver ) = splice( @modules, 0, 2 ) ) {
    print "*** Installing $pkg...\n";
 
    MY::preinstall( $pkg, $ver ) or next if defined &MY::preinstall;
 
    my $success;
    my $obj = $modtree->{$pkg};

inc/Module/AutoInstall.pm  view on Meta::CPAN

438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
_load_cpan();
require Config;
 
if (CPAN->VERSION < 1.80) {
    # no "sudo" support, probe for writableness
    return unless _can_write( MM->catfile( $CPAN::Config->{cpan_home}, 'sources' ) )
              and _can_write( $Config::Config{sitelib} );
}
 
# if we're root, set UNINST=1 to avoid trouble unless user asked for it.
my $makeflags = $CPAN::Config->{make_install_arg} || '';
$CPAN::Config->{make_install_arg} =
  join( ' ', split( ' ', $makeflags ), 'UNINST=1' )
  if ( $makeflags !~ /\bUNINST\b/ and eval qq{ $> eq '0' } );
 
# don't show start-up info
$CPAN::Config->{inhibit_startup_message} = 1;
 
# set additional options
while ( my ( $opt, $arg ) = splice( @config, 0, 2 ) ) {
    ( $args{$opt} = $arg, next )
      if $opt =~ /^force$/;    # pseudo-option
    $CPAN::Config->{$opt} = $arg;
}
 
local $CPAN::Config->{prerequisites_policy} = 'follow';
 
while ( my ( $pkg, $ver ) = splice( @modules, 0, 2 ) ) {
    MY::preinstall( $pkg, $ver ) or next if defined &MY::preinstall;

inc/Module/Install.pm  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#line 1
 
# For any maintainers:
# The load order for Module::Install is a bit magic.
# It goes something like this...
#
# IF ( host has Module::Install installed, creating author mode ) {
#     1. Makefile.PL calls "use inc::Module::Install"
#     2. $INC{inc/Module/Install.pm} set to installed version of inc::Module::Install
#     3. The installed version of inc::Module::Install loads
#     4. inc::Module::Install calls "require Module::Install"
#     5. The ./inc/ version of Module::Install loads
# } ELSE {
#     1. Makefile.PL calls "use inc::Module::Install"
#     2. $INC{inc/Module/Install.pm} set to ./inc/ version of Module::Install
#     3. The ./inc/ version of Module::Install loads
# }
 
BEGIN {
        require 5.004;
}
use strict 'vars';
 
use vars qw{$VERSION};
BEGIN {

inc/Module/Install.pm  view on Meta::CPAN

35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
        *inc::Module::Install::VERSION = *VERSION;
        @inc::Module::Install::ISA     = __PACKAGE__;
 
}
 
 
 
 
 
# Whether or not inc::Module::Install is actually loaded, the
# $INC{inc/Module/Install.pm} is what will still get set as long as
# the caller loaded module this in the documented manner.
# If not set, the caller may NOT have loaded the bundled version, and thus
# they may not have a MI version that works with the Makefile.PL. This would
# result in false errors or unexpected behaviour. And we don't want that.
my $file = join( '/', 'inc', split /::/, __PACKAGE__ ) . '.pm';
unless ( $INC{$file} ) { die <<"END_DIE" }
 
Please invoke ${\__PACKAGE__} with:
 
        use inc::${\__PACKAGE__};
 
not:

inc/Module/Install/Metadata.pm  view on Meta::CPAN

201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
        }
 
        return 1;
}
 
sub all_from {
        my ( $self, $file ) = @_;
 
        unless ( defined($file) ) {
                my $name = $self->name or die(
                        "all_from called with no args without setting name() first"
                );
                $file = join('/', 'lib', split(/-/, $name)) . '.pm';
                $file =~ s{.*/}{} unless -e $file;
                unless ( -e $file ) {
                        die("all_from cannot find $file from $name");
                }
        }
        unless ( -f $file ) {
                die("The path '$file' does not exist, or is not a file");
        }

inc/Module/Install/Metadata.pm  view on Meta::CPAN

308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
        return $self->{values}{no_index};
}
 
sub read {
        my $self = shift;
        $self->include_deps( 'YAML::Tiny', 0 );
 
        require YAML::Tiny;
        my $data = YAML::Tiny::LoadFile('META.yml');
 
        # Call methods explicitly in case user has already set some values.
        while ( my ( $key, $value ) = each %$data ) {
                next unless $self->can($key);
                if ( ref $value eq 'HASH' ) {
                        while ( my ( $module, $version ) = each %$value ) {
                                $self->can($key)->($self, $module => $version );
                        }
                } else {
                        $self->can($key)->($self, $value);
                }
        }



( run in 0.627 second using v1.01-cache-2.11-cpan-94b05bcf43c )