multicast: New command, uses uftp to multicast annexed files, for eg a classroom setting.
This commit was supported by the NSF-funded DataLad project.
This commit is contained in:
parent
39e8433d46
commit
c3970f6c1a
13 changed files with 454 additions and 2 deletions
33
Logs/Multicast.hs
Normal file
33
Logs/Multicast.hs
Normal file
|
@ -0,0 +1,33 @@
|
|||
{- git-annex multicast fingerprint log
|
||||
-
|
||||
- Copyright 2017 Joey Hess <id@joeyh.name>
|
||||
-
|
||||
- Licensed under the GNU GPL version 3 or higher.
|
||||
-}
|
||||
|
||||
module Logs.Multicast (
|
||||
Fingerprint(..),
|
||||
recordFingerprint,
|
||||
knownFingerPrints,
|
||||
) where
|
||||
|
||||
import Data.Time.Clock.POSIX
|
||||
|
||||
import Annex.Common
|
||||
import qualified Annex.Branch
|
||||
import Logs
|
||||
import Logs.UUIDBased
|
||||
|
||||
import qualified Data.Map as M
|
||||
|
||||
newtype Fingerprint = Fingerprint String
|
||||
deriving (Eq, Read, Show)
|
||||
|
||||
recordFingerprint :: Fingerprint -> UUID -> Annex ()
|
||||
recordFingerprint fp uuid = do
|
||||
ts <- liftIO getPOSIXTime
|
||||
Annex.Branch.change multicastLog $
|
||||
showLog show . changeLog ts uuid fp . parseLog readish
|
||||
|
||||
knownFingerPrints :: Annex (M.Map UUID Fingerprint)
|
||||
knownFingerPrints = simpleMap . parseLog readish <$> Annex.Branch.get activityLog
|
Loading…
Add table
Add a link
Reference in a new issue