Author: eelco
Date: Thu Feb 2 12:25:56 2012
New Revision: 31979
URL: https://nixos.org/websvn/nix/?rev=31979&sc=1
Log:
* nix-channel: fail if we don't have write permission to the manifests
directory. Previously in this situation we did add the Nix
expressions from the channel to allow installation from source, but
this doesn't work for binary-only channels and leads to confusing
error messages.
Modified:
nix/trunk/scripts/nix-channel.in
Modified: nix/trunk/scripts/nix-channel.in
==============================================================================
--- nix/trunk/scripts/nix-channel.in Thu Feb 2 12:19:17 2012 (r31978)
+++ nix/trunk/scripts/nix-channel.in Thu Feb 2 12:25:56 2012 (r31979)
@@ -79,20 +79,14 @@
# Create the manifests directory if it doesn't exist.
mkdir $manifestDir, 0755 unless -e $manifestDir;
- # 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
- # multi-user Nix installation, he at least gets installation from
- # source.
- if (-W $manifestDir) {
-
- # Pull cache manifests.
- foreach my $url (@channels) {
- #print "pulling cache manifest from `$url'\n";
- system("$Nix::Config::binDir/nix-pull", "--skip-wrong-store",
"$url/MANIFEST") == 0
- or die "cannot pull cache manifest from `$url'";
- }
+ # Do we have write permission to the manifests directory?
+ die "$0: you do not have write permission to `$manifestDir'!\n" unless -W
$manifestDir;
+ # Pull cache manifests.
+ foreach my $url (@channels) {
+ #print "pulling cache manifest from `$url'\n";
+ system("$Nix::Config::binDir/nix-pull", "--skip-wrong-store",
"$url/MANIFEST") == 0
+ or die "cannot pull cache manifest from `$url'";
}
# Create a Nix expression that fetches and unpacks the channel Nix
_______________________________________________
nix-commits mailing list
[email protected]
http://lists.science.uu.nl/mailman/listinfo/nix-commits