diff options
-rw-r--r-- | Assistant/Threads/Committer.hs | 25 | ||||
-rw-r--r-- | Assistant/Threads/ConfigMonitor.hs | 4 | ||||
-rw-r--r-- | Assistant/Threads/Glacier.hs | 2 | ||||
-rw-r--r-- | Assistant/Threads/Merger.hs | 4 | ||||
-rw-r--r-- | Assistant/Threads/MountWatcher.hs | 6 | ||||
-rw-r--r-- | Assistant/Threads/SanityChecker.hs | 4 | ||||
-rw-r--r-- | Assistant/Threads/TransferScanner.hs | 8 | ||||
-rw-r--r-- | Assistant/Threads/TransferWatcher.hs | 9 | ||||
-rw-r--r-- | Assistant/Threads/Transferrer.hs | 4 | ||||
-rw-r--r-- | Assistant/Threads/Watcher.hs | 16 | ||||
-rw-r--r-- | Assistant/Threads/XMPPClient.hs | 24 | ||||
-rw-r--r-- | Backend/Hash.hs | 10 | ||||
-rw-r--r-- | BuildFlags.hs | 6 | ||||
-rw-r--r-- | Command/Direct.hs | 4 | ||||
-rw-r--r-- | Utility/Hash.hs | 29 | ||||
-rw-r--r-- | doc/install/fromscratch.mdwn | 2 | ||||
-rw-r--r-- | git-annex.cabal | 9 |
17 files changed, 102 insertions, 64 deletions
diff --git a/Assistant/Threads/Committer.hs b/Assistant/Threads/Committer.hs index 445f4753b..695703e22 100644 --- a/Assistant/Threads/Committer.hs +++ b/Assistant/Threads/Committer.hs @@ -112,7 +112,7 @@ waitChangeTime a = waitchanges 0 - that make up a file rename? Or some of the pairs that make up - a directory rename? -} - possiblyrename cs = all renamepart cs + possiblyrename = all renamepart renamepart (PendingAddChange _ _) = True renamepart c = isRmChange c @@ -309,7 +309,7 @@ handleAdds delayadd cs = returnWhen (null incomplete) $ do inRepo (Git.LsFiles.notInRepo False $ map changeFile pending) -- note: timestamp info is lost here let ts = changeTime exemplar - return (map (PendingAddChange ts) newfiles, void $ liftIO $ cleanup) + return (map (PendingAddChange ts) newfiles, void $ liftIO cleanup) returnWhen c a | c = return otherchanges @@ -317,12 +317,13 @@ handleAdds delayadd cs = returnWhen (null incomplete) $ do add :: Change -> Assistant (Maybe Change) add change@(InProcessAddChange { keySource = ks }) = - catchDefaultIO Nothing <~> do - sanitycheck ks $ do - (mkey, mcache) <- liftAnnex $ do - showStart "add" $ keyFilename ks - Command.Add.ingest $ Just ks - maybe (failedingest change) (done change mcache $ keyFilename ks) mkey + catchDefaultIO Nothing <~> doadd + where + doadd = sanitycheck ks $ do + (mkey, mcache) <- liftAnnex $ do + showStart "add" $ keyFilename ks + Command.Add.ingest $ Just ks + maybe (failedingest change) (done change mcache $ keyFilename ks) mkey add _ = return Nothing {- In direct mode, avoid overhead of re-injesting a renamed @@ -371,7 +372,7 @@ handleAdds delayadd cs = returnWhen (null incomplete) $ do ( inRepo $ gitAnnexLink file key , Command.Add.link file key mcache ) - whenM (pure DirWatcher.eventsCoalesce <||> isDirect) $ do + whenM (pure DirWatcher.eventsCoalesce <||> isDirect) $ stageSymlink file =<< hashSymlink link showEndOk return $ Just $ finishedChange change key @@ -415,8 +416,8 @@ safeToAdd _ [] [] = return [] safeToAdd delayadd pending inprocess = do maybe noop (liftIO . threadDelaySeconds) delayadd liftAnnex $ do - keysources <- mapM Command.Add.lockDown (map changeFile pending) - let inprocess' = inprocess ++ catMaybes (map mkinprocess $ zip pending keysources) + keysources <- forM pending $ Command.Add.lockDown . changeFile + let inprocess' = inprocess ++ mapMaybe mkinprocess (zip pending keysources) openfiles <- S.fromList . map fst3 . filter openwrite <$> findopenfiles (map keySource inprocess') let checked = map (check openfiles) inprocess' @@ -434,7 +435,7 @@ safeToAdd delayadd pending inprocess = do | S.member (contentLocation ks) openfiles = Left change check _ change = Right change - mkinprocess (c, Just ks) = Just $ InProcessAddChange + mkinprocess (c, Just ks) = Just InProcessAddChange { changeTime = changeTime c , keySource = ks } diff --git a/Assistant/Threads/ConfigMonitor.hs b/Assistant/Threads/ConfigMonitor.hs index 6a01ff35e..3d8be476e 100644 --- a/Assistant/Threads/ConfigMonitor.hs +++ b/Assistant/Threads/ConfigMonitor.hs @@ -54,7 +54,7 @@ type Configs = S.Set (FilePath, String) {- All git-annex's config files, and actions to run when they change. -} configFilesActions :: [(FilePath, Annex ())] configFilesActions = - [ (uuidLog, void $ uuidMapLoad) + [ (uuidLog, void uuidMapLoad) , (remoteLog, void remoteListRefresh) , (trustLog, void trustMapLoad) , (groupLog, void groupMapLoad) @@ -71,7 +71,7 @@ reloadConfigs changedconfigs = do {- Changes to the remote log, or the trust log, can affect the - syncRemotes list. Changes to the uuid log may affect its - display so are also included. -} - when (any (`elem` fs) [remoteLog, trustLog, uuidLog]) $ + when (any (`elem` fs) [remoteLog, trustLog, uuidLog]) updateSyncRemotes where (fs, as) = unzip $ filter (flip S.member changedfiles . fst) diff --git a/Assistant/Threads/Glacier.hs b/Assistant/Threads/Glacier.hs index 46f64cd56..4c4012a67 100644 --- a/Assistant/Threads/Glacier.hs +++ b/Assistant/Threads/Glacier.hs @@ -30,7 +30,7 @@ glacierThread = namedThread "Glacier" $ runEvery (Seconds 3600) <~> go go = do rs <- filter isglacier . syncDataRemotes <$> getDaemonStatus forM_ rs $ \r -> - check r =<< (liftAnnex $ getFailedTransfers $ Remote.uuid r) + check r =<< liftAnnex (getFailedTransfers $ Remote.uuid r) check _ [] = noop check r l = do let keys = map getkey l diff --git a/Assistant/Threads/Merger.hs b/Assistant/Threads/Merger.hs index 650293e4b..3f4fcb0cc 100644 --- a/Assistant/Threads/Merger.hs +++ b/Assistant/Threads/Merger.hs @@ -54,7 +54,7 @@ runHandler handler file _filestatus = {- Called when there's an error with inotify. -} onErr :: Handler -onErr msg = error msg +onErr = error {- Called when a new branch ref is written, or a branch ref is modified. - @@ -110,7 +110,7 @@ equivBranches x y = base x == base y isAnnexBranch :: FilePath -> Bool isAnnexBranch f = n `isSuffixOf` f where - n = "/" ++ show Annex.Branch.name + n = '/' : show Annex.Branch.name fileToBranch :: FilePath -> Git.Ref fileToBranch f = Git.Ref $ "refs" </> base diff --git a/Assistant/Threads/MountWatcher.hs b/Assistant/Threads/MountWatcher.hs index 970585b42..c18bfb5bd 100644 --- a/Assistant/Threads/MountWatcher.hs +++ b/Assistant/Threads/MountWatcher.hs @@ -34,7 +34,7 @@ import qualified Control.Exception as E #endif mountWatcherThread :: NamedThread -mountWatcherThread = namedThread "MountWatcher" $ +mountWatcherThread = namedThread "MountWatcher" #if WITH_DBUS dbusThread #else @@ -173,10 +173,10 @@ remotesUnder dir = do rs <- liftAnnex remoteList pairs <- liftAnnex $ mapM (checkremote repotop) rs let (waschanged, rs') = unzip pairs - when (any id waschanged) $ do + when (or waschanged) $ do liftAnnex $ Annex.changeState $ \s -> s { Annex.remotes = catMaybes rs' } updateSyncRemotes - return $ catMaybes $ map snd $ filter fst pairs + return $ mapMaybe snd $ filter fst pairs where checkremote repotop r = case Remote.localpath r of Just p | dirContains dir (absPathFrom repotop p) -> diff --git a/Assistant/Threads/SanityChecker.hs b/Assistant/Threads/SanityChecker.hs index 0c97a9e8f..64fbc2fb6 100644 --- a/Assistant/Threads/SanityChecker.hs +++ b/Assistant/Threads/SanityChecker.hs @@ -42,7 +42,7 @@ sanityCheckerDailyThread = namedThread "SanityCheckerDaily" $ forever $ do go = do modifyDaemonStatus_ $ \s -> s { sanityCheckRunning = True } - now <- liftIO $ getPOSIXTime -- before check started + now <- liftIO getPOSIXTime -- before check started r <- either showerr return =<< (tryIO . batch) <~> dailyCheck modifyDaemonStatus_ $ \s -> s @@ -78,7 +78,7 @@ dailyCheck = do -- Find old unstaged symlinks, and add them to git. (unstaged, cleanup) <- liftIO $ Git.LsFiles.notInRepo False ["."] g - now <- liftIO $ getPOSIXTime + now <- liftIO getPOSIXTime forM_ unstaged $ \file -> do ms <- liftIO $ catchMaybeIO $ getSymbolicLinkStatus file case ms of diff --git a/Assistant/Threads/TransferScanner.hs b/Assistant/Threads/TransferScanner.hs index 631310987..ba302d6bb 100644 --- a/Assistant/Threads/TransferScanner.hs +++ b/Assistant/Threads/TransferScanner.hs @@ -85,13 +85,13 @@ failedTransferScan r = do mapM_ retry failed where retry (t, info) - | transferDirection t == Download = do + | transferDirection t == Download = {- Check if the remote still has the key. - If not, relies on the expensiveScan to - get it queued from some other remote. -} whenM (liftAnnex $ remoteHas r $ transferKey t) $ requeue t info - | otherwise = do + | otherwise = {- The Transferrer checks when uploading - that the remote doesn't already have the - key, so it's not redundantly checked here. -} @@ -161,7 +161,7 @@ expensiveScan urlrenderer rs = unless onlyweb $ batch <~> do present key (Just f) Nothing liftAnnex $ do let slocs = S.fromList locs - let use a = return $ catMaybes $ map (a key slocs) syncrs + let use a = return $ mapMaybe (a key slocs) syncrs ts <- if present then filterM (wantSend True (Just f) . Remote.uuid . fst) =<< use (genTransfer Upload False) @@ -173,7 +173,7 @@ expensiveScan urlrenderer rs = unless onlyweb $ batch <~> do genTransfer :: Direction -> Bool -> Key -> S.Set UUID -> Remote -> Maybe (Remote, Transfer) genTransfer direction want key slocs r | direction == Upload && Remote.readonly r = Nothing - | (S.member (Remote.uuid r) slocs) == want = Just + | S.member (Remote.uuid r) slocs == want = Just (r, Transfer direction (Remote.uuid r) key) | otherwise = Nothing diff --git a/Assistant/Threads/TransferWatcher.hs b/Assistant/Threads/TransferWatcher.hs index 7045e842d..9bc851d4e 100644 --- a/Assistant/Threads/TransferWatcher.hs +++ b/Assistant/Threads/TransferWatcher.hs @@ -51,7 +51,7 @@ runHandler handler file _filestatus = {- Called when there's an error with inotify. -} onErr :: Handler -onErr msg = error msg +onErr = error {- Called when a new transfer information file is written. -} onAdd :: Handler @@ -70,10 +70,9 @@ onAdd file = case parseTransferFile file of - The only thing that should change in the transfer info is the - bytesComplete, so that's the only thing updated in the DaemonStatus. -} onModify :: Handler -onModify file = do - case parseTransferFile file of - Nothing -> noop - Just t -> go t =<< liftIO (readTransferInfoFile Nothing file) +onModify file = case parseTransferFile file of + Nothing -> noop + Just t -> go t =<< liftIO (readTransferInfoFile Nothing file) where go _ Nothing = noop go t (Just newinfo) = alterTransferInfo t $ diff --git a/Assistant/Threads/Transferrer.hs b/Assistant/Threads/Transferrer.hs index 67a8c2a7b..98f8b6ad7 100644 --- a/Assistant/Threads/Transferrer.hs +++ b/Assistant/Threads/Transferrer.hs @@ -31,7 +31,7 @@ transfererThread :: NamedThread transfererThread = namedThread "Transferrer" $ do program <- liftIO readProgramFile forever $ inTransferSlot program $ - maybe (return Nothing) (uncurry $ genTransfer) + maybe (return Nothing) (uncurry genTransfer) =<< getNextTransfer notrunning where {- Skip transfers that are already running. -} @@ -96,7 +96,7 @@ genTransfer t info = case (transferRemote info, associatedFile info) of True (transferKey t) (associatedFile info) (Just remote) - void $ recordCommit + void recordCommit , whenM (liftAnnex $ isNothing <$> checkTransfer t) $ void $ removeTransfer t ) diff --git a/Assistant/Threads/Watcher.hs b/Assistant/Threads/Watcher.hs index ef8bcd41f..799537deb 100644 --- a/Assistant/Threads/Watcher.hs +++ b/Assistant/Threads/Watcher.hs @@ -5,7 +5,7 @@ - Licensed under the GNU GPL version 3 or higher. -} -{-# LANGUAGE DeriveDataTypeable, BangPatterns, CPP #-} +{-# LANGUAGE DeriveDataTypeable, CPP #-} module Assistant.Threads.Watcher ( watchThread, @@ -79,7 +79,7 @@ watchThread = namedThread "Watcher" $ runWatcher :: Assistant () runWatcher = do startup <- asIO1 startupScan - matcher <- liftAnnex $ largeFilesMatcher + matcher <- liftAnnex largeFilesMatcher direct <- liftAnnex isDirect symlinkssupported <- liftAnnex $ coreSymlinks <$> Annex.getGitConfig addhook <- hook $ if direct @@ -109,7 +109,7 @@ runWatcher = do waitFor :: WatcherException -> Assistant () -> Assistant () waitFor sig next = do - r <- liftIO $ (E.try pause :: IO (Either E.SomeException ())) + r <- liftIO (E.try pause :: IO (Either E.SomeException ())) case r of Left e -> case E.fromException e of Just s @@ -124,7 +124,7 @@ startupScan :: IO a -> Assistant a startupScan scanner = do liftAnnex $ showAction "scanning" alertWhile' startupScanAlert $ do - r <- liftIO $ scanner + r <- liftIO scanner -- Notice any files that were deleted before -- watching was started. @@ -133,7 +133,7 @@ startupScan scanner = do forM_ fs $ \f -> do liftAnnex $ onDel' f maybe noop recordChange =<< madeChange f RmChange - void $ liftIO $ cleanup + void $ liftIO cleanup liftAnnex $ showAction "started" liftIO $ putStrLn "" @@ -176,7 +176,7 @@ runHandler handler file filestatus = void $ do Right (Just change) -> do -- Just in case the commit thread is not -- flushing the queue fast enough. - liftAnnex $ Annex.Queue.flushWhenFull + liftAnnex Annex.Queue.flushWhenFull recordChange change where normalize f @@ -340,8 +340,8 @@ onDelDir dir _ = do now <- liftIO getCurrentTime recordChanges $ map (\f -> Change now f RmChange) fs - void $ liftIO $ clean - liftAnnex $ Annex.Queue.flushWhenFull + void $ liftIO clean + liftAnnex Annex.Queue.flushWhenFull noChange {- Called when there's an error with inotify or kqueue. -} diff --git a/Assistant/Threads/XMPPClient.hs b/Assistant/Threads/XMPPClient.hs index a90ffb820..ffd487ae1 100644 --- a/Assistant/Threads/XMPPClient.hs +++ b/Assistant/Threads/XMPPClient.hs @@ -103,9 +103,8 @@ xmppClient urlrenderer d creds = - will also be killed. -} liftIO $ pinger `concurrently` sender `concurrently` receiver - sendnotifications selfjid = forever $ do - a <- inAssistant $ relayNetMessage selfjid - a + sendnotifications selfjid = forever $ + join $ inAssistant $ relayNetMessage selfjid receivenotifications selfjid lasttraffic = forever $ do l <- decodeStanza selfjid <$> getStanza void $ liftIO $ atomically . swapTMVar lasttraffic =<< getCurrentTime @@ -115,7 +114,7 @@ xmppClient urlrenderer d creds = sendpings selfjid lasttraffic = forever $ do putStanza pingstanza - startping <- liftIO $ getCurrentTime + startping <- liftIO getCurrentTime liftIO $ threadDelaySeconds (Seconds 120) t <- liftIO $ atomically $ readTMVar lasttraffic when (t < startping) $ do @@ -154,8 +153,7 @@ xmppClient urlrenderer d creds = , logJid jid , show $ logNetMessage msg' ] - a <- inAssistant $ convertNetMsg msg' selfjid - a + join $ inAssistant $ convertNetMsg msg' selfjid inAssistant $ sentImportantNetMessage msg c resendImportantMessages _ _ = noop @@ -196,7 +194,7 @@ logClient (Client jid) = logJid jid decodeStanza :: JID -> ReceivedStanza -> [XMPPEvent] decodeStanza selfjid s@(ReceivedPresence p) | presenceType p == PresenceError = [ProtocolError s] - | presenceFrom p == Nothing = [Ignorable s] + | isNothing (presenceFrom p) = [Ignorable s] | presenceFrom p == Just selfjid = [Ignorable s] | otherwise = maybe [PresenceMessage p] decode (gitAnnexTagInfo p) where @@ -209,7 +207,7 @@ decodeStanza selfjid s@(ReceivedPresence p) - along with their real meaning. -} impliedp v = [PresenceMessage p, v] decodeStanza selfjid s@(ReceivedMessage m) - | messageFrom m == Nothing = [Ignorable s] + | isNothing (messageFrom m) = [Ignorable s] | messageFrom m == Just selfjid = [Ignorable s] | messageType m == MessageError = [ProtocolError s] | otherwise = [fromMaybe (Unknown s) (GotNetMessage <$> decodeMessage m)] @@ -241,13 +239,13 @@ relayNetMessage selfjid = do \c -> (baseJID <$> parseJID c) == Just tojid return $ putStanza presenceQuery _ -> return noop - convert (Pushing c pushstage) = withOtherClient selfjid c $ \tojid -> do + convert (Pushing c pushstage) = withOtherClient selfjid c $ \tojid -> if tojid == baseJID tojid then do clients <- maybe [] (S.toList . buddyAssistants) <$> getBuddy (genBuddyKey tojid) <<~ buddyList debug ["exploded undirected message to clients", unwords $ map logClient clients] - return $ forM_ (clients) $ \(Client jid) -> + return $ forM_ clients $ \(Client jid) -> putStanza $ pushMessage pushstage jid selfjid else do debug ["to client:", logJid tojid] @@ -266,7 +264,7 @@ convertNetMsg msg selfjid = convert msg convert (Pushing c pushstage) = withOtherClient selfjid c $ \tojid -> return $ putStanza $ pushMessage pushstage tojid selfjid -withOtherClient :: JID -> ClientID -> (JID -> Assistant (XMPP ())) -> (Assistant (XMPP ())) +withOtherClient :: JID -> ClientID -> (JID -> Assistant (XMPP ())) -> Assistant (XMPP ()) withOtherClient selfjid c a = case parseJID c of Nothing -> return noop Just tojid @@ -323,10 +321,10 @@ pairMsgReceived :: UrlRenderer -> PairStage -> UUID -> JID -> JID -> Assistant ( pairMsgReceived urlrenderer PairReq theiruuid selfjid theirjid | baseJID selfjid == baseJID theirjid = autoaccept | otherwise = do - knownjids <- catMaybes . map (parseJID . getXMPPClientID) + knownjids <- mapMaybe (parseJID . getXMPPClientID) . filter isXMPPRemote . syncRemotes <$> getDaemonStatus um <- liftAnnex uuidMap - if any (== baseJID theirjid) knownjids && M.member theiruuid um + if elem (baseJID theirjid) knownjids && M.member theiruuid um then autoaccept else showalert diff --git a/Backend/Hash.hs b/Backend/Hash.hs index 9cef3cae1..96a9bab3c 100644 --- a/Backend/Hash.hs +++ b/Backend/Hash.hs @@ -5,6 +5,8 @@ - Licensed under the GNU GPL version 3 or higher. -} +{-# LANGUAGE CPP #-} + module Backend.Hash (backends) where import Common.Annex @@ -27,7 +29,9 @@ type HashSize = Int hashes :: [Hash] hashes = concat [ map SHAHash [256, 1, 512, 224, 384] +#ifdef WITH_CRYPTOHASH , map SkeinHash [256, 512] +#endif ] {- The SHA256E backend is the default, so genBackendE comes first. -} @@ -143,7 +147,7 @@ shaHasher hashsize filesize | hashsize == 224 = use SysConfig.sha224 sha224 | hashsize == 384 = use SysConfig.sha384 sha384 | hashsize == 512 = use SysConfig.sha512 sha512 - | otherwise = error $ "bad sha size " ++ show hashsize + | otherwise = error $ "unsupported sha size " ++ show hashsize where use Nothing hasher = Left $ show . hasher use (Just c) hasher @@ -157,6 +161,8 @@ shaHasher hashsize filesize skeinHasher :: HashSize -> (L.ByteString -> String) skeinHasher hashsize +#ifdef WITH_CRYPTOHASH | hashsize == 256 = show . skein256 | hashsize == 512 = show . skein512 - | otherwise = error $ "bad skein size " ++ show hashsize +#endif + | otherwise = error $ "unsupported skein size " ++ show hashsize diff --git a/BuildFlags.hs b/BuildFlags.hs index e1e5c1b88..40d5bb29b 100644 --- a/BuildFlags.hs +++ b/BuildFlags.hs @@ -54,4 +54,10 @@ buildFlags = filter (not . null) #ifdef WITH_QUVI , "Quvi" #endif +#ifdef WITH_TDFA + , "TDFA" +#endif +#ifdef WITH_CRYPTOHASH + , "CryptoHash" +#endif ] diff --git a/Command/Direct.hs b/Command/Direct.hs index 7485f41ce..1f262bd9f 100644 --- a/Command/Direct.hs +++ b/Command/Direct.hs @@ -54,8 +54,8 @@ perform = do Nothing -> noop Just a -> do showStart "direct" f - r <- tryAnnex a - case r of + r' <- tryAnnex a + case r' of Left e -> warnlocked e Right _ -> showEndOk return Nothing diff --git a/Utility/Hash.hs b/Utility/Hash.hs index 8b25998ae..cecc6af3e 100644 --- a/Utility/Hash.hs +++ b/Utility/Hash.hs @@ -1,13 +1,30 @@ {- Convenience wrapper around cryptohash. - - - - The resulting Digests can be shown to get a canonical hash encoding. -} + - Falls back to SHA if it's not available. + -} -module Utility.Hash where +{-# LANGUAGE CPP #-} + +module Utility.Hash ( + sha1, + sha224, + sha256, + sha384, + sha512, +#ifdef WITH_CRYPTOHASH + skein256, + skein512, +#endif + prop_hashes_stable +) where -import Crypto.Hash import qualified Data.ByteString.Lazy as L import qualified Data.ByteString.Char8 as C8 +#ifndef WITH_CRYPTOHASH +import Data.Digest.Pure.SHA +#else +import Crypto.Hash + sha1 :: L.ByteString -> Digest SHA1 sha1 = hashlazy @@ -33,6 +50,8 @@ skein256 = hashlazy skein512 :: L.ByteString -> Digest Skein512_512 skein512 = hashlazy +#endif + {- Check that all the hashes continue to hash the same. -} prop_hashes_stable :: Bool prop_hashes_stable = all (\(hasher, result) -> hasher foo == result) @@ -41,8 +60,10 @@ prop_hashes_stable = all (\(hasher, result) -> hasher foo == result) , (show . sha256, "2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae") , (show . sha384, "98c11ffdfdd540676b1a137cb1a22b2a70350c9a44171d6b1180c6be5cbb2ee3f79d532c8a1dd9ef2e8e08e752a3babb") , (show . sha512, "f7fbba6e0636f890e56fbbf3283e524c6fa3204ae298382d624741d0dc6638326e282c41be5e4254d8820772c5518a2c5a8c0c7f7eda19594a7eb539453e1ed7") +#ifdef WITH_CRYPTOHASH , (show . skein256, "a04efd9a0aeed6ede40fe5ce0d9361ae7b7d88b524aa19917b9315f1ecf00d33") , (show . skein512, "fd8956898113510180aa4658e6c0ac85bd74fb47f4a4ba264a6b705d7a8e8526756e75aecda12cff4f1aca1a4c2830fbf57f458012a66b2b15a3dd7d251690a7") +#endif ] where foo = L.fromChunks [C8.pack "foo"] diff --git a/doc/install/fromscratch.mdwn b/doc/install/fromscratch.mdwn index 7694733c7..c85de7ef0 100644 --- a/doc/install/fromscratch.mdwn +++ b/doc/install/fromscratch.mdwn @@ -7,7 +7,7 @@ quite a lot. * [MissingH](http://github.com/jgoerzen/missingh/wiki) * [utf8-string](http://hackage.haskell.org/package/utf8-string) * [SHA](http://hackage.haskell.org/package/SHA) - * [cryptohash](http://hackage.haskell.org/package/cryptohash) + * [cryptohash](http://hackage.haskell.org/package/cryptohash) (optional but recommended) * [dataenc](http://hackage.haskell.org/package/dataenc) * [monad-control](http://hackage.haskell.org/package/monad-control) * [QuickCheck 2](http://hackage.haskell.org/package/QuickCheck) diff --git a/git-annex.cabal b/git-annex.cabal index fe7723d89..c501b29be 100644 --- a/git-annex.cabal +++ b/git-annex.cabal @@ -71,12 +71,15 @@ Flag Feed Flag Quvi Description: Enable use of quvi to download videos +Flag CryptoHash + Description: Enable use of cryptohash for checksumming + Executable git-annex Main-Is: git-annex.hs Build-Depends: MissingH, hslogger, directory, filepath, containers, utf8-string, network (>= 2.0), mtl (>= 2), bytestring, old-locale, time, HTTP, - extensible-exceptions, dataenc, SHA, cryptohash, process, json, + extensible-exceptions, dataenc, SHA, process, json, base (>= 4.5 && < 4.8), monad-control, MonadCatchIO-transformers, IfElse, text, QuickCheck >= 2.1, bloomfilter, edit-distance, process, SafeSemaphore, uuid, random, dlist, unix-compat @@ -106,6 +109,10 @@ Executable git-annex if flag(TDFA) Build-Depends: regex-tdfa CPP-Options: -DWITH_TDFA + + if flag(CryptoHash) + Build-Depends: cryptohash (>= 0.10.0) + CPP-Options: -DWITH_CRYPTOHASH if flag(S3) Build-Depends: hS3 |