From 3392d32e8b4202da8d3b013edd6f585e98aa7b02 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 13 Nov 2009 10:08:31 +0000 Subject: [PATCH] =?UTF-8?q?*=20In=20nix-pull/nix-channel,=20create=20the?= =?UTF-8?q?=20manifests=20directory=20if=20it=20=20=20doesn't=20exist.=20?= =?UTF-8?q?=20The=20Debian=20packages=20don't=20include=20the=20manifests?= =?UTF-8?q?=20=20=20directory,=20so=20nix-channel=20would=20silently=20ski?= =?UTF-8?q?p=20doing=20a=20nix-pull,=20=20=20resulting=20in=20everything?= =?UTF-8?q?=20being=20built=20from=20source.=20=20Thanks=20to=20Juan=20=20?= =?UTF-8?q?=20Pedro=20Bol=C3=ADvar=20Puente.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/nix-channel.in | 3 +++ scripts/nix-pull.in | 6 ++++++ tests/init.sh | 6 ------ 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/scripts/nix-channel.in b/scripts/nix-channel.in index 8faee0b0e5..db5d35c6eb 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 856ee80fa9..bb041f0a68 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; diff --git a/tests/init.sh b/tests/init.sh index bcff1e240d..0639a70662 100644 --- a/tests/init.sh +++ b/tests/init.sh @@ -36,12 +36,6 @@ ln -s $TOP/scripts/copy-from-other-stores.pl $NIX_BIN_DIR/nix/ ln -s $TOP/scripts/download-using-manifests.pl $NIX_BIN_DIR/nix/ ln -s $TOP/scripts/readmanifest.pm $NIX_BIN_DIR/nix/ -mkdir -p "$NIX_STATE_DIR"/manifests -mkdir -p "$NIX_STATE_DIR"/gcroots -mkdir -p "$NIX_STATE_DIR"/temproots -mkdir -p "$NIX_STATE_DIR"/profiles -ln -s "$NIX_STATE_DIR"/profiles "$NIX_STATE_DIR"/gcroots/ - cat > "$NIX_CONF_DIR"/nix.conf <