about summary refs log tree commit diff
path: root/scripts
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2009-11-13T10·08+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2009-11-13T10·08+0000
commit3392d32e8b4202da8d3b013edd6f585e98aa7b02 (patch)
tree12dcf1cc9e5353aa03335b7f4102e853d9f2d483 /scripts
parent327a232c85de3faa56f9a6117c86e1aa22f88bd6 (diff)
* In nix-pull/nix-channel, create the manifests directory if it
  doesn't exist.  The Debian packages don't include the manifests
  directory, so nix-channel would silently skip doing a nix-pull,
  resulting in everything being built from source.  Thanks to Juan
  Pedro Bolívar Puente.

Diffstat (limited to 'scripts')
-rw-r--r--scripts/nix-channel.in3
-rw-r--r--scripts/nix-pull.in6
2 files changed, 9 insertions, 0 deletions
diff --git a/scripts/nix-channel.in b/scripts/nix-channel.in
index 8faee0b0e572..db5d35c6eba1 100644
--- a/scripts/nix-channel.in
+++ b/scripts/nix-channel.in
@@ -78,6 +78,9 @@ sub removeChannel {
 sub update {
     readChannels;
 
+    # Create the manifests directory if it doesn't exist.
+    mkdir "$stateDir/manifests", 0755 unless -e "$stateDir/manifests";
+
     # Do we have write permission to the manifests directory?  If not,
     # then just skip pulling the manifest and just download the Nix
     # expressions.  If the user is a non-privileged user in a
diff --git a/scripts/nix-pull.in b/scripts/nix-pull.in
index 856ee80fa9c8..bb041f0a6841 100644
--- a/scripts/nix-pull.in
+++ b/scripts/nix-pull.in
@@ -18,6 +18,12 @@ my $manifestDir = ($ENV{"NIX_MANIFESTS_DIR"} or "$stateDir/manifests");
 umask 0022;
 
 
+# Create the manifests directory if it doesn't exist.
+if (! -e $manifestDir) {
+    mkdir $manifestDir, 0755 or die "cannot create directory `$manifestDir'";
+}
+
+
 # Process the URLs specified on the command line.
 my %narFiles;
 my %localPaths;