diff options
author | Joey Hess <joey@kitenet.net> | 2011-12-22 14:59:25 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-12-22 15:01:13 -0400 |
commit | 5a275a3f5d79977170a70b3e3ee16e38ac32916f (patch) | |
tree | 8817cfabed6067b21476290f6c6a00aba8fc1775 /configure.hs | |
parent | 7892397020fe345886ef9aa84a6c1580ebee5348 (diff) |
Can now be built with older git versions (before 1.7.7); the resulting binary should only be used with old git.
Remove git old version check from configure, and use the git version
it was built against in the git check-attr code.
Diffstat (limited to 'configure.hs')
-rw-r--r-- | configure.hs | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/configure.hs b/configure.hs index bf25de507..3b3626dd2 100644 --- a/configure.hs +++ b/configure.hs @@ -2,7 +2,6 @@ import System.Directory import Data.List -import Data.String.Utils import System.Cmd.Utils import Build.TestConfig @@ -11,7 +10,7 @@ tests :: [TestCase] tests = [ TestCase "version" getVersion , TestCase "git" $ requireCmd "git" "git --version >/dev/null" - , TestCase "git version" checkGitVersion + , TestCase "git version" getGitVersion , testCp "cp_a" "-a" , testCp "cp_p" "-p" , testCp "cp_reflink_auto" "--reflink=auto" @@ -58,25 +57,11 @@ getVersionString = do where middle = drop 1 . init -{- Checks for a new enough version of git. -} -checkGitVersion :: Test -checkGitVersion = do +getGitVersion :: Test +getGitVersion = do (_, s) <- pipeFrom "git" ["--version"] let version = last $ words $ head $ lines s - if dotted version < dotted need - then error $ "git version " ++ version ++ " too old; need " ++ need - else return $ Config "gitversion" (StringConfig version) - where - -- for git-check-attr behavior change - need = "1.7.7" - dotted = sum . mult 1 . reverse . extend 10 . map readi . split "." - extend n l = l ++ replicate (n - length l) 0 - mult _ [] = [] - mult n (x:xs) = (n*x) : mult (n*100) xs - readi :: String -> Integer - readi s = case reads s of - ((x,_):_) -> x - _ -> 0 + return $ Config "gitversion" (StringConfig version) {- Set up cabal file with version. -} cabalSetup :: IO () |