27 |
warn "created: $path ", -s $path, "bytes\n"; |
warn "created: $path ", -s $path, "bytes\n"; |
28 |
} |
} |
29 |
|
|
|
|
|
30 |
die "please copy repository on which to perfrom operation to $from\n" if ( ! -e $from ); |
die "please copy repository on which to perfrom operation to $from\n" if ( ! -e $from ); |
31 |
|
|
32 |
warn "collect all paths from repository $from\n"; |
warn "collect all paths from repository $from\n"; |
37 |
die "created $tl\nplease edit it to reflect new layout\n"; |
die "created $tl\nplease edit it to reflect new layout\n"; |
38 |
} |
} |
39 |
|
|
40 |
|
my $map; |
41 |
|
|
42 |
|
open(my $fhf, '<', $fl ) || die "can't open $fl: $!"; |
43 |
|
open(my $fht, '<', $tl ) || die "can't open $tl: $!"; |
44 |
|
while( my $lf = <$fhf> ) { |
45 |
|
chomp($lf); |
46 |
|
my $lt = <$fht> || die "list shorter, probably corrupt: $tl\n"; |
47 |
|
chomp($lt); |
48 |
|
$map->{$lf} = $lt; |
49 |
|
} |
50 |
|
|
51 |
if ( -e $to ) { |
if ( -e $to ) { |
52 |
#die "$to allready exists! remove it to re-create repository\n"; |
#die "$to allready exists! remove it to re-create repository\n"; |
53 |
rm('-Rf',$to); |
rm('-Rf',$to); |
69 |
} |
} |
70 |
|
|
71 |
my $path = $rec->get_header('Node-path'); |
my $path = $rec->get_header('Node-path'); |
72 |
warn "##> $path\n" if $path; |
if ( $path && defined( $map->{$path} ) ) { |
73 |
|
my $to = $map->{$path}; |
74 |
|
warn "##> $path -> $to\n"; |
75 |
|
$rec->set_header('Node-path', $to); |
76 |
|
} |
77 |
|
|
78 |
print $fh_out $rec->as_string(); |
print $fh_out $rec->as_string(); |
79 |
} |
} |