aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-06-01 21:56:04 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-06-01 21:56:04 -0400
commit703c437bd9c6cb9e4675b65ac2b107f76b135d71 (patch)
treea6f35036bdd2b33aca50fd899448a0f6e3b60507
parent971ab27e7820a3228f71dd42f3e870c0fc2f4345 (diff)
rename modules for data types into Types/ directory
-rw-r--r--Annex.hs8
-rw-r--r--Backend.hs4
-rw-r--r--Backend/File.hs4
-rw-r--r--Backend/SHA.hs4
-rw-r--r--Backend/URL.hs4
-rw-r--r--Backend/WORM.hs4
-rw-r--r--Command.hs2
-rw-r--r--Command/DropUnused.hs2
-rw-r--r--Command/FromKey.hs2
-rw-r--r--Command/InitRemote.hs16
-rw-r--r--Command/Status.hs10
-rw-r--r--Content.hs2
-rw-r--r--Crypto.hs6
-rw-r--r--Locations.hs2
-rw-r--r--Remote.hs2
-rw-r--r--Remote/Bup.hs2
-rw-r--r--Remote/Directory.hs2
-rw-r--r--Remote/Encryptable.hs2
-rw-r--r--Remote/Git.hs2
-rw-r--r--Remote/Hook.hs2
-rw-r--r--Remote/Rsync.hs2
-rw-r--r--Remote/S3real.hs4
-rw-r--r--Remote/Special.hs2
-rw-r--r--Types.hs4
-rw-r--r--Types/Backend.hs (renamed from BackendClass.hs)4
-rw-r--r--Types/Crypto.hs (renamed from CryptoTypes.hs)2
-rw-r--r--Types/Key.hs (renamed from Key.hs)4
-rw-r--r--Types/Remote.hs (renamed from RemoteClass.hs)6
-rw-r--r--Types/UUID.hs (renamed from UUIDType.hs)2
-rw-r--r--UUID.hs2
-rw-r--r--Upgrade/V1.hs2
-rw-r--r--test.hs4
32 files changed, 61 insertions, 59 deletions
diff --git a/Annex.hs b/Annex.hs
index 92a4911ea..06d642b74 100644
--- a/Annex.hs
+++ b/Annex.hs
@@ -21,11 +21,11 @@ import Control.Monad.State
import qualified GitRepo as Git
import GitQueue
-import BackendClass
-import RemoteClass
-import CryptoTypes
+import Types.Backend
+import Types.Remote
+import Types.Crypto
import TrustLevel
-import UUIDType
+import Types.UUID
-- git-annex's monad
type Annex = StateT AnnexState IO
diff --git a/Backend.hs b/Backend.hs
index 645bfdfc3..78a53d02c 100644
--- a/Backend.hs
+++ b/Backend.hs
@@ -42,8 +42,8 @@ import Locations
import qualified GitRepo as Git
import qualified Annex
import Types
-import Key
-import qualified BackendClass as B
+import Types.Key
+import qualified Types.Backend as B
import Messages
import Content
import DataUnits
diff --git a/Backend/File.hs b/Backend/File.hs
index 543f02af7..bf21224a9 100644
--- a/Backend/File.hs
+++ b/Backend/File.hs
@@ -18,7 +18,7 @@ import Control.Monad.State (liftIO)
import Data.List
import Data.String.Utils
-import BackendClass
+import Types.Backend
import LocationLog
import qualified Remote
import qualified GitRepo as Git
@@ -28,7 +28,7 @@ import Types
import UUID
import Messages
import Trust
-import Key
+import Types.Key
backend :: Backend Annex
backend = Backend {
diff --git a/Backend/SHA.hs b/Backend/SHA.hs
index 6d721038c..94ebe093e 100644
--- a/Backend/SHA.hs
+++ b/Backend/SHA.hs
@@ -17,15 +17,15 @@ import System.Posix.Files
import System.FilePath
import qualified Backend.File
-import BackendClass
import Messages
import qualified Annex
import Locations
import Content
import Types
+import Types.Backend
+import Types.Key
import Utility
import qualified SysConfig
-import Key
type SHASize = Int
diff --git a/Backend/URL.hs b/Backend/URL.hs
index 3068c3027..e41004dd4 100644
--- a/Backend/URL.hs
+++ b/Backend/URL.hs
@@ -10,10 +10,10 @@ module Backend.URL (backends) where
import Control.Monad.State (liftIO)
import Types
-import BackendClass
+import Types.Backend
import Utility
import Messages
-import Key
+import Types.Key
backends :: [Backend Annex]
backends = [backend]
diff --git a/Backend/WORM.hs b/Backend/WORM.hs
index b33c60763..dc2e48adc 100644
--- a/Backend/WORM.hs
+++ b/Backend/WORM.hs
@@ -12,9 +12,9 @@ import System.FilePath
import System.Posix.Files
import qualified Backend.File
-import BackendClass
+import Types.Backend
import Types
-import Key
+import Types.Key
backends :: [Backend Annex]
backends = [backend]
diff --git a/Command.hs b/Command.hs
index 0da847d24..228c1f40e 100644
--- a/Command.hs
+++ b/Command.hs
@@ -24,7 +24,7 @@ import qualified Annex
import qualified GitRepo as Git
import Locations
import Utility
-import Key
+import Types.Key
{- A command runs in four stages.
-
diff --git a/Command/DropUnused.hs b/Command/DropUnused.hs
index 1bb3b7f97..0f9981447 100644
--- a/Command/DropUnused.hs
+++ b/Command/DropUnused.hs
@@ -22,7 +22,7 @@ import qualified Command.Move
import qualified Remote
import qualified GitRepo as Git
import Backend
-import Key
+import Types.Key
import Utility
type UnusedMap = M.Map String Key
diff --git a/Command/FromKey.hs b/Command/FromKey.hs
index ca61094eb..34816d657 100644
--- a/Command/FromKey.hs
+++ b/Command/FromKey.hs
@@ -18,7 +18,7 @@ import Utility
import qualified Backend
import Content
import Messages
-import Key
+import Types.Key
command :: [Command]
command = [repoCommand "fromkey" paramPath seek
diff --git a/Command/InitRemote.hs b/Command/InitRemote.hs
index 460f14de2..41d3c37c7 100644
--- a/Command/InitRemote.hs
+++ b/Command/InitRemote.hs
@@ -16,7 +16,7 @@ import Data.String.Utils
import Command
import qualified Annex
import qualified Remote
-import qualified RemoteClass
+import qualified Types.Remote as R
import qualified GitRepo as Git
import Utility
import Types
@@ -54,12 +54,12 @@ start ws = notBareRepo $ do
else err $ "Either a new name, or one of these existing special remotes: " ++ join " " names
-perform :: RemoteClass.RemoteType Annex -> UUID -> RemoteClass.RemoteConfig -> CommandPerform
+perform :: R.RemoteType Annex -> UUID -> R.RemoteConfig -> CommandPerform
perform t u c = do
- c' <- RemoteClass.setup t u c
+ c' <- R.setup t u c
next $ cleanup u c'
-cleanup :: UUID -> RemoteClass.RemoteConfig -> CommandCleanup
+cleanup :: UUID -> R.RemoteConfig -> CommandCleanup
cleanup u c = do
Remote.configSet u c
g <- Annex.gitRepo
@@ -73,7 +73,7 @@ cleanup u c = do
return True
{- Look up existing remote's UUID and config by name, or generate a new one -}
-findByName :: String -> Annex (UUID, RemoteClass.RemoteConfig)
+findByName :: String -> Annex (UUID, R.RemoteConfig)
findByName name = do
m <- Remote.readRemoteLog
maybe generate return $ findByName' name m
@@ -82,7 +82,7 @@ findByName name = do
uuid <- liftIO $ genUUID
return (uuid, M.insert nameKey name M.empty)
-findByName' :: String -> M.Map UUID RemoteClass.RemoteConfig -> Maybe (UUID, RemoteClass.RemoteConfig)
+findByName' :: String -> M.Map UUID R.RemoteConfig -> Maybe (UUID, R.RemoteConfig)
findByName' n m = if null matches then Nothing else Just $ head matches
where
matches = filter (matching . snd) $ M.toList m
@@ -98,14 +98,14 @@ remoteNames = do
return $ catMaybes $ map ((M.lookup nameKey) . snd) $ M.toList m
{- find the specified remote type -}
-findType :: RemoteClass.RemoteConfig -> Annex (RemoteClass.RemoteType Annex)
+findType :: R.RemoteConfig -> Annex (R.RemoteType Annex)
findType config = maybe unspecified specified $ M.lookup typeKey config
where
unspecified = error "Specify the type of remote with type="
specified s = case filter (findtype s) Remote.remoteTypes of
[] -> error $ "Unknown remote type " ++ s
(t:_) -> return t
- findtype s i = RemoteClass.typename i == s
+ findtype s i = R.typename i == s
{- The name of a configured remote is stored in its config using this key. -}
nameKey :: String
diff --git a/Command/Status.hs b/Command/Status.hs
index dd518416c..1a7f694ba 100644
--- a/Command/Status.hs
+++ b/Command/Status.hs
@@ -14,8 +14,8 @@ import Data.List
import qualified Data.Map as M
import qualified Annex
-import qualified BackendClass
-import qualified RemoteClass
+import qualified Types.Backend as B
+import qualified Types.Remote as R
import qualified Remote
import qualified Command.Unused
import qualified GitRepo as Git
@@ -23,7 +23,7 @@ import Command
import Types
import DataUnits
import Content
-import Key
+import Types.Key
import Locations
-- a named computation that produces a statistic
@@ -97,11 +97,11 @@ showStat s = calc =<< s
supported_backends :: Stat
supported_backends = stat "supported backends" $
lift (Annex.getState Annex.supportedBackends) >>=
- return . unwords . (map BackendClass.name)
+ return . unwords . (map B.name)
supported_remote_types :: Stat
supported_remote_types = stat "supported remote types" $
- return $ unwords $ map RemoteClass.typename Remote.remoteTypes
+ return $ unwords $ map R.typename Remote.remoteTypes
local_annex_size :: Stat
local_annex_size = stat "local annex size" $
diff --git a/Content.hs b/Content.hs
index ec7a3776b..57977ce34 100644
--- a/Content.hs
+++ b/Content.hs
@@ -41,7 +41,7 @@ import qualified Annex
import qualified AnnexQueue
import Utility
import StatFS
-import Key
+import Types.Key
import DataUnits
import Config
diff --git a/Crypto.hs b/Crypto.hs
index 42f138950..e84e397f2 100644
--- a/Crypto.hs
+++ b/Crypto.hs
@@ -43,11 +43,11 @@ import System.Exit
import System.Environment
import Types
-import Key
-import RemoteClass
+import Types.Key
+import Types.Remote
import Utility
import Base64
-import CryptoTypes
+import Types.Crypto
{- The first half of a Cipher is used for HMAC; the remainder
- is used as the GPG symmetric encryption passphrase.
diff --git a/Locations.hs b/Locations.hs
index 38a320a2b..da781ac83 100644
--- a/Locations.hs
+++ b/Locations.hs
@@ -36,7 +36,7 @@ import Word
import Data.Hash.MD5
import Types
-import Key
+import Types.Key
import qualified GitRepo as Git
{- Conventions:
diff --git a/Remote.hs b/Remote.hs
index 9685b4612..e7ef5f195 100644
--- a/Remote.hs
+++ b/Remote.hs
@@ -39,8 +39,8 @@ import qualified Data.Map as M
import Data.Maybe
import Data.Char
-import RemoteClass
import Types
+import Types.Remote
import UUID
import qualified Annex
import Locations
diff --git a/Remote/Bup.hs b/Remote/Bup.hs
index c40826e5e..c011c979c 100644
--- a/Remote/Bup.hs
+++ b/Remote/Bup.hs
@@ -19,8 +19,8 @@ import System.FilePath
import Data.List.Utils
import System.Cmd.Utils
-import RemoteClass
import Types
+import Types.Remote
import qualified GitRepo as Git
import qualified Annex
import UUID
diff --git a/Remote/Directory.hs b/Remote/Directory.hs
index dedab473f..7b5917dca 100644
--- a/Remote/Directory.hs
+++ b/Remote/Directory.hs
@@ -16,8 +16,8 @@ import Control.Monad.State (liftIO)
import System.Directory hiding (copyFile)
import System.FilePath
-import RemoteClass
import Types
+import Types.Remote
import qualified GitRepo as Git
import qualified Annex
import UUID
diff --git a/Remote/Encryptable.hs b/Remote/Encryptable.hs
index 68ecfd01e..443f5cf83 100644
--- a/Remote/Encryptable.hs
+++ b/Remote/Encryptable.hs
@@ -11,7 +11,7 @@ import qualified Data.Map as M
import Control.Monad.State (liftIO)
import Types
-import RemoteClass
+import Types.Remote
import Crypto
import qualified Annex
import Messages
diff --git a/Remote/Git.hs b/Remote/Git.hs
index e6df6be46..67d49df7d 100644
--- a/Remote/Git.hs
+++ b/Remote/Git.hs
@@ -12,8 +12,8 @@ import Control.Monad.State (liftIO)
import qualified Data.Map as M
import System.Cmd.Utils
-import RemoteClass
import Types
+import Types.Remote
import qualified GitRepo as Git
import qualified Annex
import qualified AnnexQueue
diff --git a/Remote/Hook.hs b/Remote/Hook.hs
index dc4d39274..cc511965f 100644
--- a/Remote/Hook.hs
+++ b/Remote/Hook.hs
@@ -18,8 +18,8 @@ import System.IO
import System.IO.Error (try)
import System.Exit
-import RemoteClass
import Types
+import Types.Remote
import qualified GitRepo as Git
import qualified Annex
import UUID
diff --git a/Remote/Rsync.hs b/Remote/Rsync.hs
index 9d32ad19b..bf1bbd870 100644
--- a/Remote/Rsync.hs
+++ b/Remote/Rsync.hs
@@ -16,8 +16,8 @@ import System.Directory
import System.Posix.Files
import System.Posix.Process
-import RemoteClass
import Types
+import Types.Remote
import qualified GitRepo as Git
import qualified Annex
import UUID
diff --git a/Remote/S3real.hs b/Remote/S3real.hs
index baf570593..2479dfa02 100644
--- a/Remote/S3real.hs
+++ b/Remote/S3real.hs
@@ -24,8 +24,9 @@ import System.Environment
import System.Posix.Files
import System.Posix.Env (setEnv)
-import RemoteClass
import Types
+import Types.Remote
+import Types.Key
import qualified GitRepo as Git
import qualified Annex
import UUID
@@ -35,7 +36,6 @@ import Config
import Remote.Special
import Remote.Encryptable
import Crypto
-import Key
import Content
import Base64
diff --git a/Remote/Special.hs b/Remote/Special.hs
index 53ac2c6ee..7d2ea1d70 100644
--- a/Remote/Special.hs
+++ b/Remote/Special.hs
@@ -13,7 +13,7 @@ import Data.String.Utils
import Control.Monad.State (liftIO)
import Types
-import RemoteClass
+import Types.Remote
import qualified GitRepo as Git
import qualified Annex
import UUID
diff --git a/Types.hs b/Types.hs
index 503e27d31..6353f6da6 100644
--- a/Types.hs
+++ b/Types.hs
@@ -11,6 +11,6 @@ module Types (
Key
) where
-import BackendClass
import Annex
-import Key
+import Types.Backend
+import Types.Key
diff --git a/BackendClass.hs b/Types/Backend.hs
index b2d8879c2..8100eaf28 100644
--- a/BackendClass.hs
+++ b/Types/Backend.hs
@@ -7,9 +7,9 @@
- Licensed under the GNU GPL version 3 or higher.
-}
-module BackendClass where
+module Types.Backend where
-import Key
+import Types.Key
data Backend a = Backend {
-- name of this backend
diff --git a/CryptoTypes.hs b/Types/Crypto.hs
index ba22c4cbe..a39a016b8 100644
--- a/CryptoTypes.hs
+++ b/Types/Crypto.hs
@@ -5,7 +5,7 @@
- Licensed under the GNU GPL version 3 or higher.
-}
-module CryptoTypes where
+module Types.Crypto where
import Data.String.Utils
diff --git a/Key.hs b/Types/Key.hs
index e1d8ee34d..1d9bf8e11 100644
--- a/Key.hs
+++ b/Types/Key.hs
@@ -1,11 +1,13 @@
{- git-annex Key data type
+ -
+ - Most things should not need this, using Types instead
-
- Copyright 2011 Joey Hess <joey@kitenet.net>
-
- Licensed under the GNU GPL version 3 or higher.
-}
-module Key (
+module Types.Key (
Key(..),
stubKey,
readKey,
diff --git a/RemoteClass.hs b/Types/Remote.hs
index f954e4ff8..01ced04ae 100644
--- a/RemoteClass.hs
+++ b/Types/Remote.hs
@@ -1,4 +1,4 @@
-{- git-annex remotes class
+{- git-annex remotes types
-
- Most things should not need this, using Remote instead
-
@@ -7,13 +7,13 @@
- Licensed under the GNU GPL version 3 or higher.
-}
-module RemoteClass where
+module Types.Remote where
import Control.Exception
import Data.Map as M
import qualified GitRepo as Git
-import Key
+import Types.Key
type RemoteConfig = M.Map String String
diff --git a/UUIDType.hs b/Types/UUID.hs
index 8e207b444..eb3497fa9 100644
--- a/UUIDType.hs
+++ b/Types/UUID.hs
@@ -5,7 +5,7 @@
- Licensed under the GNU GPL version 3 or higher.
-}
-module UUIDType where
+module Types.UUID where
-- might be nice to have a newtype, but lots of stuff treats uuids as strings
type UUID = String
diff --git a/UUID.hs b/UUID.hs
index 33835e261..f222f7a9d 100644
--- a/UUID.hs
+++ b/UUID.hs
@@ -31,12 +31,12 @@ import Data.Maybe
import qualified GitRepo as Git
import Types
+import Types.UUID
import Locations
import qualified Annex
import Utility
import qualified SysConfig
import Config
-import UUIDType
configkey :: String
configkey = "annex.uuid"
diff --git a/Upgrade/V1.hs b/Upgrade/V1.hs
index 9278bce60..1e634e00e 100644
--- a/Upgrade/V1.hs
+++ b/Upgrade/V1.hs
@@ -18,7 +18,7 @@ import System.Posix.Types
import Data.Maybe
import Data.Char
-import Key
+import Types.Key
import Content
import Types
import Locations
diff --git a/test.hs b/test.hs
index 456c09060..221607755 100644
--- a/test.hs
+++ b/test.hs
@@ -31,7 +31,7 @@ import qualified Backend
import qualified GitRepo as Git
import qualified Locations
import qualified Utility
-import qualified BackendClass
+import qualified Type.Backend
import qualified Types
import qualified GitAnnex
import qualified LocationLog
@@ -40,7 +40,7 @@ import qualified Trust
import qualified Remote
import qualified Content
import qualified Command.DropUnused
-import qualified Key
+import qualified Type.Key
import qualified Config
import qualified Crypto