diff options
author | Joey Hess <joey@kitenet.net> | 2012-05-31 23:33:07 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-05-31 23:33:07 -0400 |
commit | 665c0fbdaafab7b3ea2737f302a8951f26e4f01a (patch) | |
tree | 8dac9f699e7e5a2aaf49da30421a8cb2bdb91919 /Build | |
parent | 2183fd2abd95b6deaa9baef47e2f9c5f865123e1 (diff) |
check at configure time for sha commands in Mac OSX location
Diffstat (limited to 'Build')
-rw-r--r-- | Build/Configure.hs | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/Build/Configure.hs b/Build/Configure.hs index 86a347924..2f79297ee 100644 --- a/Build/Configure.hs +++ b/Build/Configure.hs @@ -6,6 +6,7 @@ import System.Directory import Data.List import System.Cmd.Utils import Control.Applicative +import System.FilePath import Build.TestConfig import Utility.SafeCommand @@ -30,12 +31,17 @@ tests = shaTestCases :: Bool -> [Int] -> [TestCase] shaTestCases required l = map make l - where make n = - let - cmds = map (\x -> "sha" ++ show n ++ x) ["", "sum"] - key = "sha" ++ show n - selector = if required then selectCmd else maybeSelectCmd - in TestCase key $ selector key cmds "</dev/null" + where + make n = TestCase key $ selector key (shacmds n) "</dev/null" + where + key = "sha" ++ show n + selector = if required then selectCmd else maybeSelectCmd + shacmds n = concatMap (\x -> [x, osxpath </> x]) $ + map (\x -> "sha" ++ show n ++ x) ["", "sum"] + -- Max OSX puts GNU tools outside PATH, so look in + -- the location it uses, and remember where to run them + -- from. + osxpath = "/opt/local/libexec/gnubin" tmpDir :: String tmpDir = "tmp" |