about summary refs log tree commit diff
path: root/scripts/readmanifest.pm.in
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2007-01-23T16·50+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2007-01-23T16·50+0000
commitbae75ca5a18edbb9fb959e2e48065a1987ffb61a (patch)
treec1b169f6f290cb1e4c412a61051dd3a1ee987bc5 /scripts/readmanifest.pm.in
parent36d9258c0dbfeab095dc5727b6ebcb55afacb0a6 (diff)
* New kind of manifest object: "localPath", which denotes that a store
  path can be created by copying it from another location in the file
  system.  This is useful in the NixOS installation.

Diffstat (limited to 'scripts/readmanifest.pm.in')
-rw-r--r--scripts/readmanifest.pm.in19
1 files changed, 19 insertions, 0 deletions
diff --git a/scripts/readmanifest.pm.in b/scripts/readmanifest.pm.in
index 0e15133cf121..1d44444700ee 100644
--- a/scripts/readmanifest.pm.in
+++ b/scripts/readmanifest.pm.in
@@ -34,6 +34,7 @@ sub addPatch {
 sub readManifest {
     my $manifest = shift;
     my $narFiles = shift;
+    my $localPaths = shift;
     my $patches = shift;
     my $allowConflicts = shift;
     $allowConflicts = 0 unless defined $allowConflicts;
@@ -57,6 +58,7 @@ sub readManifest {
     my $references;
     my $deriver;
     my $hashAlgo;
+    my $copyFrom;
 
     while (<MANIFEST>) {
         chomp;
@@ -125,9 +127,25 @@ sub readManifest {
                         }, $allowConflicts;
                 }
 
+                elsif ($type eq "localPath") {
+
+                    $$localPaths{$storePath} = []
+                        unless defined $$localPaths{$storePath};
+
+                    my $localPathsList = $$localPaths{$storePath};
+
+                    # !!! remove duplicates
+                    
+                    push @{$localPathsList},
+                        { copyFrom => $copyFrom, references => $references
+                        , deriver => ""
+                        };
+                }
+
             }
             
             elsif (/^\s*StorePath:\s*(\/\S+)\s*$/) { $storePath = $1; }
+            elsif (/^\s*CopyFrom:\s*(\/\S+)\s*$/) { $copyFrom = $1; }
             elsif (/^\s*Hash:\s*(\S+)\s*$/) { $hash = $1; }
             elsif (/^\s*URL:\s*(\S+)\s*$/) { $url = $1; }
             elsif (/^\s*Size:\s*(\d+)\s*$/) { $size = $1; }
@@ -158,6 +176,7 @@ sub writeManifest
     my $manifest = shift;
     my $narFiles = shift;
     my $patches = shift;
+    my $copySources = shift;
 
     open MANIFEST, ">$manifest.tmp"; # !!! check exclusive