summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-04-21 16:38:49 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-04-21 16:39:44 -0400
commit048078fdb6086bae88500a2509c67001555ae942 (patch)
tree6758a646fd384904f4ddde494efba768a3aa3a76 /Build
parent3d80e5c36bb1e877bd2d356bef4a4a56f4cc9bea (diff)
filter out non-cygwin libs
Diffstat (limited to 'Build')
-rw-r--r--Build/NullSoftInstaller.hs10
1 files changed, 6 insertions, 4 deletions
diff --git a/Build/NullSoftInstaller.hs b/Build/NullSoftInstaller.hs
index 75591aaa3..0abd07f95 100644
--- a/Build/NullSoftInstaller.hs
+++ b/Build/NullSoftInstaller.hs
@@ -27,7 +27,7 @@ import Control.Applicative
import Data.String
import Data.Maybe
import Data.Char
-import Data.List (nub)
+import Data.List (nub, isPrefixOf)
import Utility.Tmp
import Utility.Path
@@ -47,7 +47,7 @@ main = do
when (isNothing p) $
print ("unable to find in PATH", f)
return p
- dlls <- forM (catMaybes extrabins) findLibs
+ dlls <- forM (catMaybes extrabins) findCygLibs
dllpaths <- mapM searchPath (nub (concat dlls))
webappscript <- vbsLauncher tmpdir "git-annex-webapp" "git-annex webapp"
autostartscript <- vbsLauncher tmpdir "git-annex-autostart" "git annex assistant --autostart"
@@ -189,9 +189,11 @@ htmlHelpText = unlines
, "</html"
]
-findLibs :: FilePath -> IO [FilePath]
-findLibs p = mapMaybe parse . lines <$> readProcess "ldd" [p]
+-- Find cygwin libraries used by the specified executable.
+findCygLibs :: FilePath -> IO [FilePath]
+findCygLibs p = filter iscyg . mapMaybe parse . lines <$> readProcess "ldd" [p]
where
parse l = case words (dropWhile isSpace l) of
(dll:"=>":_dllpath:_offset:[]) -> Just dll
_ -> Nothing
+ iscyg f = "cyg" `isPrefixOf` f || "lib" `isPrefixOf` f