* Print out less garbage.

This commit is contained in:
Eelco Dolstra 2005-01-12 10:37:18 +00:00
parent 7d75616f2c
commit 0bc41f632b
1 changed files with 10 additions and 8 deletions

View File

@ -17,6 +17,8 @@ my $date = `date`;
chomp $date; chomp $date;
print LOGFILE "$$ get $targetPath $date\n"; print LOGFILE "$$ get $targetPath $date\n";
print "\n*** Trying to download/patch `$targetPath'\n";
# Load all manifests. # Load all manifests.
my %narFiles; my %narFiles;
@ -24,7 +26,7 @@ my %patches;
my %successors; my %successors;
for my $manifest (glob "$manifestDir/*.nixmanifest") { for my $manifest (glob "$manifestDir/*.nixmanifest") {
print STDERR "reading $manifest\n"; # print STDERR "reading $manifest\n";
readManifest $manifest, \%narFiles, \%patches, \%successors; readManifest $manifest, \%narFiles, \%patches, \%successors;
} }
@ -77,7 +79,7 @@ sub isValidPath {
while ($queueFront < scalar @queue) { while ($queueFront < scalar @queue) {
my $u = $queue[$queueFront++]; my $u = $queue[$queueFront++];
print "$u\n"; # print "$u\n";
addNode $u; addNode $u;
@ -96,13 +98,13 @@ while ($queueFront < scalar @queue) {
# !!! this should be cached # !!! this should be cached
my $hash = `nix-hash "$patch->{basePath}"`; my $hash = `nix-hash "$patch->{basePath}"`;
chomp $hash; chomp $hash;
print " MY HASH is $hash\n"; # print " MY HASH is $hash\n";
if ($hash ne $patch->{baseHash}) { if ($hash ne $patch->{baseHash}) {
print " REJECTING PATCH from $patch->{basePath}\n"; print LOGFILE "$$ rejecting $patch->{basePath}\n";
next; next;
} }
} }
print " PATCH from $patch->{basePath}\n"; # print " PATCH from $patch->{basePath}\n";
addToQueue $patch->{basePath}; addToQueue $patch->{basePath};
addEdge $patch->{basePath}, $u, $patch->{size}, "patch", $patch; addEdge $patch->{basePath}, $u, $patch->{size}, "patch", $patch;
} }
@ -110,7 +112,7 @@ while ($queueFront < scalar @queue) {
# Add NAR file edges to the start node. # Add NAR file edges to the start node.
my $narFileList = $narFiles{$u}; my $narFileList = $narFiles{$u};
foreach my $narFile (@{$narFileList}) { foreach my $narFile (@{$narFileList}) {
print " NAR from $narFile->{url}\n"; # print " NAR from $narFile->{url}\n";
addEdge "start", $u, $narFile->{size}, "narfile", $narFile; addEdge "start", $u, $narFile->{size}, "narfile", $narFile;
if ($u eq $targetPath) { if ($u eq $targetPath) {
print LOGFILE "$$ full-download-would-be $narFile->{size}\n"; print LOGFILE "$$ full-download-would-be $narFile->{size}\n";
@ -139,7 +141,7 @@ while (scalar @todo > 0) {
my $u_ = $graph{$u}; my $u_ = $graph{$u};
print "IN $u $u_->{d}\n"; # print "IN $u $u_->{d}\n";
foreach my $edge (@{$u_->{edges}}) { foreach my $edge (@{$u_->{edges}}) {
my $v_ = $graph{$edge->{end}}; my $v_ = $graph{$edge->{end}};
@ -148,7 +150,7 @@ while (scalar @todo > 0) {
# Store the edge; to edge->start is actually the # Store the edge; to edge->start is actually the
# predecessor. # predecessor.
$v_->{pred} = $edge; $v_->{pred} = $edge;
print " RELAX $edge->{end} $v_->{d}\n"; # print " RELAX $edge->{end} $v_->{d}\n";
} }
} }
} }