Acme-Test-Weather
view release on metacpan or search on metacpan
CPAN/MakeMaker.pm view on Meta::CPAN
if (@modules == 1) {
open MODULE, $modules[0] or die $!;
while (<MODULE>) {
next if /^\s*#/;
if (/^\s*package\s+(\w[\w:]*)\s*;\s*$/) {
$NAME = $1;
}
last;
}
}
die <<END unless length($NAME);
Can't determine a NAME for this distribution.
Please pass a NAME parameter to the WriteMakefile function in Makefile.PL.
END
return $NAME;
}
sub find_files {
my ($file, $path) = @_;
$path = '' if not defined $path;
$file = "$path/$file" if length($path);
if (-f $file) {
return ($file);
}
elsif (-d $file) {
my @files = ();
local *DIR;
opendir(DIR, $file) or die "Can't opendir $file";
while (my $new_file = readdir(DIR)) {
next if $new_file =~ /^(\.|\.\.)$/;
push @files, find_files($new_file, $file);
CPAN/MakeMaker.pm view on Meta::CPAN
sub determine_VERSION {
my $VERSION = '';
my @modules = glob('*.pm'), grep {/\.pm$/} find_files('lib');
if (@modules == 1) {
eval {
$VERSION = ExtUtils::MM_Unix->parse_version($modules[0]);
};
print STDERR $@ if $@;
}
die <<END unless length($VERSION);
Can't determine a VERSION for this distribution.
Please pass a VERSION parameter to the WriteMakefile function in Makefile.PL.
END
return $VERSION;
}
sub update_manifest {
my ($manifest, $manifest_path, $relative_path) = read_manifest();
my $manifest_changed = 0;
CPAN/MakeMaker.pm view on Meta::CPAN
my $path = $_;
chomp $path;
$path =~ s/^\.[\\\/]//;
$path =~ s/[\\\/]/\//g;
$manifest{$path} = 1;
}
for (find_files('CPAN')) {
my $filepath = $_;
$filepath = "$relative_path/$filepath"
if length($relative_path);
unless (defined $manifest{$filepath}) {
PRINT 'Updating your MANIFEST file:'
unless $manifest_changed++;
PRINT " Adding '$filepath'";
push @$manifest, "$filepath\n";
$manifest{$filepath} = 1;
}
}
if ($manifest_changed) {
CPAN/MakeMaker.pm view on Meta::CPAN
my @cwd_dirs = File::Spec->splitdir($cwd);
while (@cwd_dirs) {
last unless -f File::Spec->catfile(@cwd_dirs, 'Makefile.PL');
my $path = File::Spec->catfile(@cwd_dirs, 'MANIFEST');
if (-f $path) {
$manifest_path = $path;
last;
}
unshift @relative_dirs, pop(@cwd_dirs);
}
unless (length($manifest_path)) {
die "Can't locate the MANIFEST file for '$cwd'\n";
}
$relative_path = join '/', @relative_dirs
if @relative_dirs;
open MANIFEST, $manifest_path
or die "Can't open $manifest_path for input:\n$!";
@$manifest = <MANIFEST>;
close MANIFEST;
( run in 0.747 second using v1.01-cache-2.11-cpan-65fba6d93b7 )