diff options
author | Joey Hess <joey@kitenet.net> | 2012-11-24 16:30:15 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-11-24 16:30:15 -0400 |
commit | a00262011dc7f4ccac8c5c40d845224c281c56b2 (patch) | |
tree | e59997bf6b311fdfdd0ba80d864864c40e78484b /Assistant/Drop.hs | |
parent | ac4be3de323345ab4a6cb4a624b975ac686cc2d5 (diff) |
webapp and assistant glacier support
Diffstat (limited to 'Assistant/Drop.hs')
-rw-r--r-- | Assistant/Drop.hs | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/Assistant/Drop.hs b/Assistant/Drop.hs index 66e738a6f..4551f49ba 100644 --- a/Assistant/Drop.hs +++ b/Assistant/Drop.hs @@ -19,18 +19,19 @@ import Annex.Wanted import Config {- Drop from local and/or remote when allowed by the preferred content and - - numcopies settings. -} -handleDrops :: Bool -> Key -> AssociatedFile -> Assistant () -handleDrops _ _ Nothing = noop -handleDrops fromhere key f = do + - numcopies settings. If it's known to be present on a particular remote, + - -} +handleDrops :: Bool -> Key -> AssociatedFile -> Maybe Remote -> Assistant () +handleDrops _ _ Nothing _ = noop +handleDrops fromhere key f knownpresentremote = do syncrs <- syncDataRemotes <$> getDaemonStatus liftAnnex $ do locs <- loggedLocations key - handleDrops' locs syncrs fromhere key f + handleDrops' locs syncrs fromhere key f knownpresentremote -handleDrops' :: [UUID] -> [Remote] -> Bool -> Key -> AssociatedFile -> Annex () -handleDrops' _ _ _ _ Nothing = noop -handleDrops' locs rs fromhere key (Just f) +handleDrops' :: [UUID] -> [Remote] -> Bool -> Key -> AssociatedFile -> Maybe Remote -> Annex () +handleDrops' _ _ _ _ Nothing _ = noop +handleDrops' locs rs fromhere key (Just f) knownpresentremote | fromhere = do n <- getcopies if checkcopies n @@ -59,7 +60,7 @@ handleDrops' locs rs fromhere key (Just f) ) dropl n = checkdrop n Nothing $ \numcopies -> - Command.Drop.startLocal f numcopies key + Command.Drop.startLocal f numcopies key knownpresentremote dropr r n = checkdrop n (Just $ Remote.uuid r) $ \numcopies -> Command.Drop.startRemote f numcopies key r |