From 4e14ef3660924e7c005c42d4d58716ee0beb2d31 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 10 Feb 2013 15:48:38 -0400 Subject: can now build Android targeted binary Various things that don't work on Android are just ifdefed out. * the webapp (needs template haskell for arm) * --include and --exclude globbing (needs libpcre, which is not ported; probably I'll make it use the pure haskell glob library instead) * annex.diskreserve checking (missing sys/statvfs.h) * timestamp preservation support (yawn) * S3 * WebDAV * XMPP The resulting 17mb binary has been tested on Android, and it is able to, at least, print its usage message. --- Limit.hs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'Limit.hs') diff --git a/Limit.hs b/Limit.hs index 80608bcc6..85cce4f44 100644 --- a/Limit.hs +++ b/Limit.hs @@ -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. -} -- cgit v1.2.3