propellor spin

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

View File

@ -76,7 +76,6 @@ updateServer hn hst connect = connect go
hClose toh hClose toh
hClose fromh hClose fromh
sendPrecompiled hn sendPrecompiled hn
updateServer hn hst connect
Nothing -> return () Nothing -> return ()
sendRepoUrl :: Handle -> IO () sendRepoUrl :: Handle -> IO ()
@ -125,14 +124,16 @@ sendGitClone hn = void $ actionMessage ("Clone git repository to " ++ hn) $ do
-- This should be reasonably portable, as long as the remote host has the -- This should be reasonably portable, as long as the remote host has the
-- same architecture as the build host. -- same architecture as the build host.
sendPrecompiled :: HostName -> IO () sendPrecompiled :: HostName -> IO ()
sendPrecompiled hn = void $ actionMessage ("Uploading locally compiled propellor as a last resort " ++ hn) $ do sendPrecompiled hn = void $ actionMessage ("Uploading locally compiled propellor as a last resort") $ do
cacheparams <- sshCachingParams hn cacheparams <- sshCachingParams hn
withTmpDir "propellor" $ \tmpdir -> withTmpDir "propellor" $ \tmpdir ->
bracket getWorkingDirectory changeWorkingDirectory $ \_ -> do bracket getWorkingDirectory changeWorkingDirectory $ \_ -> do
changeWorkingDirectory tmpdir changeWorkingDirectory tmpdir
let shimdir = "propellor" let shimdir = "propellor"
me <- readSymbolicLink "/proc/self/exe" me <- readSymbolicLink "/proc/self/exe"
void $ Shim.setup me shimdir shim <- Shim.setup me shimdir
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 "strip" [File me]
, boolSystem "tar" [Param "cf", File tarball, File shimdir] , boolSystem "tar" [Param "cf", File tarball, File shimdir]