--auto fixes

* get/copy --auto: Transfer data even if it would exceed numcopies,
  when preferred content settings want it.
* drop --auto: Fix dropping content when there are no preferred content
  settings.
This commit is contained in:
Joey Hess 2012-12-06 13:22:16 -04:00
parent 28cfd6776d
commit 99a8a5297c
12 changed files with 50 additions and 48 deletions

View file

@ -124,9 +124,9 @@ expensiveScan rs = unless onlyweb $ do
let slocs = S.fromList locs
let use a = return $ catMaybes $ map (a key slocs) syncrs
if present
then filterM (wantSend (Just f) . Remote.uuid . fst)
then filterM (wantSend True (Just f) . Remote.uuid . fst)
=<< use (genTransfer Upload False)
else ifM (wantGet $ Just f)
else ifM (wantGet True $ Just f)
( use (genTransfer Download True) , return [] )
genTransfer :: Direction -> Bool -> Key -> S.Set UUID -> Remote -> Maybe (Remote, Transfer)