diff options
| author | Joey Hess <joeyh@joeyh.name> | 2017-07-25 15:30:54 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2017-07-25 15:30:54 -0400 |
| commit | 4f5ea9e647de942df53b7fcb0aa69729bd1b1454 (patch) | |
| tree | 7806b879fe5d07879f26f28deec5a10de67c41de /src/Propellor/Property/Reboot.hs | |
| parent | 9c719f4f5e8b5bfdc0be3259cd3a30b02a345e82 (diff) | |
| parent | f01286bc4338dcb3942b3870d7a6ea69ca773265 (diff) | |
Merge branch 'master' into joeyconfig
Diffstat (limited to 'src/Propellor/Property/Reboot.hs')
| -rw-r--r-- | src/Propellor/Property/Reboot.hs | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/Propellor/Property/Reboot.hs b/src/Propellor/Property/Reboot.hs index 3781cd7b..909d87fb 100644 --- a/src/Propellor/Property/Reboot.hs +++ b/src/Propellor/Property/Reboot.hs @@ -78,15 +78,16 @@ toKernelNewerThan ver = property' ("reboot to kernel newer than " ++ ver) $ \w -> do wantV <- tryReadVersion ver runningV <- tryReadVersion =<< liftIO runningKernelVersion - installedV <- maximum <$> - (mapM tryReadVersion =<< liftIO installedKernelVersions) if runningV >= wantV then noChange - else if installedV >= wantV - then ensureProperty w now - else errorMessage $ - "kernel newer than " - ++ ver - ++ " not installed" + else maximum <$> installedVs >>= \installedV -> + if installedV >= wantV + then ensureProperty w now + else errorMessage $ + "kernel newer than " + ++ ver + ++ " not installed" + where + installedVs = mapM tryReadVersion =<< liftIO installedKernelVersions runningInstalledKernel :: IO Bool runningInstalledKernel = do |
