summaryrefslogtreecommitdiff
path: root/Backend
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-10-15 16:42:36 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-10-15 16:42:50 -0400
commit395625d0a7c00457f63925beb31078f3eb3d9f79 (patch)
tree29c4dea2b84e301aa8f4cf515b53a5bd0e634b3f /Backend
parent0e8cb63aabaa4a80769792fb07b0db2594efd6b0 (diff)
rename file -> WORM
Diffstat (limited to 'Backend')
-rw-r--r--Backend/Checksum.hs1
-rw-r--r--Backend/File.hs22
-rw-r--r--Backend/Worm.hs16
3 files changed, 26 insertions, 13 deletions
diff --git a/Backend/Checksum.hs b/Backend/Checksum.hs
index bfc789e40..de98fbf44 100644
--- a/Backend/Checksum.hs
+++ b/Backend/Checksum.hs
@@ -7,7 +7,6 @@ import qualified Backend.File
import Data.Digest.Pure.SHA
import BackendTypes
--- based on BackendFile just with a different key type
backend = Backend.File.backend {
name = "checksum",
getKey = keyValue
diff --git a/Backend/File.hs b/Backend/File.hs
index 6267b478a..eba4b88f8 100644
--- a/Backend/File.hs
+++ b/Backend/File.hs
@@ -1,5 +1,12 @@
-{- git-annex "file" backend
- - -}
+{- git-annex pseudo-backend
+ -
+ - This backend does not really do any independant data storage,
+ - it relies on the file contents in .git/annex/ in this repo,
+ - and other accessible repos.
+ -
+ - This is an abstract backend; getKey has to be implemented to complete
+ - it.
+ -}
module Backend.File (backend) where
@@ -19,22 +26,13 @@ import qualified Annex
import UUID
backend = Backend {
- name = "file",
- getKey = keyValue,
storeFileKey = dummyStore,
retrieveKeyFile = copyKeyFile,
removeKey = dummyRemove,
hasKey = checkKeyFile
}
--- direct mapping from filename to key
-keyValue :: FilePath -> Annex (Maybe Key)
-keyValue file = return $ Just $ Key ((name backend), file)
-
-{- This backend does not really do any independant data storage,
- - it relies on the file contents in .git/annex/ in this repo,
- - and other accessible repos. So storing a key is
- - a no-op. -}
+{- Storing a key is a no-op. -}
dummyStore :: FilePath -> Key -> Annex (Bool)
dummyStore file key = return True
diff --git a/Backend/Worm.hs b/Backend/Worm.hs
new file mode 100644
index 000000000..26fffab52
--- /dev/null
+++ b/Backend/Worm.hs
@@ -0,0 +1,16 @@
+{- git-annex "WORM" backend -- Write Once, Read Many
+ - -}
+
+module Backend.Worm (backend) where
+
+import qualified Backend.File
+import BackendTypes
+
+backend = Backend.File.backend {
+ name = "WORM",
+ getKey = keyValue
+}
+
+-- direct mapping from filename to key
+keyValue :: FilePath -> Annex (Maybe Key)
+keyValue file = return $ Just $ Key ((name backend), file)