From a1b1504ea8f9abd33cd1fa9fa6a9d3eeff468057 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 19 Feb 2016 16:19:19 -0400 Subject: Linux and OSX standalone builds put the bundled gpg last in PATH, so any system gpg will be preferred over it. --- Build/BundledPrograms.hs | 22 ++++++++++++++++++++-- Build/Standalone.hs | 13 +++++++++---- 2 files changed, 29 insertions(+), 6 deletions(-) (limited to 'Build') 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)) -- cgit v1.2.3