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