summaryrefslogtreecommitdiff
path: root/src/Propellor
diff options
context:
space:
mode:
authorJoey Hess2014-11-22 20:35:46 -0400
committerJoey Hess2014-11-22 20:35:46 -0400
commit40bec41f569a73a8e95d9acf91f0ae7465b0f8c0 (patch)
treed34d75e1204a75e7fd247fe5e8c12462141094d7 /src/Propellor
parent001c193a43b34a6925dd47118be32e1b42e8e72b (diff)
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.
Diffstat (limited to 'src/Propellor')
-rw-r--r--src/Propellor/Spin.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Propellor/Spin.hs b/src/Propellor/Spin.hs
index cffa7610..1688bcaf 100644
--- a/src/Propellor/Spin.hs
+++ b/src/Propellor/Spin.hs
@@ -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.