* Successors have been gone for ages.

This commit is contained in:
Eelco Dolstra 2007-01-23 16:05:59 +00:00
parent 7bc30e1ca8
commit 36d9258c0d
8 changed files with 15 additions and 32 deletions

View File

@ -35,11 +35,10 @@ print "\n*** Trying to download/patch `$targetPath'\n";
# Load all manifests. # Load all manifests.
my %narFiles; my %narFiles;
my %patches; my %patches;
my %successors;
for my $manifest (glob "$manifestDir/*.nixmanifest") { for my $manifest (glob "$manifestDir/*.nixmanifest") {
# print STDERR "reading $manifest\n"; # print STDERR "reading $manifest\n";
if (readManifest($manifest, \%narFiles, \%patches, \%successors) < 3) { if (readManifest($manifest, \%narFiles, \%patches) < 3) {
print STDERR "you have an old-style manifest `$manifest'; please delete it\n"; print STDERR "you have an old-style manifest `$manifest'; please delete it\n";
exit 1; exit 1;
} }

View File

@ -29,22 +29,19 @@ print "TEMP = $tmpDir\n";
my %srcNarFiles; my %srcNarFiles;
my %srcPatches; my %srcPatches;
my %srcSuccessors;
my %dstNarFiles; my %dstNarFiles;
my %dstPatches; my %dstPatches;
my %dstSuccessors;
readManifest "$srcDir/MANIFEST", readManifest "$srcDir/MANIFEST",
\%srcNarFiles, \%srcPatches, \%srcSuccessors; \%srcNarFiles, \%srcPatches;
readManifest "$dstDir/MANIFEST", readManifest "$dstDir/MANIFEST",
\%dstNarFiles, \%dstPatches, \%dstSuccessors; \%dstNarFiles, \%dstPatches;
sub findOutputPaths { sub findOutputPaths {
my $narFiles = shift; my $narFiles = shift;
my $successors = shift;
my %outPaths; my %outPaths;
@ -69,10 +66,10 @@ sub findOutputPaths {
} }
print "finding src output paths...\n"; print "finding src output paths...\n";
my %srcOutPaths = findOutputPaths \%srcNarFiles, \%srcSuccessors; my %srcOutPaths = findOutputPaths \%srcNarFiles;
print "finding dst output paths...\n"; print "finding dst output paths...\n";
my %dstOutPaths = findOutputPaths \%dstNarFiles, \%dstSuccessors; my %dstOutPaths = findOutputPaths \%dstNarFiles;
sub getNameVersion { sub getNameVersion {
@ -400,4 +397,4 @@ do {
# Rewrite the manifest of the destination (with the new patches). # Rewrite the manifest of the destination (with the new patches).
writeManifest "$dstDir/MANIFEST", writeManifest "$dstDir/MANIFEST",
\%dstNarFiles, \%dstPatches, \%dstSuccessors; \%dstNarFiles, \%dstPatches;

View File

@ -8,11 +8,10 @@ use readcache;
# Read the manifests. # Read the manifests.
my %narFiles; my %narFiles;
my %patches; my %patches;
my %successors;
foreach my $manifest (@ARGV) { foreach my $manifest (@ARGV) {
print STDERR "loading $manifest\n"; print STDERR "loading $manifest\n";
if (readManifest($manifest, \%narFiles, \%patches, \%successors, 1) < 3) { if (readManifest($manifest, \%narFiles, \%patches, 1) < 3) {
# die "manifest `$manifest' is too old (i.e., for Nix <= 0.7)\n"; # die "manifest `$manifest' is too old (i.e., for Nix <= 0.7)\n";
} }
} }

View File

@ -7,11 +7,10 @@ use readcache;
my %allNarFiles; my %allNarFiles;
my %allPatches; my %allPatches;
my %allSuccessors;
foreach my $manifest (glob "/data/webserver/dist/*/*/MANIFEST") { foreach my $manifest (glob "/data/webserver/dist/*/*/MANIFEST") {
print STDERR "loading $manifest\n"; print STDERR "loading $manifest\n";
readManifest($manifest, \%allNarFiles, \%allPatches, \%allSuccessors, 1); readManifest($manifest, \%allNarFiles, \%allPatches, 1);
} }
@ -22,9 +21,8 @@ foreach my $manifest (@ARGV) {
my %narFiles; my %narFiles;
my %patches; my %patches;
my %successors;
if (readManifest($manifest, \%narFiles, \%patches, \%successors, 1) < 3) { if (readManifest($manifest, \%narFiles, \%patches, 1) < 3) {
print STDERR "manifest `$manifest' is too old (i.e., for Nix <= 0.7)\n"; print STDERR "manifest `$manifest' is too old (i.e., for Nix <= 0.7)\n";
next; next;
} }

View File

@ -29,7 +29,6 @@ umask 0022;
# Process the URLs specified on the command line. # Process the URLs specified on the command line.
my %narFiles; my %narFiles;
my %patches; my %patches;
my %successors;
my $skipWrongStore = 0; my $skipWrongStore = 0;
@ -43,7 +42,7 @@ sub processURL {
"'$url' > '$manifest'") == 0 "'$url' > '$manifest'") == 0
or die "curl failed: $?"; or die "curl failed: $?";
if (readManifest($manifest, \%narFiles, \%patches, \%successors) < 3) { if (readManifest($manifest, \%narFiles, \%patches) < 3) {
die "manifest `$url' is too old (i.e., for Nix <= 0.7)\n"; die "manifest `$url' is too old (i.e., for Nix <= 0.7)\n";
} }

View File

@ -35,7 +35,6 @@ sub readManifest {
my $manifest = shift; my $manifest = shift;
my $narFiles = shift; my $narFiles = shift;
my $patches = shift; my $patches = shift;
my $successors = shift;
my $allowConflicts = shift; my $allowConflicts = shift;
$allowConflicts = 0 unless defined $allowConflicts; $allowConflicts = 0 unless defined $allowConflicts;
@ -51,7 +50,6 @@ sub readManifest {
my $url; my $url;
my $hash; my $hash;
my $size; my $size;
my @preds;
my $basePath; my $basePath;
my $baseHash; my $baseHash;
my $patchType; my $patchType;
@ -75,7 +73,6 @@ sub readManifest {
undef $url; undef $url;
undef $hash; undef $hash;
undef $size; undef $size;
@preds = ();
undef $narHash; undef $narHash;
undef $basePath; undef $basePath;
undef $baseHash; undef $baseHash;
@ -117,10 +114,6 @@ sub readManifest {
}; };
} }
foreach my $p (@preds) {
$$successors{$p} = $storePath;
}
} }
elsif ($type eq "patch") { elsif ($type eq "patch") {
@ -138,7 +131,7 @@ sub readManifest {
elsif (/^\s*Hash:\s*(\S+)\s*$/) { $hash = $1; } elsif (/^\s*Hash:\s*(\S+)\s*$/) { $hash = $1; }
elsif (/^\s*URL:\s*(\S+)\s*$/) { $url = $1; } elsif (/^\s*URL:\s*(\S+)\s*$/) { $url = $1; }
elsif (/^\s*Size:\s*(\d+)\s*$/) { $size = $1; } elsif (/^\s*Size:\s*(\d+)\s*$/) { $size = $1; }
elsif (/^\s*SuccOf:\s*(\/\S+)\s*$/) { push @preds, $1; } elsif (/^\s*SuccOf:\s*(\/\S+)\s*$/) { } # obsolete
elsif (/^\s*BasePath:\s*(\/\S+)\s*$/) { $basePath = $1; } elsif (/^\s*BasePath:\s*(\/\S+)\s*$/) { $basePath = $1; }
elsif (/^\s*BaseHash:\s*(\S+)\s*$/) { $baseHash = $1; } elsif (/^\s*BaseHash:\s*(\S+)\s*$/) { $baseHash = $1; }
elsif (/^\s*Type:\s*(\S+)\s*$/) { $patchType = $1; } elsif (/^\s*Type:\s*(\S+)\s*$/) { $patchType = $1; }

View File

@ -7,13 +7,12 @@ for my $p (@ARGV) {
my %narFiles; my %narFiles;
my %patches; my %patches;
my %successors;
readManifest $p, readManifest $p,
\%narFiles, \%patches, \%successors; \%narFiles, \%patches;
%patches = (); %patches = ();
writeManifest $p, writeManifest $p,
\%narFiles, \%patches, \%successors; \%narFiles, \%patches;
} }

View File

@ -9,9 +9,8 @@ my $cache = $ARGV[0];
my $manifest = $ARGV[1]; my $manifest = $ARGV[1];
my %narFiles; my %narFiles;
my %patches; my %patches;
my %successors;
readManifest $manifest, \%narFiles, \%patches, \%successors; readManifest $manifest, \%narFiles, \%patches;
foreach my $storePath (keys %narFiles) { foreach my $storePath (keys %narFiles) {
my $narFileList = $narFiles{$storePath}; my $narFileList = $narFiles{$storePath};
@ -50,4 +49,4 @@ if (! -e "$manifest.backup") {
system "mv --reply=no '$manifest' '$manifest.backup'"; system "mv --reply=no '$manifest' '$manifest.backup'";
} }
writeManifest $manifest, \%narFiles, \%patches, \%successors; writeManifest $manifest, \%narFiles, \%patches;