propellor spin
This commit is contained in:
parent
a020b66fcb
commit
d53729495e
|
@ -73,7 +73,7 @@ unknownhost h = errorMessage $ unwords
|
||||||
buildFirst :: CmdLine -> IO () -> IO ()
|
buildFirst :: CmdLine -> IO () -> IO ()
|
||||||
buildFirst cmdline next = do
|
buildFirst cmdline next = do
|
||||||
oldtime <- getmtime
|
oldtime <- getmtime
|
||||||
ifM (actionMessage "Rebuilding propellor" $ boolSystem "make" [Param "build"])
|
ifM (actionMessage "Propellor build" $ boolSystem "make" [Param "build"])
|
||||||
( do
|
( do
|
||||||
newtime <- getmtime
|
newtime <- getmtime
|
||||||
if newtime == oldtime
|
if newtime == oldtime
|
||||||
|
@ -90,7 +90,7 @@ updateFirst cmdline next = do
|
||||||
<$> readProcess "git" ["symbolic-ref", "HEAD"]
|
<$> readProcess "git" ["symbolic-ref", "HEAD"]
|
||||||
let originbranch = "origin" </> takeFileName branchref
|
let originbranch = "origin" </> takeFileName branchref
|
||||||
|
|
||||||
void $ actionMessage "Fetching" $ boolSystem "git" [Param "fetch"]
|
void $ actionMessage "Git fetch" $ boolSystem "git" [Param "fetch"]
|
||||||
|
|
||||||
whenM (doesFileExist keyring) $ do
|
whenM (doesFileExist keyring) $ do
|
||||||
{- To verify origin/master commit's signature, have to
|
{- To verify origin/master commit's signature, have to
|
||||||
|
@ -120,7 +120,7 @@ updateFirst cmdline next = do
|
||||||
|
|
||||||
if oldsha == newsha
|
if oldsha == newsha
|
||||||
then next
|
then next
|
||||||
else ifM (actionMessage "Rebuilding propellor" $ boolSystem "make" [Param "build"])
|
else ifM (actionMessage "Propellor build" $ boolSystem "make" [Param "build"])
|
||||||
( void $ boolSystem "./propellor" [Param "--continue", Param (show cmdline)]
|
( void $ boolSystem "./propellor" [Param "--continue", Param (show cmdline)]
|
||||||
, errorMessage "Propellor build failed!"
|
, errorMessage "Propellor build failed!"
|
||||||
)
|
)
|
||||||
|
|
|
@ -15,7 +15,7 @@ ensureProperty = catchDefaultIO FailedChange . propertySatisfy
|
||||||
ensureProperties :: [Property] -> IO ()
|
ensureProperties :: [Property] -> IO ()
|
||||||
ensureProperties ps = do
|
ensureProperties ps = do
|
||||||
r <- ensureProperties' [Property "overall" $ ensureProperties' ps]
|
r <- ensureProperties' [Property "overall" $ ensureProperties' ps]
|
||||||
setTitle "propellor done"
|
setTitle "propellor: done"
|
||||||
hFlush stdout
|
hFlush stdout
|
||||||
case r of
|
case r of
|
||||||
FailedChange -> exitWith (ExitFailure 1)
|
FailedChange -> exitWith (ExitFailure 1)
|
||||||
|
|
|
@ -9,7 +9,7 @@ import Propellor.Types
|
||||||
-- display.
|
-- display.
|
||||||
actionMessage :: ActionResult r => Desc -> IO r -> IO r
|
actionMessage :: ActionResult r => Desc -> IO r -> IO r
|
||||||
actionMessage desc a = do
|
actionMessage desc a = do
|
||||||
setTitle desc
|
setTitle $ "propellor: " ++ desc
|
||||||
hFlush stdout
|
hFlush stdout
|
||||||
|
|
||||||
r <- a
|
r <- a
|
||||||
|
@ -19,7 +19,7 @@ actionMessage desc a = do
|
||||||
setSGR [SetColor Foreground intensity color]
|
setSGR [SetColor Foreground intensity color]
|
||||||
putStrLn msg
|
putStrLn msg
|
||||||
setSGR []
|
setSGR []
|
||||||
setTitle "Propellor running"
|
setTitle "propellor: running"
|
||||||
hFlush stdout
|
hFlush stdout
|
||||||
|
|
||||||
return r
|
return r
|
||||||
|
|
Loading…
Reference in New Issue