2007-01-23 15:34:44 +01:00
|
|
|
use strict;
|
2007-01-23 18:17:10 +01:00
|
|
|
use File::Basename;
|
2007-01-23 15:34:44 +01:00
|
|
|
|
|
|
|
my %storePaths;
|
2007-01-23 16:08:00 +01:00
|
|
|
my %refs;
|
2007-01-23 15:34:44 +01:00
|
|
|
|
|
|
|
foreach my $graph (@ARGV) {
|
|
|
|
open GRAPH, "<$graph" or die;
|
|
|
|
|
|
|
|
while (<GRAPH>) {
|
|
|
|
chomp;
|
|
|
|
my $storePath = "$_";
|
|
|
|
$storePaths{$storePath} = 1;
|
|
|
|
|
|
|
|
my $deriver = <GRAPH>; chomp $deriver;
|
|
|
|
my $count = <GRAPH>; chomp $count;
|
|
|
|
|
2007-01-23 16:08:00 +01:00
|
|
|
my @refs = ();
|
2007-01-23 15:34:44 +01:00
|
|
|
for (my $i = 0; $i < $count; ++$i) {
|
2007-01-23 16:08:00 +01:00
|
|
|
my $ref = <GRAPH>; chomp $ref;
|
|
|
|
push @refs, $ref;
|
2007-01-23 15:34:44 +01:00
|
|
|
}
|
2007-01-23 16:08:00 +01:00
|
|
|
$refs{$storePath} = \@refs;
|
|
|
|
|
2007-01-23 15:34:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
close GRAPH;
|
|
|
|
}
|
|
|
|
|
2007-01-23 16:08:00 +01:00
|
|
|
|
|
|
|
if ($ENV{"printManifest"} eq "1") {
|
|
|
|
print "version {\n";
|
|
|
|
print " ManifestVersion: 3\n";
|
|
|
|
print "}\n";
|
|
|
|
|
|
|
|
foreach my $storePath (sort (keys %storePaths)) {
|
2007-01-23 18:17:10 +01:00
|
|
|
my $base = basename $storePath;
|
2007-01-23 17:48:27 +01:00
|
|
|
print "localPath {\n";
|
2007-01-23 16:08:00 +01:00
|
|
|
print " StorePath: $storePath\n";
|
2007-01-23 18:17:10 +01:00
|
|
|
print " CopyFrom: /tmp/inst-store/$base\n";
|
2007-01-23 16:08:00 +01:00
|
|
|
print " References: ";
|
|
|
|
foreach my $ref (@{$refs{$storePath}}) {
|
|
|
|
print "$ref ";
|
|
|
|
}
|
|
|
|
print "\n";
|
|
|
|
print "}\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
foreach my $storePath (sort (keys %storePaths)) {
|
|
|
|
print "$storePath\n";
|
|
|
|
}
|
2007-01-23 15:34:44 +01:00
|
|
|
}
|