* Successors have been gone for ages.
This commit is contained in:
parent
7bc30e1ca8
commit
36d9258c0d
|
@ -35,11 +35,10 @@ print "\n*** Trying to download/patch `$targetPath'\n";
|
|||
# Load all manifests.
|
||||
my %narFiles;
|
||||
my %patches;
|
||||
my %successors;
|
||||
|
||||
for my $manifest (glob "$manifestDir/*.nixmanifest") {
|
||||
# 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";
|
||||
exit 1;
|
||||
}
|
||||
|
|
|
@ -29,22 +29,19 @@ print "TEMP = $tmpDir\n";
|
|||
|
||||
my %srcNarFiles;
|
||||
my %srcPatches;
|
||||
my %srcSuccessors;
|
||||
|
||||
my %dstNarFiles;
|
||||
my %dstPatches;
|
||||
my %dstSuccessors;
|
||||
|
||||
readManifest "$srcDir/MANIFEST",
|
||||
\%srcNarFiles, \%srcPatches, \%srcSuccessors;
|
||||
\%srcNarFiles, \%srcPatches;
|
||||
|
||||
readManifest "$dstDir/MANIFEST",
|
||||
\%dstNarFiles, \%dstPatches, \%dstSuccessors;
|
||||
\%dstNarFiles, \%dstPatches;
|
||||
|
||||
|
||||
sub findOutputPaths {
|
||||
my $narFiles = shift;
|
||||
my $successors = shift;
|
||||
|
||||
my %outPaths;
|
||||
|
||||
|
@ -69,10 +66,10 @@ sub findOutputPaths {
|
|||
}
|
||||
|
||||
print "finding src output paths...\n";
|
||||
my %srcOutPaths = findOutputPaths \%srcNarFiles, \%srcSuccessors;
|
||||
my %srcOutPaths = findOutputPaths \%srcNarFiles;
|
||||
|
||||
print "finding dst output paths...\n";
|
||||
my %dstOutPaths = findOutputPaths \%dstNarFiles, \%dstSuccessors;
|
||||
my %dstOutPaths = findOutputPaths \%dstNarFiles;
|
||||
|
||||
|
||||
sub getNameVersion {
|
||||
|
@ -400,4 +397,4 @@ do {
|
|||
|
||||
# Rewrite the manifest of the destination (with the new patches).
|
||||
writeManifest "$dstDir/MANIFEST",
|
||||
\%dstNarFiles, \%dstPatches, \%dstSuccessors;
|
||||
\%dstNarFiles, \%dstPatches;
|
||||
|
|
|
@ -8,11 +8,10 @@ use readcache;
|
|||
# Read the manifests.
|
||||
my %narFiles;
|
||||
my %patches;
|
||||
my %successors;
|
||||
|
||||
foreach my $manifest (@ARGV) {
|
||||
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";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,11 +7,10 @@ use readcache;
|
|||
|
||||
my %allNarFiles;
|
||||
my %allPatches;
|
||||
my %allSuccessors;
|
||||
|
||||
foreach my $manifest (glob "/data/webserver/dist/*/*/MANIFEST") {
|
||||
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 %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";
|
||||
next;
|
||||
}
|
||||
|
|
|
@ -29,7 +29,6 @@ umask 0022;
|
|||
# Process the URLs specified on the command line.
|
||||
my %narFiles;
|
||||
my %patches;
|
||||
my %successors;
|
||||
|
||||
my $skipWrongStore = 0;
|
||||
|
||||
|
@ -43,7 +42,7 @@ sub processURL {
|
|||
"'$url' > '$manifest'") == 0
|
||||
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";
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,6 @@ sub readManifest {
|
|||
my $manifest = shift;
|
||||
my $narFiles = shift;
|
||||
my $patches = shift;
|
||||
my $successors = shift;
|
||||
my $allowConflicts = shift;
|
||||
$allowConflicts = 0 unless defined $allowConflicts;
|
||||
|
||||
|
@ -51,7 +50,6 @@ sub readManifest {
|
|||
my $url;
|
||||
my $hash;
|
||||
my $size;
|
||||
my @preds;
|
||||
my $basePath;
|
||||
my $baseHash;
|
||||
my $patchType;
|
||||
|
@ -75,7 +73,6 @@ sub readManifest {
|
|||
undef $url;
|
||||
undef $hash;
|
||||
undef $size;
|
||||
@preds = ();
|
||||
undef $narHash;
|
||||
undef $basePath;
|
||||
undef $baseHash;
|
||||
|
@ -117,10 +114,6 @@ sub readManifest {
|
|||
};
|
||||
}
|
||||
|
||||
foreach my $p (@preds) {
|
||||
$$successors{$p} = $storePath;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
elsif ($type eq "patch") {
|
||||
|
@ -138,7 +131,7 @@ sub readManifest {
|
|||
elsif (/^\s*Hash:\s*(\S+)\s*$/) { $hash = $1; }
|
||||
elsif (/^\s*URL:\s*(\S+)\s*$/) { $url = $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*BaseHash:\s*(\S+)\s*$/) { $baseHash = $1; }
|
||||
elsif (/^\s*Type:\s*(\S+)\s*$/) { $patchType = $1; }
|
||||
|
|
|
@ -7,13 +7,12 @@ for my $p (@ARGV) {
|
|||
|
||||
my %narFiles;
|
||||
my %patches;
|
||||
my %successors;
|
||||
|
||||
readManifest $p,
|
||||
\%narFiles, \%patches, \%successors;
|
||||
\%narFiles, \%patches;
|
||||
|
||||
%patches = ();
|
||||
|
||||
writeManifest $p,
|
||||
\%narFiles, \%patches, \%successors;
|
||||
\%narFiles, \%patches;
|
||||
}
|
||||
|
|
|
@ -9,9 +9,8 @@ my $cache = $ARGV[0];
|
|||
my $manifest = $ARGV[1];
|
||||
my %narFiles;
|
||||
my %patches;
|
||||
my %successors;
|
||||
|
||||
readManifest $manifest, \%narFiles, \%patches, \%successors;
|
||||
readManifest $manifest, \%narFiles, \%patches;
|
||||
|
||||
foreach my $storePath (keys %narFiles) {
|
||||
my $narFileList = $narFiles{$storePath};
|
||||
|
@ -50,4 +49,4 @@ if (! -e "$manifest.backup") {
|
|||
system "mv --reply=no '$manifest' '$manifest.backup'";
|
||||
}
|
||||
|
||||
writeManifest $manifest, \%narFiles, \%patches, \%successors;
|
||||
writeManifest $manifest, \%narFiles, \%patches;
|
||||
|
|
Loading…
Reference in a new issue