2012-10-18 15:22:28 -04:00
|
|
|
{- git-annex assistant dropping of unwanted content
|
|
|
|
-
|
2015-01-21 12:50:09 -04:00
|
|
|
- Copyright 2012 Joey Hess <id@joeyh.name>
|
2012-10-18 15:22:28 -04:00
|
|
|
-
|
|
|
|
- Licensed under the GNU GPL version 3 or higher.
|
|
|
|
-}
|
|
|
|
|
2014-01-19 17:35:36 -04:00
|
|
|
module Assistant.Drop (
|
|
|
|
handleDrops,
|
|
|
|
handleDropsFrom,
|
|
|
|
) where
|
2012-10-18 15:22:28 -04:00
|
|
|
|
|
|
|
import Assistant.Common
|
2012-10-18 15:37:57 -04:00
|
|
|
import Assistant.DaemonStatus
|
2014-01-19 17:35:36 -04:00
|
|
|
import Annex.Drop (handleDropsFrom, Reason)
|
2012-10-18 15:22:28 -04:00
|
|
|
import Logs.Location
|
2014-01-29 13:44:53 -04:00
|
|
|
import CmdLine.Action
|
2015-10-08 16:55:11 -04:00
|
|
|
import Types.NumCopies
|
2013-03-01 15:58:44 -04:00
|
|
|
|
2012-10-18 16:05:43 -04:00
|
|
|
{- Drop from local and/or remote when allowed by the preferred content and
|
2012-12-05 12:32:26 -04:00
|
|
|
- numcopies settings. -}
|
2015-10-08 16:55:11 -04:00
|
|
|
handleDrops :: Reason -> Bool -> Key -> AssociatedFile -> [VerifiedCopy] -> Assistant ()
|
|
|
|
handleDrops reason fromhere key f preverified = do
|
2012-11-11 16:23:16 -04:00
|
|
|
syncrs <- syncDataRemotes <$> getDaemonStatus
|
2013-03-01 15:58:44 -04:00
|
|
|
locs <- liftAnnex $ loggedLocations key
|
2015-10-08 16:55:11 -04:00
|
|
|
liftAnnex $ handleDropsFrom locs syncrs reason fromhere key f preverified callCommandAction
|