diff options
author | Joey Hess <joey@kitenet.net> | 2010-10-17 11:47:36 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2010-10-17 11:47:36 -0400 |
commit | b471822cfe4476995f539c6e7e7da7f7bf2b5e02 (patch) | |
tree | 31963b299051850ee0514dfec9a655e4a326c503 /BackendList.hs | |
parent | 6bfa534aa4d7552c4ccfdb9523b55da19fac8883 (diff) |
move supportedBackends list into annex monad
This was necessary so the File backend could import Backend w/o a cycle.
Moved code that checks whether enough backends have a file into File
backend.
Diffstat (limited to 'BackendList.hs')
-rw-r--r-- | BackendList.hs | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/BackendList.hs b/BackendList.hs index 42e237204..920f8fc0a 100644 --- a/BackendList.hs +++ b/BackendList.hs @@ -1,11 +1,7 @@ {- git-annex backend list - -} -module BackendList ( - supportedBackends, - parseBackendList, - lookupBackendName -) where +module BackendList (allBackends) where import BackendTypes @@ -13,25 +9,8 @@ import BackendTypes import qualified Backend.WORM import qualified Backend.SHA1 import qualified Backend.URL -supportedBackends = +allBackends = [ Backend.WORM.backend , Backend.SHA1.backend , Backend.URL.backend ] - -{- Parses a string with a list of backend names into - - a list of Backend objects. If the list is empty, - - defaults to supportedBackends. -} -parseBackendList :: String -> [Backend] -parseBackendList s = - if (length s == 0) - then supportedBackends - else map (lookupBackendName) $ words s - -{- Looks up a supported backend by name. -} -lookupBackendName :: String -> Backend -lookupBackendName s = - if ((length matches) /= 1) - then error $ "unknown backend " ++ s - else matches !! 0 - where matches = filter (\b -> s == name b) supportedBackends |