another place to use toResult
This commit is contained in:
parent
6b6d5a0881
commit
06975ec5e1
|
@ -148,18 +148,16 @@ sourceInstall = property "debootstrap installed from source" (liftIO sourceInsta
|
||||||
`requires` arInstalled
|
`requires` arInstalled
|
||||||
|
|
||||||
perlInstalled :: Property
|
perlInstalled :: Property
|
||||||
perlInstalled = check (not <$> inPath "perl") $ property "perl installed" $ do
|
perlInstalled = check (not <$> inPath "perl") $ property "perl installed" $
|
||||||
v <- liftIO $ firstM id
|
liftIO $ toResult . isJust <$> firstM id
|
||||||
[ yumInstall "perl"
|
[ yumInstall "perl"
|
||||||
]
|
]
|
||||||
if isJust v then return MadeChange else return FailedChange
|
|
||||||
|
|
||||||
arInstalled :: Property
|
arInstalled :: Property
|
||||||
arInstalled = check (not <$> inPath "ar") $ property "ar installed" $ do
|
arInstalled = check (not <$> inPath "ar") $ property "ar installed" $
|
||||||
v <- liftIO $ firstM id
|
liftIO $ toResult . isJust <$> firstM id
|
||||||
[ yumInstall "binutils"
|
[ yumInstall "binutils"
|
||||||
]
|
]
|
||||||
if isJust v then return MadeChange else return FailedChange
|
|
||||||
|
|
||||||
yumInstall :: String -> IO Bool
|
yumInstall :: String -> IO Bool
|
||||||
yumInstall p = boolSystem "yum" [Param "-y", Param "install", Param p]
|
yumInstall p = boolSystem "yum" [Param "-y", Param "install", Param p]
|
||||||
|
|
Loading…
Reference in New Issue