mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-14 02:06:16 +02:00
* 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.
This commit is contained in:
parent
baa0501cc1
commit
ce86a9a0ae
1 changed files with 7 additions and 13 deletions
|
@ -79,20 +79,14 @@ sub update {
|
||||||
# Create the manifests directory if it doesn't exist.
|
# Create the manifests directory if it doesn't exist.
|
||||||
mkdir $manifestDir, 0755 unless -e $manifestDir;
|
mkdir $manifestDir, 0755 unless -e $manifestDir;
|
||||||
|
|
||||||
# Do we have write permission to the manifests directory? If not,
|
# Do we have write permission to the manifests directory?
|
||||||
# then just skip pulling the manifest and just download the Nix
|
die "$0: you do not have write permission to `$manifestDir'!\n" unless -W $manifestDir;
|
||||||
# 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'";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
# 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
|
# Create a Nix expression that fetches and unpacks the channel Nix
|
||||||
|
|
Loading…
Reference in a new issue