include path in "Cannot find old distribution bundle; not upgrading" message

This commit is contained in:
Joey Hess 2014-05-21 13:27:40 -04:00
parent 2bb31a6923
commit c6d690f350

View file

@ -222,18 +222,18 @@ upgradeToDistribution newdir cleanup distributionfile = do
{- Finds where the old version was installed. -} {- Finds where the old version was installed. -}
oldVersionLocation :: IO FilePath oldVersionLocation :: IO FilePath
oldVersionLocation = do oldVersionLocation = do
#ifdef darwin_HOST_OS
pdir <- parentDir <$> readProgramFile pdir <- parentDir <$> readProgramFile
#ifdef darwin_HOST_OS
let dirs = splitDirectories pdir let dirs = splitDirectories pdir
{- It will probably be deep inside a git-annex.app directory. -} {- It will probably be deep inside a git-annex.app directory. -}
let olddir = case findIndex ("git-annex.app" `isPrefixOf`) dirs of let olddir = case findIndex ("git-annex.app" `isPrefixOf`) dirs of
Nothing -> pdir Nothing -> pdir
Just i -> joinPath (take (i + 1) dirs) Just i -> joinPath (take (i + 1) dirs)
#else #else
olddir <- parentDir <$> readProgramFile let olddir = pdir
#endif #endif
when (null olddir) $ when (null olddir) $
error $ "Cannot find old distribution bundle; not upgrading." error $ "Cannot find old distribution bundle; not upgrading. (Looked in " ++ pdir ++ ")"
return olddir return olddir
{- Finds a place to install the new version. {- Finds a place to install the new version.