finish fixing removeLink on windows
9cb250f7be
got the ones in RawFilePath,
but there were others that used the one from unix-compat, which fails at
runtime on windows. To avoid this,
import System.PosixCompat.Files hiding removeLink
This commit was sponsored by Ethan Aubin.
This commit is contained in:
parent
dce0781391
commit
a3b714ddd9
28 changed files with 73 additions and 64 deletions
|
@ -41,6 +41,7 @@ import qualified BuildInfo
|
|||
import qualified Utility.Url as Url
|
||||
import qualified Annex.Url as Url hiding (download)
|
||||
import Utility.Tuple
|
||||
import qualified Utility.RawFilePath as R
|
||||
|
||||
import Data.Either
|
||||
import qualified Data.Map as M
|
||||
|
@ -220,7 +221,7 @@ upgradeToDistribution newdir cleanup distributionfile = do
|
|||
error $ "did not find " ++ dir ++ " in " ++ distributionfile
|
||||
makeorigsymlink olddir = do
|
||||
let origdir = fromRawFilePath (parentDir (toRawFilePath olddir)) </> installBase
|
||||
removeWhenExistsWith removeLink origdir
|
||||
removeWhenExistsWith R.removeLink (toRawFilePath origdir)
|
||||
createSymbolicLink newdir origdir
|
||||
|
||||
{- Finds where the old version was installed. -}
|
||||
|
@ -278,8 +279,8 @@ installBase = "git-annex." ++
|
|||
deleteFromManifest :: FilePath -> IO ()
|
||||
deleteFromManifest dir = do
|
||||
fs <- map (dir </>) . lines <$> catchDefaultIO "" (readFile manifest)
|
||||
mapM_ (removeWhenExistsWith removeLink) fs
|
||||
removeWhenExistsWith removeLink manifest
|
||||
mapM_ (removeWhenExistsWith R.removeLink . toRawFilePath) fs
|
||||
removeWhenExistsWith R.removeLink (toRawFilePath manifest)
|
||||
removeEmptyRecursive dir
|
||||
where
|
||||
manifest = dir </> "git-annex.MANIFEST"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue