diff options
Diffstat (limited to 'Limit.hs')
-rw-r--r-- | Limit.hs | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -5,13 +5,17 @@ - Licensed under the GNU GPL version 3 or higher. -} +{-# LANGUAGE CPP #-} + module Limit where -import Text.Regex.PCRE.Light.Char8 -import System.Path.WildMatch import Data.Time.Clock.POSIX import qualified Data.Set as S import qualified Data.Map as M +#ifndef WITH_ANDROID +import Text.Regex.PCRE.Light.Char8 +import System.Path.WildMatch +#endif import Common.Annex import qualified Annex @@ -81,11 +85,15 @@ limitExclude :: MkLimit limitExclude glob = Right $ const $ return . not . matchglob glob matchglob :: String -> Annex.FileInfo -> Bool +#ifdef WITH_ANDROID +matchglob _ _ = error "glob matching not supported" +#else matchglob glob (Annex.FileInfo { Annex.matchFile = f }) = isJust $ match cregex f [] where cregex = compile regex [] regex = '^':wildToRegex glob +#endif {- Adds a limit to skip files not believed to be present - in a specfied repository. -} |