diff options
| author | Joey Hess <joey@kitenet.net> | 2014-11-22 12:13:41 -0400 |
|---|---|---|
| committer | Joey Hess <joey@kitenet.net> | 2014-11-22 12:13:41 -0400 |
| commit | 7cbf4841de39761953cf31d32ed86bb4bd949672 (patch) | |
| tree | 3d8bb9ecd83a24494a40de5211a10f19036a2949 /src/Propellor/CmdLine.hs | |
| parent | 557fab609175d7d0a59ffe1269fed02f49f8004e (diff) | |
| parent | 57ec60d6f307dbf3e237b924e635b90ba889af18 (diff) | |
Merge branch 'joeyconfig'
Diffstat (limited to 'src/Propellor/CmdLine.hs')
| -rw-r--r-- | src/Propellor/CmdLine.hs | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/src/Propellor/CmdLine.hs b/src/Propellor/CmdLine.hs index 142efa1d..ec2ca7ed 100644 --- a/src/Propellor/CmdLine.hs +++ b/src/Propellor/CmdLine.hs @@ -114,16 +114,19 @@ unknownhost h hosts = errorMessage $ unlines ] buildFirst :: CmdLine -> IO () -> IO () -buildFirst cmdline next = do - oldtime <- getmtime - ifM (actionMessage "Propellor build" $ boolSystem "make" [Param "build"]) - ( do - newtime <- getmtime - if newtime == oldtime - then next - else void $ boolSystem "./propellor" [Param "--continue", Param (show cmdline)] - , errorMessage "Propellor build failed!" - ) +buildFirst cmdline next = ifM (doesFileExist "Makefile") + ( do + oldtime <- getmtime + ifM (actionMessage "Propellor build" $ boolSystem "make" [Param "build"]) + ( do + newtime <- getmtime + if newtime == oldtime + then next + else void $ boolSystem "./propellor" [Param "--continue", Param (show cmdline)] + , errorMessage "Propellor build failed!" + ) + , next + ) where getmtime = catchMaybeIO $ getModificationTime "propellor" @@ -172,11 +175,11 @@ spin hn hst = do updatecmd = mkcmd [ "if [ ! -d " ++ localdir ++ " ]" - , "then " ++ intercalate " && " + , "then (" ++ intercalate " && " [ "apt-get update" , "apt-get --no-install-recommends --no-upgrade -y install git make" , "echo " ++ toMarked statusMarker (show NeedGitClone) - ] + ] ++ ") || echo " ++ toMarked statusMarker (show NeedPrecompiled) , "else " ++ intercalate " && " [ "cd " ++ localdir , "if ! test -x ./propellor; then make deps build; fi" |
