diff options
author | Joey Hess <joeyh@joeyh.name> | 2016-02-26 11:54:15 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2016-02-26 11:54:15 -0400 |
commit | 8ee9733ff3dd8b9ff7cf1552f7eebf96b4ade7bb (patch) | |
tree | 38d4219ac8410d96bdfc937c98ca963fce4fc0d2 /Annex/FileMatcher.hs | |
parent | d419c190914ea4c5a9959bb585df02ae79d7d41b (diff) |
Include magic database in the linux and OSX standalone builds.
Diffstat (limited to 'Annex/FileMatcher.hs')
-rw-r--r-- | Annex/FileMatcher.hs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Annex/FileMatcher.hs b/Annex/FileMatcher.hs index 5167a5e02..fa46e64b1 100644 --- a/Annex/FileMatcher.hs +++ b/Annex/FileMatcher.hs @@ -33,6 +33,7 @@ import Git.CheckAttr (unspecifiedAttr) #ifdef WITH_MAGICMIME import Magic +import Utility.Env #endif import Data.Either @@ -131,7 +132,12 @@ mkLargeFilesParser = do #ifdef WITH_MAGICMIME magicmime <- liftIO $ catchMaybeIO $ do m <- magicOpen [MagicMimeType] - liftIO $ magicLoadDefault m + liftIO $ do + md <- getEnv "GIT_ANNEX_DIR" + case md of + Nothing -> magicLoadDefault m + Just d -> magicLoad m + (d </> "magic" </> "magic.mgc") return m #endif let parse = parseToken $ commonTokens |