propellor spin

This commit is contained in:
Joey Hess 2014-04-14 16:02:48 -04:00
parent 1f2c68d595
commit a83d489270
Failed to extract signature
1 changed files with 6 additions and 8 deletions

View File

@ -5,7 +5,6 @@ import Control.Applicative
import Data.List import Data.List
import System.IO import System.IO
import Control.Monad import Control.Monad
import System.Process (env)
import Propellor import Propellor
import qualified Propellor.Property.File as File import qualified Propellor.Property.File as File
@ -196,13 +195,12 @@ reConfigure package vals = reconfigure `requires` setselections
`describe` ("reconfigure " ++ package) `describe` ("reconfigure " ++ package)
where where
setselections = Property "preseed" $ makeChange $ setselections = Property "preseed" $ makeChange $
withHandle StdinHandle createProcessSuccess p $ \h -> do withHandle StdinHandle createProcessSuccess
forM_ vals $ \(tmpl, tmpltype, value) -> (proc "debconf-set-selections" []) $ \h -> do
hPutStrLn h $ unwords [package, tmpl, tmpltype, value] forM_ vals $ \(tmpl, tmpltype, value) ->
hClose h hPutStrLn h $ unwords [package, tmpl, tmpltype, value]
reconfigure = cmdProperty "dpkg-reconfigure" ["-fnone", package] hClose h
p = (proc "debconf-set-selections" []) reconfigure = cmdProperty' "dpkg-reconfigure" ["-fnone", package] noninteractiveEnv
{ env = Just noninteractiveEnv }
-- | Ensures that a service is installed and running. -- | Ensures that a service is installed and running.
-- --