diff options
author | Joey Hess <joey@kitenet.net> | 2013-12-24 15:42:49 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-12-24 15:42:49 -0400 |
commit | 41bd8fc4ca3f95413d5730882c4eb41ec2dfba11 (patch) | |
tree | f9d816ac8edfd2d6d8151ecf67b393a7225626ed /Build | |
parent | 9761c29d90c948065e647579e47f5717130516f6 (diff) |
Fix bug in Linux standalone build's shimming that broke git-annex-shell.
Diffstat (limited to 'Build')
-rw-r--r-- | Build/LinuxMkLibs.hs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Build/LinuxMkLibs.hs b/Build/LinuxMkLibs.hs index 0d47c4cb3..152c6b28d 100644 --- a/Build/LinuxMkLibs.hs +++ b/Build/LinuxMkLibs.hs @@ -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 |