install-grub: Make more robust against GC'ed system profile entries
Previously this barfed with: updating GRUB 2 menu... fileparse(): need a valid pathname at /nix/store/zldbbngl0f8g5iv4rslygxwp0dbg1624-install-grub.pl line 391. warning: error(s) occured while switching to the new configuration
This commit is contained in:
parent
468f698f60
commit
1ba2015450
@ -387,6 +387,10 @@ sub addProfile {
|
|||||||
my $curEntry = 0;
|
my $curEntry = 0;
|
||||||
foreach my $link (@links) {
|
foreach my $link (@links) {
|
||||||
last if $curEntry++ >= $configurationLimit;
|
last if $curEntry++ >= $configurationLimit;
|
||||||
|
if (! -e "$link/nixos-version") {
|
||||||
|
warn "skipping corrupt system profile entry ‘$link’\n";
|
||||||
|
next;
|
||||||
|
}
|
||||||
my $date = strftime("%F", localtime(lstat($link)->mtime));
|
my $date = strftime("%F", localtime(lstat($link)->mtime));
|
||||||
my $version =
|
my $version =
|
||||||
-e "$link/nixos-version"
|
-e "$link/nixos-version"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user