replace R.doesPathExist with doesPathExist
authorJoey Hess <joeyh@joeyh.name>
Tue, 11 Feb 2025 16:46:14 +0000 (12:46 -0400)
committerJoey Hess <joeyh@joeyh.name>
Tue, 11 Feb 2025 16:46:54 +0000 (12:46 -0400)
Equivilant, just avoids some ugliness.

Annex/Content.hs
Annex/Content/Presence.hs
Annex/Ssh.hs
Command/Fsck.hs

index dc6b2edcc7ea026b6a1f1c3b12c87f9395a20dfa..c4a0f8490c0b66895477b9ee944f4aa53ac36c09 100644 (file)
@@ -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.
index 9dfc68a20236a2f58357226febd987ab6828705f..1ef022c1ba9ac6d5e3b46ec60f0c1e3fc3290321 100644 (file)
@@ -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
index fc6e3de61ed5f60150f5cdb0a63f9c2ae01c636c..b1184ccc142c97789d447374e97c120db2f4d511 100644 (file)
@@ -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)
 
index 918e85a09dde9c3ec73c1d3a8c26e8e090bf871d..d8f18bf16bf5a9095c6299f360d9bddf1c960724 100644 (file)
@@ -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