summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-02-19 16:19:19 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-02-19 16:19:19 -0400
commita1b1504ea8f9abd33cd1fa9fa6a9d3eeff468057 (patch)
treec3a91c82206bbf4a1b625f0a249ccfb78559012b /Build
parentab93778d022b0dc0ec63177d191f3269191da6f3 (diff)
Linux and OSX standalone builds put the bundled gpg last in PATH, so any system gpg will be preferred over it.
Diffstat (limited to 'Build')
-rw-r--r--Build/BundledPrograms.hs22
-rw-r--r--Build/Standalone.hs13
2 files changed, 29 insertions, 6 deletions
diff --git a/Build/BundledPrograms.hs b/Build/BundledPrograms.hs
index bd1c25359..74e187618 100644
--- a/Build/BundledPrograms.hs
+++ b/Build/BundledPrograms.hs
@@ -17,7 +17,26 @@ import Build.SysConfig as SysConfig
-
- These may be just the command name, or the full path to it. -}
bundledPrograms :: [FilePath]
-bundledPrograms = catMaybes
+bundledPrograms = preferredBundledPrograms ++ extraBundledPrograms
+
+{- Programs that are only included in the bundle in case the system
+ - doesn't have them. These come after the system PATH.
+ -}
+extraBundledPrograms :: [FilePath]
+extraBundledPrograms = catMaybes
+ -- The system gpg is probably better, because it may better
+ -- integrate with the system gpg-agent, etc.
+ [ SysConfig.gpg
+ ]
+
+{- Programs that should be preferred for use from the bundle, over
+ - any that might be installed on the system otherwise. These come before
+ - the system PATH.
+ -
+ - For example, git-annex is built for a specific version of git.
+ -}
+preferredBundledPrograms :: [FilePath]
+preferredBundledPrograms = catMaybes
[ Nothing
#ifndef mingw32_HOST_OS
-- git is not included in the windows bundle; git for windows is used
@@ -56,7 +75,6 @@ bundledPrograms = catMaybes
#ifndef mingw32_HOST_OS
-- All these utilities are included in git for Windows
, ifset SysConfig.curl "curl"
- , SysConfig.gpg
, SysConfig.sha1
, SysConfig.sha256
, SysConfig.sha512
diff --git a/Build/Standalone.hs b/Build/Standalone.hs
index 2a6c04e6d..a3a4bac48 100644
--- a/Build/Standalone.hs
+++ b/Build/Standalone.hs
@@ -26,6 +26,9 @@ progDir topdir = topdir
progDir topdir = topdir </> "bin"
#endif
+extraProgDir :: FilePath -> FilePath
+extraProgDir topdir = topdir </> "extra"
+
installProg :: FilePath -> FilePath -> IO (FilePath, FilePath)
installProg dir prog = searchPath prog >>= go
where
@@ -41,7 +44,9 @@ main = getArgs >>= go
where
go [] = error "specify topdir"
go (topdir:_) = do
- let dir = progDir topdir
- createDirectoryIfMissing True dir
- installed <- forM bundledPrograms $ installProg dir
- writeFile "tmp/standalone-installed" (show installed)
+ installed <- forM
+ [ (progDir topdir, preferredBundledPrograms)
+ , (extraProgDir topdir, extraBundledPrograms) ] $ \(dir, progs) -> do
+ createDirectoryIfMissing True dir
+ forM progs $ installProg dir
+ writeFile "tmp/standalone-installed" (show (concat installed))