mirror of
https://github.com/NixOS/nix
synced 2025-07-02 21:51:50 +02:00
parent
c6849e2dee
commit
2c1711ae33
2 changed files with 68 additions and 1 deletions
|
@ -199,6 +199,20 @@ while (scalar @ARGV) {
|
|||
last;
|
||||
}
|
||||
|
||||
elsif ($arg eq "--rollback") {
|
||||
die "$0: ‘--rollback’ has at most one argument\n" if scalar @ARGV > 1;
|
||||
my $generation = shift @ARGV;
|
||||
my @args = ("$Nix::Config::binDir/nix-env", "--profile", $profile);
|
||||
if (defined $generation) {
|
||||
die "invalid channel generation number ‘$generation’" unless $generation =~ /^[0-9]+$/;
|
||||
push @args, "--switch-generation", $generation;
|
||||
} else {
|
||||
push @args, "--rollback";
|
||||
}
|
||||
system(@args) == 0 or exit 1;
|
||||
last;
|
||||
}
|
||||
|
||||
elsif ($arg eq "--help") {
|
||||
exec "man nix-channel" or die;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue