7 use File::Compare qw(compare);
8 use File::Copy qw(copy);
9 use File::Path qw(mkpath);
12 while (defined(my $arg = <>)) {
15 my $rel = File::Spec->file_name_is_absolute($arg)
16 ? File::Spec->abs2rel($arg, $ENV{HOME})
18 my $abs = File::Spec->rel2abs($rel, $ENV{HOME});
19 my $saved = rel2saved($rel);
22 print "SKIP: $rel is not in the repository.\n";
26 if (compare($abs, $saved) == 0) {
27 print "SKIP: $rel is identical to the copy in the repository.\n";
30 print "SKIP: $rel is different from the copy in the repository.\n";
34 print "Copying $saved to $abs...\n";
35 my @path = File::Spec->splitdir($abs);
37 mkpath(File::Spec->catdir(@path));
38 copy($saved, $abs) or die $!;