Merge pull request #15 from dr4Ke/mirror_to_hardlinked_directory

Fix skel (indexes) updates in a hardlinked mirror
pull/37/head
Benjamin Drung 9 years ago
commit b8e8051346
  1. 5
      apt-mirror

@ -90,6 +90,7 @@ Brandon Holtsclaw E<lt>me@brandonholtsclaw.comE<gt>
use warnings;
use strict;
use File::Copy;
use File::Compare;
use File::Path;
use File::Basename;
use Fcntl qw(:flock);
@ -777,6 +778,10 @@ sub copy_file
my $dir = dirname($to);
return unless -f $from;
mkpath($dir) unless -d $dir;
if ( get_variable("unlink") == 1 )
{
if (compare( $from, $to ) != 0) { unlink($to); }
}
unless ( copy( $from, $to ) )
{
warn("apt-mirror: can't copy $from to $to");

Loading…
Cancel
Save