App-DistSync
view release on metacpan or search on metacpan
lib/App/DistSync.pm view on Meta::CPAN
$props{file_mirrors} = File::Spec->catfile($dir, MIRRORS);
$props{file_readme} = File::Spec->catfile($dir, README);
$props{file_temp} = File::Spec->catfile(File::Spec->tmpdir(), TEMPFILE);
# Read META file as YAML
my $meta = read_yaml($props{file_meta});
$props{meta} = $meta;
# Create current static dates
$props{mtime_manifest} = (-e $props{file_manifest}) && -s $props{file_manifest}
? (stat($props{file_manifest}))[9]
: 0;
$props{mtime_manidel} = (-e $props{file_manidel}) && -s $props{file_manidel}
? (stat($props{file_manidel}))[9]
: 0;
$props{mtime_mirrors} = (-e $props{file_mirrors}) && -s $props{file_mirrors}
? (stat($props{file_mirrors}))[9]
: 0;
# Set TimeOut
my $to = _expire($props{timeout} // TIMEOUT);
croak("Can't use specified timeout") unless $to =~ /^[0-9]{1,11}$/;
# Instance
my $self = bless({%props}, $class);
# User Agent
lib/App/DistSync/Util.pm view on Meta::CPAN
#my ($volume,$sdirs,$sfile) = File::Spec->splitpath( $base );
my $wanted = sub {
my $path = File::Spec->canonpath($_);
my $name = File::Spec->abs2rel( $path, $base );
my $fdir = File::Spec->canonpath($File::Find::dir);
return if -d $_;
my $key = join("/", File::Spec->splitdir(File::Spec->catfile($name)));
$found->{$key} = {
mtime => (stat($_))[9] || 0,
size => (-s $_) || 0,
dir => $fdir,
path => $path,
file => File::Spec->abs2rel( $path, $fdir ),
};
};
# We have to use "$File::Find::dir/$_" in preprocess, because
# $File::Find::name is unavailable.
# Also, it's okay to use / here, because MANIFEST files use Unix-style
( run in 0.660 second using v1.01-cache-2.11-cpan-5f4f29bf90f )