summaryrefslogtreecommitdiff
path: root/src/Propellor/PrivData.hs
diff options
context:
space:
mode:
authorJoey Hess2016-03-06 20:39:44 -0400
committerJoey Hess2016-03-06 20:50:52 -0400
commit979fc0e4c03bf6ccd88873f561040bfa1133111d (patch)
tree2fd505aef8cf863af079f8a31830a6cc721b304b /src/Propellor/PrivData.hs
parentd09a67ea25be77300a4eeb06b7c922b0c28c5d25 (diff)
Force ssh, scp, and git commands to be run in the foreground.
Before, they could run in the background if another process was running, and so their output wouldn't immediately be visible. With this change, the concurrent-output layer is not used for these interactive commands.
Diffstat (limited to 'src/Propellor/PrivData.hs')
-rw-r--r--src/Propellor/PrivData.hs7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/Propellor/PrivData.hs b/src/Propellor/PrivData.hs
index 2ed75e33..ac7b00d3 100644
--- a/src/Propellor/PrivData.hs
+++ b/src/Propellor/PrivData.hs
@@ -34,8 +34,6 @@ import "mtl" Control.Monad.Reader
import qualified Data.Map as M
import qualified Data.Set as S
import qualified Data.ByteString.Lazy as L
-import System.Console.Concurrent
-import System.Console.Concurrent.Internal (ConcurrentProcessHandle(..))
import Control.Applicative
import Data.Monoid
import Prelude
@@ -52,12 +50,12 @@ import Utility.PartialPrelude
import Utility.Exception
import Utility.Tmp
import Utility.SafeCommand
+import Utility.Process.NonConcurrent
import Utility.Misc
import Utility.FileMode
import Utility.Env
import Utility.Table
import Utility.FileSystemEncoding
-import Utility.Process
-- | Allows a Property to access the value of a specific PrivDataField,
-- for use in a specific Context or HostContext.
@@ -196,8 +194,7 @@ editPrivData field context = do
hClose th
maybe noop (\p -> writeFileProtected' f (`L.hPut` privDataByteString p)) v
editor <- getEnvDefault "EDITOR" "vi"
- (_, _, _, ConcurrentProcessHandle p) <- createProcessForeground $ proc editor [f]
- unlessM (checkSuccessProcess p) $
+ unlessM (boolSystemNonConcurrent editor [File f]) $
error "Editor failed; aborting."
PrivData <$> readFile f
setPrivDataTo field context v'