* Remove old manifests in `nix-channel --update'.
This commit is contained in:
parent
c54287eafe
commit
e3c07782d1
|
@ -4,6 +4,9 @@ use strict;
|
||||||
|
|
||||||
my $rootsDir = "@localstatedir@/nix/gcroots/channels";
|
my $rootsDir = "@localstatedir@/nix/gcroots/channels";
|
||||||
|
|
||||||
|
my $stateDir = $ENV{"NIX_STATE_DIR"};
|
||||||
|
$stateDir = "@localstatedir@/nix" unless defined $stateDir;
|
||||||
|
|
||||||
|
|
||||||
# Figure out the name of the `.nix-channels' file to use.
|
# Figure out the name of the `.nix-channels' file to use.
|
||||||
my $home = $ENV{"HOME"};
|
my $home = $ENV{"HOME"};
|
||||||
|
@ -70,6 +73,11 @@ sub update {
|
||||||
system "@bindir@/nix-store --clear-substitutes";
|
system "@bindir@/nix-store --clear-substitutes";
|
||||||
die "cannot clear substitutes" if ($? != 0);
|
die "cannot clear substitutes" if ($? != 0);
|
||||||
|
|
||||||
|
# Remove all the old manifests.
|
||||||
|
for my $manifest (glob "$stateDir/manifests/*.nixmanifest") {
|
||||||
|
unlink $manifest or die "cannot remove `$manifest': $!";
|
||||||
|
}
|
||||||
|
|
||||||
# Pull cache manifests.
|
# Pull cache manifests.
|
||||||
foreach my $url (@channels) {
|
foreach my $url (@channels) {
|
||||||
print "pulling cache manifest from `$url'\n";
|
print "pulling cache manifest from `$url'\n";
|
||||||
|
|
Loading…
Reference in a new issue