diff options
author | Joey Hess <joey@kitenet.net> | 2012-07-04 09:08:20 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-07-04 09:11:36 -0400 |
commit | 1da79ea61faaddd71bdb84ee2c5a89bbe04a69ed (patch) | |
tree | fe84b51559199fa9ea0f945ede3be8d9641ffc22 /Build | |
parent | 597d16ed9c185e2c2cf5616d63b6eadd187927ea (diff) |
When shaNsum commands cannot be found, use the Haskell SHA library (already a dependency) to do the checksumming. This may be slower, but avoids portability problems.
Using Crypto's version of the hashes would be another option.
I need to benchmark it. The SHA2 library (which provides SHA1 also,
confusing name) may be the fastest option, but is not currently in Debian.
Diffstat (limited to 'Build')
-rw-r--r-- | Build/Configure.hs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Build/Configure.hs b/Build/Configure.hs index 7af53cf10..24743bf61 100644 --- a/Build/Configure.hs +++ b/Build/Configure.hs @@ -28,15 +28,14 @@ tests = , TestCase "gpg" $ testCmd "gpg" "gpg --version >/dev/null" , TestCase "lsof" $ testCmd "lsof" "lsof -v >/dev/null 2>&1" , TestCase "ssh connection caching" getSshConnectionCaching - ] ++ shaTestCases False [1, 512, 224, 384] ++ shaTestCases True [256] + ] ++ shaTestCases [1, 256, 512, 224, 384] -shaTestCases :: Bool -> [Int] -> [TestCase] -shaTestCases required l = map make l +shaTestCases :: [Int] -> [TestCase] +shaTestCases l = map make l where - make n = TestCase key $ selector key (shacmds n) "</dev/null" + make n = TestCase key $ maybeSelectCmd 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 |