Fix bug in Linux standalone build's shimming that broke git-annex-shell.

This commit is contained in:
Joey Hess 2013-12-24 15:42:49 -04:00
parent e199240ab8
commit 02df4f529b
3 changed files with 15 additions and 0 deletions

View file

@ -36,6 +36,7 @@ main = getArgs >>= go
mklibs :: FilePath -> IO ()
mklibs top = do
fs <- dirContentsRecursive top
mapM_ symToHardLink fs
exes <- filterM checkExe fs
libs <- parseLdd <$> readProcess "ldd" exes
glibclibs <- glibcLibs
@ -91,6 +92,15 @@ installLinkerShim top exe = do
shimdir = top </> "shimmed" </> base
exedest = shimdir </> base
{- Converting symlinks to hard links simplifies the binary shimming
- process. -}
symToHardLink :: FilePath -> IO ()
symToHardLink f = whenM (isSymbolicLink <$> getSymbolicLinkStatus f) $ do
l <- readSymbolicLink f
let absl = absPathFrom (parentDir f) l
nukeFile f
createLink absl f
installFile :: FilePath -> FilePath -> IO ()
installFile top f = do
createDirectoryIfMissing True destdir