App-DistSync
view release on metacpan or search on metacpan
lib/App/DistSync.pm view on Meta::CPAN
# [{] The "newer" file is the one in the local list
# [}] The "newer" file is the one in the remote list
# [~] The file sizes differ between the lists. This is only reported as information,
# since modification times and file presence have higher priority than sizes
# [!] A conflict situation. An almost impossible edge case
#
# The comparison works as follows:
# We iterate through the entries of the manifest structures (the left and right lists)
# and analyze where the counter value is 1 and where it is 2.
# A value of 1 means that the file exists in only one of the file lists - but in which one?
# If it's the left list, the line is marked with "<", as described in the legend above;
# if it's the right list, the line is marked with ">".
my $lim = _expire(LIMIT); # 1 min
foreach my $k (keys %mtmp) {
next unless $mtmp{$k}; # Skip broken records
next unless $mtmp{$k} == 1; # Files are NOT idential
if ($manifest->{$k} && $remote_manifest->{$k}) { # Both sides: left and right
my $mt_l = $manifest->{$k}[0] || 0;
my $mt_r = $remote_manifest->{$k}[0] || 0;
if (($mt_l > $mt_r) && ($mt_l - $mt_r) > $lim) {
# Skip! The left (local) file is more than one minute newer than the right one
( run in 0.595 second using v1.01-cache-2.11-cpan-9e8f1244128 )