From 7fd338f96f5852ea309bd4a2964bf93d06062086 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 22 Nov 2014 00:25:00 -0400 Subject: propellor spin --- src/Propellor/Server.hs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/Propellor/Server.hs') diff --git a/src/Propellor/Server.hs b/src/Propellor/Server.hs index 786d1211..a8cd6a00 100644 --- a/src/Propellor/Server.hs +++ b/src/Propellor/Server.hs @@ -8,7 +8,9 @@ import Data.List import System.Exit import System.PosixCompat import System.Posix.IO +import System.Posix.Directory import Control.Concurrent.Async +import Control.Exception (bracket) import qualified Data.ByteString as B import Propellor @@ -131,15 +133,15 @@ sendPrecompiled hn = void $ actionMessage ("Uploading locally compiled propellor let shimdir = "propellor" let me = localdir "propellor" void $ Shim.setup me shimdir - withTmpFile "propellor.tar" $ \tarball -> allM id + withTmpFile "propellor.tar" $ \tarball _ -> allM id [ boolSystem "strip" [File me] - , boolSystem "tar" [Param "cf", File tmp, File shimdir] - , boolSystem "scp" $ cacheparams ++ [File tarball, Param ("root@"++hn++":"++remotetarball) + , boolSystem "tar" [Param "cf", File tarball, File shimdir] + , boolSystem "scp" $ cacheparams ++ [File tarball, Param ("root@"++hn++":"++remotetarball)] , boolSystem "ssh" $ cacheparams ++ [Param ("root@"++hn), Param unpackcmd] ] where remotetarball = "/usr/local/propellor.tar" - unpackcmd = shellSwap $ intercalate " && " + unpackcmd = shellWrap $ intercalate " && " [ "cd " ++ takeDirectory remotetarball , "tar xf " ++ remotetarball , "rm -f " ++ remotetarball -- cgit v1.2.3