aboutsummaryrefslogtreecommitdiff
path: root/scripts/readmanifest.pm.in
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2005-02-25 16:12:52 +0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2005-02-25 16:12:52 +0000
commit8376fff1518415a0d48b34e91298c846b0ab6b95 (patch)
tree420286ca633ceb7c21ed6417cb7aeb5fbe9de01b /scripts/readmanifest.pm.in
parent8d3c346559a2528e4606d8a5b61c8a4d5457697d (diff)
* Add a version number to manifests.
Diffstat (limited to 'scripts/readmanifest.pm.in')
-rw-r--r--scripts/readmanifest.pm.in9
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/readmanifest.pm.in b/scripts/readmanifest.pm.in
index fa4ac65ac..3ecb81f8f 100644
--- a/scripts/readmanifest.pm.in
+++ b/scripts/readmanifest.pm.in
@@ -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}) {