Linux and OSX standalone builds put the bundled gpg last in PATH, so any system gpg will be preferred over it.

This commit is contained in:
Joey Hess 2016-02-19 16:19:19 -04:00
parent f1cebd1bf9
commit 398d93d4d2
Failed to extract signature
6 changed files with 37 additions and 10 deletions

View file

@ -17,7 +17,26 @@ import Build.SysConfig as SysConfig
- -
- These may be just the command name, or the full path to it. -} - These may be just the command name, or the full path to it. -}
bundledPrograms :: [FilePath] 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 [ Nothing
#ifndef mingw32_HOST_OS #ifndef mingw32_HOST_OS
-- git is not included in the windows bundle; git for windows is used -- git is not included in the windows bundle; git for windows is used
@ -56,7 +75,6 @@ bundledPrograms = catMaybes
#ifndef mingw32_HOST_OS #ifndef mingw32_HOST_OS
-- All these utilities are included in git for Windows -- All these utilities are included in git for Windows
, ifset SysConfig.curl "curl" , ifset SysConfig.curl "curl"
, SysConfig.gpg
, SysConfig.sha1 , SysConfig.sha1
, SysConfig.sha256 , SysConfig.sha256
, SysConfig.sha512 , SysConfig.sha512

View file

@ -26,6 +26,9 @@ progDir topdir = topdir
progDir topdir = topdir </> "bin" progDir topdir = topdir </> "bin"
#endif #endif
extraProgDir :: FilePath -> FilePath
extraProgDir topdir = topdir </> "extra"
installProg :: FilePath -> FilePath -> IO (FilePath, FilePath) installProg :: FilePath -> FilePath -> IO (FilePath, FilePath)
installProg dir prog = searchPath prog >>= go installProg dir prog = searchPath prog >>= go
where where
@ -41,7 +44,9 @@ main = getArgs >>= go
where where
go [] = error "specify topdir" go [] = error "specify topdir"
go (topdir:_) = do go (topdir:_) = do
let dir = progDir topdir installed <- forM
createDirectoryIfMissing True dir [ (progDir topdir, preferredBundledPrograms)
installed <- forM bundledPrograms $ installProg dir , (extraProgDir topdir, extraBundledPrograms) ] $ \(dir, progs) -> do
writeFile "tmp/standalone-installed" (show installed) createDirectoryIfMissing True dir
forM progs $ installProg dir
writeFile "tmp/standalone-installed" (show (concat installed))

2
debian/changelog vendored
View file

@ -7,6 +7,8 @@ git-annex (6.20160218) UNRELEASED; urgency=medium
* fsck: When the only copy of a file is in a dead repository, mention * fsck: When the only copy of a file is in a dead repository, mention
the repository. the repository.
* info: Mention when run in a dead repository. * info: Mention when run in a dead repository.
* Linux and OSX standalone builds put the bundled gpg last in PATH,
so any system gpg will be preferred over it.
-- Joey Hess <id@joeyh.name> Thu, 18 Feb 2016 13:09:21 -0400 -- Joey Hess <id@joeyh.name> Thu, 18 Feb 2016 13:09:21 -0400

View file

@ -6,3 +6,5 @@ A solution might be to move the gpg binary to a different directory and put
it at the end of PATH, not the front. So system one is used if available. it at the end of PATH, not the front. So system one is used if available.
This should also be considered for the linux standalone builds. This should also be considered for the linux standalone builds.
> [[done]] for both OSX and linux. --[[Joey]]

View file

@ -81,10 +81,10 @@ if [ -z "$GIT_ANNEX_PACKAGE_INSTALL" ]; then
fi fi
# Put our binaries first, to avoid issues with out of date or incompatable # Put our binaries first, to avoid issues with out of date or incompatable
# system binaries. # system binaries. Extra binaries come after system path.
ORIG_PATH="$PATH" ORIG_PATH="$PATH"
export ORIG_PATH export ORIG_PATH
PATH="$base/bin:$PATH" PATH="$base/bin:$PATH:$base/extra"
export PATH export PATH
# These env vars are used by the shim wrapper around each binary. # These env vars are used by the shim wrapper around each binary.

View file

@ -61,10 +61,10 @@ if [ ! -e "$HOME/.ssh/git-annex-wrapper" ]; then
fi fi
# Put our binaries first, to avoid issues with out of date or incompatable # Put our binaries first, to avoid issues with out of date or incompatable
# system binaries. # system binaries. Extra binaries come after system path.
ORIG_PATH="$PATH" ORIG_PATH="$PATH"
export ORIG_PATH export ORIG_PATH
PATH="$bundle:$PATH" PATH="$bundle:$PATH:$base/extra"
export PATH export PATH
ORIG_GIT_EXEC_PATH="$GIT_EXEC_PATH" ORIG_GIT_EXEC_PATH="$GIT_EXEC_PATH"