diff --git a/Annex/Content.hs b/Annex/Content.hs index dc6b2edcc7..c4a0f8490c 100644 --- a/Annex/Content.hs +++ b/Annex/Content.hs @@ -387,7 +387,7 @@ getViaTmp rsp v key af sz action = getViaTmpFromDisk :: RetrievalSecurityPolicy -> VerifyConfig -> Key -> AssociatedFile -> (OsPath -> Annex (Bool, Verification)) -> Annex Bool getViaTmpFromDisk rsp v key af action = checkallowed $ do tmpfile <- prepTmp key - resuming <- liftIO $ R.doesPathExist $ fromOsPath tmpfile + resuming <- liftIO $ doesPathExist tmpfile (ok, verification) <- action tmpfile -- When the temp file already had content, we don't know if -- that content is good or not, so only trust if it the action @@ -521,7 +521,7 @@ moveAnnex key af src = ifM (checkSecureHashes' key) , return False ) where - storeobject dest = ifM (liftIO $ R.doesPathExist $ fromOsPath dest) + storeobject dest = ifM (liftIO $ doesPathExist dest) ( alreadyhave , adjustedBranchRefresh af $ modifyContentDir dest $ do liftIO $ moveFile src dest @@ -842,7 +842,7 @@ listKeys' keyloc want = do present _ | inanywhere = pure True present d = presentInAnnex d - presentInAnnex = R.doesPathExist . fromOsPath . contentfile + presentInAnnex = doesPathExist . contentfile contentfile d = d takeFileName d {- Things to do to record changes to content when shutting down. diff --git a/Annex/Content/Presence.hs b/Annex/Content/Presence.hs index 9dfc68a202..1ef022c1ba 100644 --- a/Annex/Content/Presence.hs +++ b/Annex/Content/Presence.hs @@ -33,7 +33,6 @@ import Types.RepoVersion import qualified Database.Keys import Annex.InodeSentinal import Utility.InodeCache -import qualified Utility.RawFilePath as R import qualified Git import Config @@ -43,7 +42,7 @@ import Annex.Perms {- Checks if a given key's content is currently present. -} inAnnex :: Key -> Annex Bool -inAnnex key = inAnnexCheck key $ liftIO . R.doesPathExist . fromOsPath +inAnnex key = inAnnexCheck key $ liftIO . doesPathExist {- Runs an arbitrary check on a key's content. -} inAnnexCheck :: Key -> (OsPath -> Annex Bool) -> Annex Bool diff --git a/Annex/Ssh.hs b/Annex/Ssh.hs index fc6e3de61e..b1184ccc14 100644 --- a/Annex/Ssh.hs +++ b/Annex/Ssh.hs @@ -292,7 +292,7 @@ enumSocketFiles :: Annex [OsPath] enumSocketFiles = liftIO . go =<< sshCacheDir where go Nothing = return [] - go (Just dir) = filterM (R.doesPathExist . fromOsPath . socket2lock) + go (Just dir) = filterM (doesPathExist . socket2lock) =<< filter (not . isLock) <$> catchDefaultIO [] (dirContents dir) diff --git a/Command/Fsck.hs b/Command/Fsck.hs index 918e85a09d..d8f18bf16b 100644 --- a/Command/Fsck.hs +++ b/Command/Fsck.hs @@ -271,7 +271,7 @@ fixObjectLocation key = do idealloc <- calcRepo (gitAnnexLocation' (const (pure True)) key) if loc == idealloc then return True - else ifM (liftIO $ R.doesPathExist $ fromOsPath loc) + else ifM (liftIO $ doesPathExist loc) ( moveobjdir loc idealloc `catchNonAsync` \_e -> return True , return True @@ -439,7 +439,7 @@ checkKeySize :: Key -> KeyStatus -> ActionItem -> Annex Bool checkKeySize _ KeyUnlockedThin _ = return True checkKeySize key _ ai = do file <- calcRepo $ gitAnnexLocation key - ifM (liftIO $ R.doesPathExist (fromOsPath file)) + ifM (liftIO $ doesPathExist file) ( checkKeySizeOr badContent key file ai , return True ) @@ -504,7 +504,7 @@ checkKeyUpgrade _ _ _ (AssociatedFile Nothing) = checkBackend :: Key -> KeyStatus -> AssociatedFile -> Annex Bool checkBackend key keystatus afile = do content <- calcRepo (gitAnnexLocation key) - ifM (liftIO $ R.doesPathExist (fromOsPath content)) + ifM (liftIO $ doesPathExist content) ( ifM (pure (isKeyUnlockedThin keystatus) <&&> (not <$> isUnmodified key content)) ( nocheck , do