implement Unavilable for borg bup ddar directory rsync

Only gcrypt remains to add support for. (Well, possibly also adb?)

Sponsored-by: Luke T. Shumaker on Patreon
This commit is contained in:
Joey Hess 2023-08-16 15:48:09 -04:00
parent 67c99a4db7
commit 977403d338
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
9 changed files with 42 additions and 12 deletions

19
Remote/Helper/Path.hs Normal file
View file

@ -0,0 +1,19 @@
{- Utilities for remotes located in a path in the filesystem.
-
- Copyright 2023 Joey Hess <id@joeyh.name>
-
- Licensed under the GNU AGPL version 3 or higher.
-}
module Remote.Helper.Path where
import Annex.Common
import Types.Availability
checkPathAvailability :: Bool -> FilePath -> Annex Availability
checkPathAvailability islocal d
| not islocal = return GloballyAvailable
| otherwise = ifM (liftIO $ doesDirectoryExist d)
( return LocallyAvailable
, return Unavailable
)