* Add a version number to manifests.
This commit is contained in:
parent
8d3c346559
commit
8376fff151
3 changed files with 16 additions and 2 deletions
|
|
@ -41,6 +41,8 @@ sub readManifest {
|
|||
my $inside = 0;
|
||||
my $type;
|
||||
|
||||
my $manifestVersion = 2;
|
||||
|
||||
my $storePath;
|
||||
my $url;
|
||||
my $hash;
|
||||
|
|
@ -139,6 +141,7 @@ sub readManifest {
|
|||
elsif (/^\s*NarHash:\s*(\S+)\s*$/) { $narHash = $1; }
|
||||
elsif (/^\s*References:\s*(.*)\s*$/) { $references = $1; }
|
||||
elsif (/^\s*Deriver:\s*(\S+)\s*$/) { $deriver = $1; }
|
||||
elsif (/^\s*ManifestVersion:\s*(\d+)\s*$/) { $manifestVersion = $1; }
|
||||
|
||||
# Compatibility;
|
||||
elsif (/^\s*NarURL:\s*(\S+)\s*$/) { $url = $1; }
|
||||
|
|
@ -148,6 +151,8 @@ sub readManifest {
|
|||
}
|
||||
|
||||
close MANIFEST;
|
||||
|
||||
return $manifestVersion;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -159,6 +164,10 @@ sub writeManifest
|
|||
|
||||
open MANIFEST, ">$manifest.tmp"; # !!! check exclusive
|
||||
|
||||
print MANIFEST "version {\n";
|
||||
print MANIFEST " ManifestVersion: 3\n";
|
||||
print MANIFEST "}\n";
|
||||
|
||||
foreach my $storePath (keys %{$narFiles}) {
|
||||
my $narFileList = $$narFiles{$storePath};
|
||||
foreach my $narFile (@{$narFileList}) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue