avoid removing whole localdir every time the precompiled tarball is uploaded

There's some state in there..

Moved it to a shim subdir, which can be deleted and the tarball unpacked to
recreate it.
This commit is contained in:
Joey Hess 2014-11-22 20:35:46 -04:00
parent 001c193a43
commit 40bec41f56
1 changed files with 3 additions and 2 deletions

View File

@ -217,7 +217,7 @@ sendPrecompiled hn = void $ actionMessage ("Uploading locally compiled propellor
where
go tmpdir = do
cacheparams <- sshCachingParams hn
let shimdir = takeFileName localdir
let shimdir = takeFileName localdir </> "shim"
createDirectoryIfMissing True (tmpdir </> shimdir)
changeWorkingDirectory (tmpdir </> shimdir)
me <- readSymbolicLink "/proc/self/exe"
@ -237,9 +237,10 @@ sendPrecompiled hn = void $ actionMessage ("Uploading locally compiled propellor
unpackcmd = shellWrap $ intercalate " && "
[ "cd " ++ takeDirectory remotetarball
, "rm -rf " ++ localdir
, "rm -rf " ++ localdir </> "shim"
, "tar xzf " ++ remotetarball
, "rm -f " ++ remotetarball
, "ln -sf shim/propellor propellor/propellor"
]
-- Shim for git push over the propellor ssh channel.