Detect bad content in ~/.config/git-annex/program and look in PATH instead.
This commit is contained in:
parent
ccdedfae36
commit
e0327eaafc
2 changed files with 10 additions and 2 deletions
|
@ -46,7 +46,7 @@ removeAutoStartFile path = modifyAutoStartFile $
|
||||||
filter (not . equalFilePath path)
|
filter (not . equalFilePath path)
|
||||||
|
|
||||||
{- The path to git-annex is written here; which is useful when cabal
|
{- The path to git-annex is written here; which is useful when cabal
|
||||||
- has installed it to some aweful non-PATH location. -}
|
- has installed it to some awful non-PATH location. -}
|
||||||
programFile :: IO FilePath
|
programFile :: IO FilePath
|
||||||
programFile = userConfigFile "program"
|
programFile = userConfigFile "program"
|
||||||
|
|
||||||
|
@ -54,7 +54,14 @@ programFile = userConfigFile "program"
|
||||||
readProgramFile :: IO FilePath
|
readProgramFile :: IO FilePath
|
||||||
readProgramFile = do
|
readProgramFile = do
|
||||||
programfile <- programFile
|
programfile <- programFile
|
||||||
catchDefaultIO cmd $
|
p <- catchDefaultIO cmd $
|
||||||
fromMaybe cmd . headMaybe . lines <$> readFile programfile
|
fromMaybe cmd . headMaybe . lines <$> readFile programfile
|
||||||
|
ifM (inPath p)
|
||||||
|
( return p
|
||||||
|
, ifM (inPath cmd)
|
||||||
|
( return cmd
|
||||||
|
, error $ "cannot find git-annex program in PATH or in the location listed in " ++ programfile
|
||||||
|
)
|
||||||
|
)
|
||||||
where
|
where
|
||||||
cmd = "git-annex"
|
cmd = "git-annex"
|
||||||
|
|
1
debian/changelog
vendored
1
debian/changelog
vendored
|
@ -18,6 +18,7 @@ git-annex (4.20130517) UNRELEASED; urgency=low
|
||||||
* Fix a bug in the git-annex branch handling code that could
|
* Fix a bug in the git-annex branch handling code that could
|
||||||
cause info from a remote to not be merged and take effect immediately.
|
cause info from a remote to not be merged and take effect immediately.
|
||||||
* Direct mode is now fully tested by the test suite.
|
* Direct mode is now fully tested by the test suite.
|
||||||
|
* Detect bad content in ~/.config/git-annex/program and look in PATH instead.
|
||||||
|
|
||||||
-- Joey Hess <joeyh@debian.org> Fri, 17 May 2013 11:17:03 -0400
|
-- Joey Hess <joeyh@debian.org> Fri, 17 May 2013 11:17:03 -0400
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue