mirror of
https://github.com/NixOS/nix
synced 2025-07-06 21:41:48 +02:00
Delete manifests in "nix-channel --remove" or when a binary cache is available
This commit is contained in:
parent
6c4ac29917
commit
b14717ab90
4 changed files with 47 additions and 35 deletions
|
@ -76,26 +76,15 @@ sub processURL {
|
|||
open URL, ">$urlFile" or die "cannot create `$urlFile'";
|
||||
print URL $origUrl;
|
||||
close URL;
|
||||
|
||||
|
||||
my $finalPath = "$manifestDir/$baseName-$hash.nixmanifest";
|
||||
|
||||
unlink $finalPath if -e $finalPath;
|
||||
|
||||
|
||||
symlink("$manifest", "$finalPath")
|
||||
or die "cannot link `$finalPath to `$manifest'";
|
||||
|
||||
# Delete all old manifests downloaded from this URL.
|
||||
for my $urlFile2 (glob "$manifestDir/*.url") {
|
||||
next if $urlFile eq $urlFile2;
|
||||
open URL, "<$urlFile2" or die;
|
||||
my $url2 = <URL>;
|
||||
chomp $url2;
|
||||
close URL;
|
||||
next unless $origUrl eq $url2;
|
||||
my $base = $urlFile2; $base =~ s/.url$//;
|
||||
unlink "${base}.url";
|
||||
unlink "${base}.nixmanifest";
|
||||
}
|
||||
deleteOldManifests($origUrl, $urlFile);
|
||||
}
|
||||
|
||||
while (@ARGV) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue