CPAN-Inject
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# we shouldn't really depend on it. See RT #24194 for detail.
# (Also, this module only supports Perl 5.6 and above).
eval "use Win32::UTCFileTime" if $^O eq 'MSWin32' && $] >= 5.006;
# If the script that is loading Module::Install is from the future,
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
# Too far in the future, throw an error.
my $t = time;
if ( $s > $t ) { die <<"END_DIE" }
lib/CPAN/Inject.pm view on Meta::CPAN
# Unless someone set it to a hard-coded value before we
# started to load this module.
unless ( defined $CHECK_OWNER ) {
# Take a directory we know should exist...
my $root = File::Spec->rootdir();
unless ( -d $root ) {
die "Cannot determine if CPAN::Inject can operate on this platform";
}
# ... find the owner for it...
my $owner = File::stat::stat($root)->uid;
# ... and if it works, check again in the future.
# Unless someone set it already, in which case
$CHECK_OWNER = defined $owner ? 1 : '';
}
# And boolify the value, just to be a little safer
$CHECK_OWNER = !! $CHECK_OWNER;
}
lib/CPAN/Inject.pm view on Meta::CPAN
unless ( -d $parent ) {
Carp::croak("The directory '$sources' does not exist");
}
unless ( -r $parent and -x $parent ) {
# Assume that it does exist, but that we can't see it
Carp::croak("The sources directory is not owned by the current user");
}
}
Carp::croak("The directory '$sources' does not exist");
}
unless ( $< == File::stat::stat($sources)->uid ) {
Carp::croak("The sources directory is not owned by the current user");
}
# Check for a default author name
$self->{author} = 'LOCAL' unless $self->author;
unless ( _AUTHOR( $self->author ) ) {
Carp::croak( "The author name '"
. $self->author
. "' is not a valid author string"
);
( run in 1.480 second using v1.01-cache-2.11-cpan-49f99fa48dc )