summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Limit.hs12
-rw-r--r--debian/changelog2
-rw-r--r--debian/control2
-rw-r--r--git-annex.cabal9
4 files changed, 21 insertions, 4 deletions
diff --git a/Limit.hs b/Limit.hs
index 679ebc199..56887a5fb 100644
--- a/Limit.hs
+++ b/Limit.hs
@@ -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