1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-26 07:31:20 +00:00

Merge pull request #8655 from ts468/upstream.grub_module

grub installation: fix: simplify code
This commit is contained in:
William A. Kennington III 2015-07-05 13:02:26 -07:00
commit 2d1aafef55

View file

@ -499,11 +499,11 @@ my $efiTarget = getEfiTarget();
my $prevGrubState = readGrubState();
my @prevDeviceTargets = split/:/, $prevGrubState->devices;
my $devicesDiffer = scalar (List::Compare->new( '-u', '-a', \@deviceTargets, \@prevDeviceTargets)->get_symmetric_difference() );
my $nameDiffer = !(get("fullName") eq $prevGrubState->name);
my $versionDiffer = !(get("fullVersion") eq $prevGrubState->version);
my $efiDiffer = !($efiTarget eq $prevGrubState->efi);
my $efiMountPointDiffer = !($efiSysMountPoint eq $prevGrubState->efiMountPoint);
my $devicesDiffer = scalar (List::Compare->new( '-u', '-a', \@deviceTargets, \@prevDeviceTargets)->get_symmetric_difference());
my $nameDiffer = get("fullName") ne $prevGrubState->name;
my $versionDiffer = get("fullVersion") ne $prevGrubState->version;
my $efiDiffer = $efiTarget ne $prevGrubState->efi;
my $efiMountPointDiffer = $efiSysMountPoint ne $prevGrubState->efiMountPoint;
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