mirror of
https://github.com/NixOS/nix
synced 2025-07-06 21:41:48 +02:00
nix-channel --update: allow updating only the specified channels
This commit is contained in:
parent
147f10157f
commit
afa7b8a479
2 changed files with 14 additions and 10 deletions
|
@ -76,6 +76,8 @@ sub removeChannel {
|
|||
# Fetch Nix expressions and pull manifests from the subscribed
|
||||
# channels.
|
||||
sub update {
|
||||
my @channelNames = @_;
|
||||
|
||||
readChannels;
|
||||
|
||||
# Create the manifests directory if it doesn't exist.
|
||||
|
@ -87,6 +89,8 @@ sub update {
|
|||
# Download each channel.
|
||||
my $exprs = "";
|
||||
foreach my $name (keys %channels) {
|
||||
next if scalar @channelNames > 0 && ! grep { $_ eq $name } @{channelNames};
|
||||
|
||||
my $url = $channels{$name};
|
||||
my $origUrl = "$url/MANIFEST";
|
||||
|
||||
|
@ -141,7 +145,7 @@ Usage:
|
|||
nix-channel --add URL [CHANNEL-NAME]
|
||||
nix-channel --remove CHANNEL-NAME
|
||||
nix-channel --list
|
||||
nix-channel --update
|
||||
nix-channel --update [CHANNEL-NAME...]
|
||||
EOF
|
||||
exit 1;
|
||||
}
|
||||
|
@ -182,8 +186,7 @@ while (scalar @ARGV) {
|
|||
}
|
||||
|
||||
elsif ($arg eq "--update") {
|
||||
usageError if scalar @ARGV != 0;
|
||||
update;
|
||||
update(@ARGV);
|
||||
last;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue