summaryrefslogtreecommitdiff
path: root/src/Propellor/Shim.hs
diff options
context:
space:
mode:
authorJoey Hess2015-07-21 10:47:26 -0400
committerJoey Hess2015-07-21 10:47:26 -0400
commitc7bc34d256604af8d2ed6444dfa2f4ce6402b682 (patch)
tree2aebcad7db2a1e3db260387dc94a6c6dbfc15ebe /src/Propellor/Shim.hs
parent8d971b83ba11fc0eb521d9d15e4a2ae281bc2ef5 (diff)
fix check for already existing shim
Was not checking the shim file, oops.
Diffstat (limited to 'src/Propellor/Shim.hs')
-rw-r--r--src/Propellor/Shim.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Propellor/Shim.hs b/src/Propellor/Shim.hs
index ecf9f36a..7cdecefd 100644
--- a/src/Propellor/Shim.hs
+++ b/src/Propellor/Shim.hs
@@ -20,7 +20,7 @@ import System.Posix.Files
-- Propellor may be running from an existing shim, in which case it's
-- simply reused.
setup :: FilePath -> Maybe FilePath -> FilePath -> IO FilePath
-setup propellorbin propellorbinpath dest = checkAlreadyShimmed propellorbin $ do
+setup propellorbin propellorbinpath dest = checkAlreadyShimmed shim $ do
createDirectoryIfMissing True dest
libs <- parseLdd <$> readProcess "ldd" [propellorbin]
@@ -39,7 +39,6 @@ setup propellorbin propellorbinpath dest = checkAlreadyShimmed propellorbin $ do
fromMaybe (error "cannot find gconv directory") $
headMaybe $ filter ("/gconv/" `isInfixOf`) glibclibs
let linkerparams = ["--library-path", intercalate ":" libdirs ]
- let shim = file propellorbin dest
writeFile shim $ unlines
[ shebang
, "GCONV_PATH=" ++ shellEscape gconvdir
@@ -49,6 +48,8 @@ setup propellorbin propellorbinpath dest = checkAlreadyShimmed propellorbin $ do
]
modifyFileMode shim (addModes executeModes)
return shim
+ where
+ shim = file propellorbin dest
shebang :: String
shebang = "#!/bin/sh"