AAAA-Crypt-DH

 view release on metacpan or  search on metacpan

inc/Devel/CheckLib.pm  view on Meta::CPAN

321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
    close($ch);
    my $exefile = File::Temp::mktemp( 'assertlibXXXXXXXX' ) . $Config{_exe};
    my @sys_cmd;
    # FIXME: re-factor - almost identical code later when linking
    if ( $Config{cc} eq 'cl' ) {                 # Microsoft compiler
        require Win32;
        @sys_cmd = (
            @$cc,
            $cfile,
            "/Fe$exefile",
            (map { '/I'.Win32::GetShortPathName($_) } @incpaths),
            "/link",
            @$ld,
            split(' ', $Config{libs}),
        );
    } elsif($Config{cc} =~ /bcc32(\.exe)?/) {    # Borland
        @sys_cmd = (
            @$cc,
            @$ld,
            (map { "-I$_" } @incpaths),
            "-o$exefile",
            $cfile
        );
    } else { # Unix-ish: gcc, Sun, AIX (gcc, cc), ...
        @sys_cmd = (
            @$cc,
            @$ld,
            $cfile,
            (map { "-I$_" } @incpaths),
            "-o", "$exefile"
        );
    }
    warn "# @sys_cmd\n" if $args{debug};
    my $rv = $args{debug} ? system(@sys_cmd) : _quiet_system(@sys_cmd);
    push @missing, $header if $rv != 0 || ! -x $exefile;
    _cleanup_exe($exefile);
    unlink $cfile;
}

inc/Devel/CheckLib.pm  view on Meta::CPAN

364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
my $ofile = $cfile;
$ofile =~ s/\.c$/$Config{_o}/;
print $ch qq{#include <$_>\n} foreach (@headers);
print $ch "int main(int argc, char *argv[]) { ".($args{function} || 'return 0;')." }\n";
close($ch);
for my $lib ( @libs ) {
    my $exefile = File::Temp::mktemp( 'assertlibXXXXXXXX' ) . $Config{_exe};
    my @sys_cmd;
    if ( $Config{cc} eq 'cl' ) {                 # Microsoft compiler
        require Win32;
        my @libpath = map {
            q{/libpath:} . Win32::GetShortPathName($_)
        } @libpaths;
        # this is horribly sensitive to the order of arguments
        @sys_cmd = (
            @$cc,
            $cfile,
            "${lib}.lib",
            "/Fe$exefile",
            (map { '/I'.Win32::GetShortPathName($_) } @incpaths),
            "/link",
            @$ld,
            split(' ', $Config{libs}),
            (map {'/libpath:'.Win32::GetShortPathName($_)} @libpaths),
        );
    } elsif($Config{cc} eq 'CC/DECC') {          # VMS
    } elsif($Config{cc} =~ /bcc32(\.exe)?/) {    # Borland
        @sys_cmd = (
            @$cc,
            @$ld,
            "-o$exefile",
            (map { "-I$_" } @incpaths),
            (map { "-L$_" } @libpaths),
            "-l$lib",
            $cfile);
    } else {                                     # Unix-ish
                                                 # gcc, Sun, AIX (gcc, cc)
        @sys_cmd = (
            @$cc,
            @$ld,
            $cfile,
            "-o", "$exefile",
            (map { "-I$_" } @incpaths),
            (map { "-L$_" } @libpaths),
            "-l$lib",
        );
    }
    warn "# @sys_cmd\n" if $args{debug};
    local $ENV{LD_RUN_PATH} = join(":", @libpaths).":".$ENV{LD_RUN_PATH} unless $^O eq 'MSWin32';
    local $ENV{PATH} = join(";", @libpaths).";".$ENV{PATH} if $^O eq 'MSWin32';
    my $rv = $args{debug} ? system(@sys_cmd) : _quiet_system(@sys_cmd);
    if ($rv != 0 || ! -x $exefile) {
        push @missing, $lib;
    }

inc/Devel/CheckLib.pm  view on Meta::CPAN

424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
            else {
                if ($analyze_binary) {
                    push @wronganalysis, $lib if !$analyze_binary->($lib, $exefile)
                }
            }
        }
        _cleanup_exe($exefile);
    }
    unlink $cfile;
 
    my $miss_string = join( q{, }, map { qq{'$_'} } @missing );
    die("Can't link/include C library $miss_string, aborting.\n") if @missing;
    my $wrong_string = join( q{, }, map { qq{'$_'} } @wrongresult);
    die("wrong result: $wrong_string\n") if @wrongresult;
    my $analysis_string = join(q{, }, map { qq{'$_'} } @wronganalysis );
    die("wrong analysis: $analysis_string") if @wronganalysis;
}
 
sub _cleanup_exe {
    my ($exefile) = @_;
    my $ofile = $exefile;
    $ofile =~ s/$Config{_exe}$/$Config{_o}/;
    # List of files to remove
    my @rmfiles;
    push @rmfiles, $exefile, $ofile, "$exefile\.manifest";

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

417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
# Perl versions (eg, 5.8.1).
sub _version {
        my $s = shift || 0;
        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;
        return $l + 0;
}
 
sub _cmp {
        _version($_[1]) <=> _version($_[2]);
}

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

183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
sub _wanted_t {
}
 
sub tests_recursive {
        my $self = shift;
        my $dir = shift || 't';
        unless ( -d $dir ) {
                die "tests_recursive dir '$dir' does not exist";
        }
        my %tests = map { $_ => 1 } split / /, ($self->tests || '');
        require File::Find;
        File::Find::find(
        sub { /\.t$/ and -f $_ and $tests{"$File::Find::dir/*.t"} = 1 },
        $dir
    );
        $self->tests( join ' ', sort keys %tests );
}
 
sub write {
        my $self = shift;

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

249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
            my @tests = split ' ', $self->tests;
            my %seen;
            $args->{test} = {
                    TESTS => (join ' ', grep {!$seen{$_}++} @tests),
            };
} elsif ( $Module::Install::ExtraTests::use_extratests ) {
    # Module::Install::ExtraTests doesn't set $self->tests and does its own tests via harness.
    # So, just ignore our xt tests here.
    } elsif ( -d 'xt' and ($Module::Install::AUTHOR or $ENV{RELEASE_TESTING}) ) {
            $args->{test} = {
                    TESTS => join( ' ', map { "$_/*.t" } grep { -d $_ } qw{ t xt } ),
            };
    }
    if ( $] >= 5.005 ) {
            $args->{ABSTRACT} = $self->abstract;
            $args->{AUTHOR}   = join ', ', @{$self->author || []};
    }
    if ( $self->makemaker(6.10) ) {
            $args->{NO_META}   = 1;
            #$args->{NO_MYMETA} = 1;
    }

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

272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
}
unless ( $self->is_admin ) {
        delete $args->{SIGN};
}
if ( $self->makemaker(6.31) and $self->license ) {
        $args->{LICENSE} = $self->license;
}
 
my $prereq = ($args->{PREREQ_PM} ||= {});
%$prereq = ( %$prereq,
        map { @$_ } # flatten [module => version]
        map { @$_ }
        grep $_,
        ($self->requires)
);
 
# Remove any reference to perl, PREREQ_PM doesn't support it
delete $args->{PREREQ_PM}->{perl};
 
# 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, add it to Makefile DIR
my $subdirs = ($args->{DIR} || []);
if ($self->bundles) {

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

332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
        if ( $self->makemaker(6.48) ) {
                $args->{MIN_PERL_VERSION} = $perl_version;
        }
}
 
if ($self->installdirs) {
        warn qq{old INSTALLDIRS (probably set by makemaker_args) is overriden by installdirs\n} if $args->{INSTALLDIRS};
        $args->{INSTALLDIRS} = $self->installdirs;
}
 
my %args = map {
        ( $_ => $args->{$_} ) } grep {defined($args->{$_} )
} keys %$args;
 
my $user_preop = delete $args{dist}->{PREOP};
if ( my $preop = $self->admin->preop($user_preop) ) {
        foreach my $key ( keys %$preop ) {
                $args{dist}->{$key} = $preop->{$key};
        }
}

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

82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
                push @{$self->{values}->{$key}}, @_;
                return $self;
        };
}
 
foreach my $key ( @resource_keys ) {
        *$key = sub {
                my $self = shift;
                unless ( @_ ) {
                        return () unless $self->{values}->{resources};
                        return map  { $_->[1] }
                               grep { $_->[0] eq $key }
                               @{ $self->{values}->{resources} };
                }
                return $self->{values}->{resources}->{$key} unless @_;
                my $uri = shift or die(
                        "Did not provide a value to $key()"
                );
                $self->resources( $key => $uri );
                return 1;
        };

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

106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
        *$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
my %lc_resource = map { $_ => 1 } qw{
        homepage
        license
        bugtracker
        repository
};
 
sub resources {
        my $self = shift;
        while ( @_ ) {
                my $name  = shift or last;

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

258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
                # The user used ->feature like ->features by passing in the second
                # argument as a reference.  Accomodate for that.
                $mods = $_[0];
        } else {
                $mods = \@_;
        }
 
        my $count = 0;
        push @$features, (
                $name => [
                        map {
                                ref($_) ? ( ref($_) eq 'HASH' ) ? %$_ : @$_ : $_
                        } @$mods
                ]
        );
 
        return @$features;
}
 
sub features {
        my $self = shift;

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

398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
        ([^\n]*)
        |
        =head \d \s+ (?:licen[cs]e|licensing|copyright|legal)\b \s*
        .*? copyright .*? \d\d\d[\d.]+ \s* (?:\bby\b)? \s*
        ([^\n]*)
/ixms) {
        my $author = $1 || $2;
 
        # XXX: ugly but should work anyway...
        if (eval "require Pod::Escapes; 1") {
                # Pod::Escapes has a mapping table.
                # It's in core of perl >= 5.9.3, and should be installed
                # as one of the Pod::Simple's prereqs, which is a prereq
                # of Pod::Text 3.x (see also below).
                $author =~ s{ E<( (\d+) | ([A-Za-z]+) )> }
                {
                        defined $2
                        ? chr($2)
                        : defined $Pod::Escapes::Name2character_number{$1}
                        ? chr($Pod::Escapes::Name2character_number{$1})
                        : do {
                                warn "Unknown escape: E<$1>";
                                "E<$1>";
                        };
                }gex;
        }
        elsif (eval "require Pod::Text; 1" && $Pod::Text::VERSION < 3) {
                # Pod::Text < 3.0 has yet another mapping table,
                # though the table name of 2.x and 1.x are different.
                # (1.x is in core of Perl < 5.6, 2.x is in core of
                # Perl < 5.9.3)
                my $mapping = ($Pod::Text::VERSION < 2)
                        ? \%Pod::Text::HTML_Escapes
                        : \%Pod::Text::ESCAPES;
                $author =~ s{ E<( (\d+) | ([A-Za-z]+) )> }
                {
                        defined $2
                        ? chr($2)
                        : defined $mapping->{$1}
                        ? $mapping->{$1}
                        : do {
                                warn "Unknown escape: E<$1>";
                                "E<$1>";
                        };
                }gex;
        }
        else {
                $author =~ s{E<lt>}{<}g;
                $author =~ s{E<gt>}{>}g;
        }

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

703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
        # Load the advisory META.yml file
        my @yaml = Parse::CPAN::Meta::LoadFile('META.yml');
        my $meta = $yaml[0];
 
        # Overwrite the non-configure dependency hashes
        delete $meta->{requires};
        delete $meta->{build_requires};
        delete $meta->{recommends};
        if ( exists $val->{requires} ) {
                $meta->{requires} = { map { @$_ } @{ $val->{requires} } };
        }
        if ( exists $val->{build_requires} ) {
                $meta->{build_requires} = { map { @$_ } @{ $val->{build_requires} } };
        }
 
        return $meta;
}
 
1;



( run in 0.279 second using v1.01-cache-2.11-cpan-bb97c1e446a )