propellor spin

This commit is contained in:
Joey Hess 2014-11-22 00:34:34 -04:00
parent d3b7c8585e
commit f1fdd6f678
Failed to extract signature
1 changed files with 4 additions and 3 deletions

View File

@ -128,13 +128,14 @@ sendPrecompiled hn = void $ actionMessage ("Uploading locally compiled propellor
cacheparams <- sshCachingParams hn
withTmpDir "propellor" $ \tmpdir ->
bracket getWorkingDirectory changeWorkingDirectory $ \_ -> do
changeWorkingDirectory tmpdir
let shimdir = "propellor"
changeWorkingDirectory shimdir
me <- readSymbolicLink "/proc/self/exe"
shim <- Shim.setup me shimdir
shim <- Shim.setup me "."
changeWorkingDirectory tmpdir
when (shim /= shimdir </> "propellor") $
renameFile shim (shimdir </> "propellor")
withTmpFile "propellor.tar" $ \tarball _ -> allM id
withTmpFile "propellor.tar." $ \tarball _ -> allM id
[ boolSystem "strip" [File me]
, boolSystem "tar" [Param "cf", File tarball, File shimdir]
, boolSystem "scp" $ cacheparams ++ [File tarball, Param ("root@"++hn++":"++remotetarball)]