From 271ea499789410e7c5c1352abe835af0a5001c38 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 26 Aug 2012 15:39:02 -0400 Subject: 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. --- Assistant/DaemonStatus.hs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Assistant/DaemonStatus.hs') diff --git a/Assistant/DaemonStatus.hs b/Assistant/DaemonStatus.hs index 4077eec88..8e3b48777 100644 --- a/Assistant/DaemonStatus.hs +++ b/Assistant/DaemonStatus.hs @@ -14,6 +14,7 @@ import Utility.ThreadScheduler import Utility.TempFile import Utility.NotificationBroadcaster import Logs.Transfer +import Logs.Trust import qualified Remote import Control.Concurrent.STM @@ -81,8 +82,13 @@ modifyDaemonStatus dstatus a = do sendNotification $ changeNotifier s return b +{- Remotes ordered by cost, with dead ones thrown out. -} calcKnownRemotes :: Annex [Remote] -calcKnownRemotes = concat . Remote.byCost <$> Remote.enabledRemoteList +calcKnownRemotes = do + rs <- concat . Remote.byCost <$> Remote.enabledRemoteList + alive <- snd <$> trustPartition DeadTrusted (map Remote.uuid rs) + let good r = Remote.uuid r `elem` alive + return $ filter good rs {- Updates the cached ordered list of remotes from the list in Annex - state. -} -- cgit v1.2.3