Atomically update channels/.htaccess
Otherwise we might clobber the redirects if the disk is full, and in any case there is a time window in which .htaccess is in an inconsistent state. Fixes https://github.com/NixOS/nixpkgs/issues/18544.
This commit is contained in:
parent
8a0ed20e6d
commit
becf1f2ae3
|
@ -168,7 +168,8 @@ unlink("$channelLink.tmp");
|
||||||
symlink($releaseDir, "$channelLink.tmp") or die;
|
symlink($releaseDir, "$channelLink.tmp") or die;
|
||||||
rename("$channelLink.tmp", $channelLink) or die;
|
rename("$channelLink.tmp", $channelLink) or die;
|
||||||
|
|
||||||
system("cat $channelsDir/.htaccess-nix* > $channelsDir/.htaccess") == 0 or die;
|
system("cat $channelsDir/.htaccess-nix* > $channelsDir/.htaccess.tmp") == 0 or die;
|
||||||
|
rename("$channelsDir/.htaccess.tmp", "$channelsDir/.htaccess") or die;
|
||||||
|
|
||||||
# Update the nixpkgs-channels repo.
|
# Update the nixpkgs-channels repo.
|
||||||
system("git remote update origin >&2") == 0 or die;
|
system("git remote update origin >&2") == 0 or die;
|
||||||
|
|
Loading…
Reference in a new issue