diff options
| author | Joey Hess <joeyh@joeyh.name> | 2015-01-06 19:07:40 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2015-01-06 19:07:40 -0400 |
| commit | 16a5f561f52f35f95a59976b5ee61d99945b0d55 (patch) | |
| tree | 791803645efedbc481cafcd907d2bcf73c03d1af /src/Utility/LinuxMkLibs.hs | |
| parent | f4a57ca27d2009b3069c6b33904d198e6aa73f79 (diff) | |
Merge Utiity modules from git-annex.
Except for a few that are using the other exception handling library,
that propellor has not switched to yet.
Diffstat (limited to 'src/Utility/LinuxMkLibs.hs')
| -rw-r--r-- | src/Utility/LinuxMkLibs.hs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Utility/LinuxMkLibs.hs b/src/Utility/LinuxMkLibs.hs index d32de1a1..6074ba26 100644 --- a/src/Utility/LinuxMkLibs.hs +++ b/src/Utility/LinuxMkLibs.hs @@ -1,6 +1,6 @@ {- Linux library copier and binary shimmer - - - Copyright 2013 Joey Hess <id@joeyh.name> + - Copyright 2013 Joey Hess <joey@kitenet.net> - - License: BSD-2-clause -} @@ -10,6 +10,7 @@ module Utility.LinuxMkLibs where import Control.Applicative import Data.Maybe import System.Directory +import System.FilePath import Data.List.Utils import System.Posix.Files import Data.Char @@ -28,14 +29,14 @@ installLib installfile top lib = ifM (doesFileExist lib) ( do installfile top lib checksymlink lib - return $ Just $ parentDir lib + return $ Just $ takeDirectory lib , return Nothing ) where checksymlink f = whenM (isSymbolicLink <$> getSymbolicLinkStatus (inTop top f)) $ do l <- readSymbolicLink (inTop top f) - let absl = absPathFrom (parentDir f) l - let target = relPathDirToFile (parentDir f) absl + let absl = absPathFrom (takeDirectory f) l + let target = relPathDirToFile (takeDirectory f) absl installfile top absl nukeFile (top ++ f) createSymbolicLink target (inTop top f) |
