improve upgrade paths for OSX

This commit is contained in:
Joey Hess 2013-11-25 14:29:14 -04:00
parent 87c75417ac
commit 38a1259813

View file

@ -162,7 +162,9 @@ upgradeToDistribution newdir cleanup distributionfile = do
] ]
void $ boolSystem "cp" void $ boolSystem "cp"
[ Param "-R" [ Param "-R"
, File $ tmpdir </> installBase -- Trailing slash to copy the directory
-- contents.
, File $ tmpdir </> installBase ++ "/"
, File $ newdir , File $ newdir
] ]
sanitycheck newdir sanitycheck newdir
@ -222,10 +224,9 @@ oldVersionLocation = do
pdir <- parentDir <$> readProgramFile pdir <- parentDir <$> readProgramFile
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 p = takeWhile (/= "git-annex.app") dirs let olddir = case findIndex ("git-annex.app" `isPrefixOf`) dirs of
let olddir = if p == dirs Nothing -> pdir
then pdir Just i -> joinPath (take (i + 1) dirs)
else joinPath (p ++ ["git-annex.app"])
#else #else
olddir <- parentDir <$> readProgramFile olddir <- parentDir <$> readProgramFile
#endif #endif