Include magic database in the linux and OSX standalone builds.
This commit is contained in:
parent
5d0b5eeefb
commit
471a211d21
5 changed files with 21 additions and 2 deletions
|
@ -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
|
||||
|
|
8
Makefile
8
Makefile
|
@ -147,6 +147,8 @@ linuxstandalone-nobuild: Build/Standalone Build/LinuxMkLibs
|
|||
install -d "$(LINUXSTANDALONE_DEST)/git-core"
|
||||
(cd "$(shell git --exec-path)" && tar c .) | (cd "$(LINUXSTANDALONE_DEST)"/git-core && tar x)
|
||||
install -d "$(LINUXSTANDALONE_DEST)/templates"
|
||||
install -d "$(LINUXSTANDALONE_DEST)/magic"
|
||||
cp /usr/share/file/magic.mgc "$(LINUXSTANDALONE_DEST)/magic"
|
||||
|
||||
./Build/LinuxMkLibs "$(LINUXSTANDALONE_DEST)"
|
||||
|
||||
|
@ -199,6 +201,12 @@ osxapp: Build/Standalone Build/OSXMkLibs
|
|||
|
||||
(cd "$(shell git --exec-path)" && tar c .) | (cd "$(OSXAPP_BASE)" && tar x)
|
||||
install -d "$(OSXAPP_BASE)/templates"
|
||||
install -d "$(OSXAPP_BASE)/magic"
|
||||
if [ -e "$(OSX_MAGIC_FILE)" ]; then \
|
||||
cp "$(OSX_MAGIC_FILE)" "$(OSXAPP_BASE)/magic/magic.mgc"; \
|
||||
else \
|
||||
echo "** OSX_MAGIC_FILE not set; not including it" >&2; \
|
||||
endif
|
||||
|
||||
# OSX looks in man dir nearby the bin
|
||||
$(MAKE) install-mans DESTDIR="$(OSXAPP_BASE)/.." SHAREDIR="" PREFIX=""
|
||||
|
|
1
debian/changelog
vendored
1
debian/changelog
vendored
|
@ -11,6 +11,7 @@ git-annex (6.20160218) UNRELEASED; urgency=medium
|
|||
so any system gpg will be preferred over it.
|
||||
* Avoid crashing when built with MagicMime support, but when the magic
|
||||
database cannot be loaded.
|
||||
* Include magic database in the linux and OSX standalone builds.
|
||||
|
||||
-- Joey Hess <id@joeyh.name> Thu, 18 Feb 2016 13:09:21 -0400
|
||||
|
||||
|
|
Binary file not shown.
|
@ -77,7 +77,11 @@ export ORIG_GIT_TEMPLATE_DIR
|
|||
GIT_TEMPLATE_DIR="$bundle/templates"
|
||||
export GIT_TEMPLATE_DIR
|
||||
|
||||
# Indicate which variables were exported above.
|
||||
GIT_ANNEX_DIR="$bundle"
|
||||
export GIT_ANNEX_DIR
|
||||
|
||||
# Indicate which variables were exported above and should be cleaned
|
||||
# when running non-bundled programs.
|
||||
GIT_ANNEX_STANDLONE_ENV="PATH GIT_EXEC_PATH GIT_TEMPLATE_DIR"
|
||||
export GIT_ANNEX_STANDLONE_ENV
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue