add support for readonly remotes

Currently only the web special remote is readonly, but it'd be possible to
also have readonly drives, or other remotes. These are handled in the
assistant by only downloading from them, and never trying to upload to
them.
This commit is contained in:
Joey Hess 2012-08-26 15:39:02 -04:00
parent 4d269db520
commit 271ea49978
13 changed files with 33 additions and 9 deletions

View file

@ -16,6 +16,7 @@ import Assistant.Alert
import Logs.Transfer
import Logs.Location
import qualified Remote
import qualified Types.Remote as Remote
import Utility.ThreadScheduler
import qualified Git.LsFiles as LsFiles
import Command
@ -122,6 +123,7 @@ expensiveScan st dstatus transferqueue rs = do
, use $ check Download True
)
check direction want key locs r
| direction == Upload && Remote.readonly r = Nothing
| (Remote.uuid r `elem` locs) == want = Just $
(r, Transfer direction (Remote.uuid r) key)
| otherwise = Nothing