diff options
author | Joey Hess <joey@kitenet.net> | 2013-05-06 09:44:55 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-05-06 09:44:55 -0400 |
commit | 07c69b53358df2bce72d3a7aedc9b66a133c5037 (patch) | |
tree | ac3ea2babbfb51cbdb530e30af52215afdd8469f | |
parent | c34cc0d4a02b120712b9f92d0d7e7df0b57fc473 (diff) |
Avoid depending on regex-tdfa on mips, mipsel, and s390, where it fails to build.
-rw-r--r-- | Limit.hs | 12 | ||||
-rw-r--r-- | debian/changelog | 2 | ||||
-rw-r--r-- | debian/control | 2 | ||||
-rw-r--r-- | git-annex.cabal | 9 |
4 files changed, 21 insertions, 4 deletions
@@ -13,8 +13,12 @@ import Data.Time.Clock.POSIX import qualified Data.Set as S import qualified Data.Map as M import System.Path.WildMatch +#ifdef WITH_TDFA import Text.Regex.TDFA import Text.Regex.TDFA.String +#else +import System.Path.WildMatch +#endif import Common.Annex import qualified Annex @@ -85,10 +89,11 @@ limitExclude :: MkLimit limitExclude glob = Right $ const $ return . not . matchglob glob {- Could just use wildCheckCase, but this way the regex is only compiled - - once. Also, we use regex-TDFA because it's less buggy in its support - - of non-unicode characters. -} + - once. Also, we use regex-TDFA when available, because it's less buggy + - in its support of non-unicode characters. -} matchglob :: String -> Annex.FileInfo -> Bool matchglob glob fi = +#ifdef WITH_TDFA case cregex of Right r -> case execute r (Annex.matchFile fi) of Right (Just _) -> True @@ -97,6 +102,9 @@ matchglob glob fi = where cregex = compile defaultCompOpt defaultExecOpt regex regex = '^':wildToRegex glob +#else + wildCheckCase glob (Annex.matchFile fi) +#endif {- Adds a limit to skip files not believed to be present - in a specfied repository. -} diff --git a/debian/changelog b/debian/changelog index aee6ca1ab..ae559223b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,8 @@ git-annex (4.20130502) UNRELEASED; urgency=low * Disable building with the haskell threaded runtime when the assistant is not built. This may fix builds on s390x and sparc, which are failing to link -lHSrts_thr + * Avoid depending on regex-tdfa on mips, mipsel, and s390, where it fails + to build. -- Joey Hess <joeyh@debian.org> Thu, 02 May 2013 20:39:19 -0400 diff --git a/debian/control b/debian/control index fd3121048..a0053d720 100644 --- a/debian/control +++ b/debian/control @@ -9,7 +9,7 @@ Build-Depends: libghc-hslogger-dev, libghc-pcre-light-dev, libghc-sha-dev, - libghc-regex-tdfa-dev, + libghc-regex-tdfa-dev [!mips !mipsel !s390], libghc-dataenc-dev, libghc-utf8-string-dev, libghc-hs3-dev (>= 0.5.6), diff --git a/git-annex.cabal b/git-annex.cabal index b1a2e20c3..7678b7feb 100644 --- a/git-annex.cabal +++ b/git-annex.cabal @@ -62,6 +62,9 @@ Flag Android Flag TestSuite Description: Embed the test suite into git-annex +Flag TDFA + Description: Use regex-tdfa for wildcards + Executable git-annex Main-Is: git-annex.hs Build-Depends: MissingH, hslogger, directory, filepath, @@ -70,7 +73,7 @@ Executable git-annex extensible-exceptions, dataenc, SHA, process, json, base (>= 4.5 && < 4.8), monad-control, transformers-base, lifted-base, IfElse, text, QuickCheck >= 2.1, bloomfilter, edit-distance, process, - SafeSemaphore, uuid, random, regex-tdfa, dlist + SafeSemaphore, uuid, random, dlist -- Need to list these because they're generated from .hsc files. Other-Modules: Utility.Touch Utility.Mounts Include-Dirs: Utility @@ -87,6 +90,10 @@ Executable git-annex Build-Depends: HUnit CPP-Options: -DWITH_TESTSUITE + if flag(TDFA) + Build-Depends: regex-tdfa + CPP-Options: -DWITH_TDFA + if flag(S3) Build-Depends: hS3 CPP-Options: -DWITH_S3 |