summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Propellor/Property/Debootstrap.hs22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/Propellor/Property/Debootstrap.hs b/src/Propellor/Property/Debootstrap.hs
index 0611e735..fe87cc27 100644
--- a/src/Propellor/Property/Debootstrap.hs
+++ b/src/Propellor/Property/Debootstrap.hs
@@ -141,8 +141,26 @@ installed = RevertableProperty install remove
aptremove = Apt.removed ["debootstrap"]
sourceInstall :: Property
-sourceInstall = property "debootstrap installed from source"
- (liftIO sourceInstall')
+sourceInstall = property "debootstrap installed from source" (liftIO sourceInstall')
+ `requires` perlInstalled
+ `requires` arInstalled
+
+perlInstalled :: Property
+perlInstalled = check (not <$> inPath "perl") $ property "perl installed" $ do
+ v <- liftIO $ firstM id
+ [ yumInstall "perl"
+ ]
+ if isJust v then return MadeChange else return FailedChange
+
+arInstalled :: Property
+arInstalled = check (not <$> inPath "ar") $ property "ar installed" $ do
+ v <- liftIO $ firstM id
+ [ yumInstall "binutils"
+ ]
+ if isJust v then return MadeChange else return FailedChange
+
+yumInstall :: String -> IO Bool
+yumInstall p = boolSystem "yum" [Param "-y", Param "install", Param p]
sourceInstall' :: IO Result
sourceInstall' = withTmpDir "debootstrap" $ \tmpd -> do