grub installation: fix: simplify code
This commit is contained in:
parent
282e7e6c84
commit
4ee2d39fbf
@ -499,11 +499,11 @@ my $efiTarget = getEfiTarget();
|
|||||||
my $prevGrubState = readGrubState();
|
my $prevGrubState = readGrubState();
|
||||||
my @prevDeviceTargets = split/:/, $prevGrubState->devices;
|
my @prevDeviceTargets = split/:/, $prevGrubState->devices;
|
||||||
|
|
||||||
my $devicesDiffer = scalar (List::Compare->new( '-u', '-a', \@deviceTargets, \@prevDeviceTargets)->get_symmetric_difference() );
|
my $devicesDiffer = scalar (List::Compare->new( '-u', '-a', \@deviceTargets, \@prevDeviceTargets)->get_symmetric_difference());
|
||||||
my $nameDiffer = !(get("fullName") eq $prevGrubState->name);
|
my $nameDiffer = get("fullName") ne $prevGrubState->name;
|
||||||
my $versionDiffer = !(get("fullVersion") eq $prevGrubState->version);
|
my $versionDiffer = get("fullVersion") ne $prevGrubState->version;
|
||||||
my $efiDiffer = !($efiTarget eq $prevGrubState->efi);
|
my $efiDiffer = $efiTarget ne $prevGrubState->efi;
|
||||||
my $efiMountPointDiffer = !($efiSysMountPoint eq $prevGrubState->efiMountPoint);
|
my $efiMountPointDiffer = $efiSysMountPoint ne $prevGrubState->efiMountPoint;
|
||||||
my $requireNewInstall = $devicesDiffer || $nameDiffer || $versionDiffer || $efiDiffer || $efiMountPointDiffer || (($ENV{'NIXOS_INSTALL_GRUB'} // "") eq "1");
|
my $requireNewInstall = $devicesDiffer || $nameDiffer || $versionDiffer || $efiDiffer || $efiMountPointDiffer || (($ENV{'NIXOS_INSTALL_GRUB'} // "") eq "1");
|
||||||
|
|
||||||
# install a symlink so that grub can detect the boot drive when set
|
# install a symlink so that grub can detect the boot drive when set
|
||||||
|
Loading…
Reference in New Issue
Block a user