summaryrefslogtreecommitdiff
path: root/Backend
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-07-01 16:00:44 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-07-01 16:01:04 -0400
commit2cdacfbae6519eceed2d5dcbea052de244a0b8ec (patch)
tree3504d84794736973dd5a77e1891bc76873576d4e /Backend
parent6ba866ca738d6a63858916f84979cfd346bcb403 (diff)
remove URL backend
Diffstat (limited to 'Backend')
-rw-r--r--Backend/URL.hs61
1 files changed, 0 insertions, 61 deletions
diff --git a/Backend/URL.hs b/Backend/URL.hs
deleted file mode 100644
index e41004dd4..000000000
--- a/Backend/URL.hs
+++ /dev/null
@@ -1,61 +0,0 @@
-{- git-annex "URL" backend
- -
- - Copyright 2010 Joey Hess <joey@kitenet.net>
- -
- - Licensed under the GNU GPL version 3 or higher.
- -}
-
-module Backend.URL (backends) where
-
-import Control.Monad.State (liftIO)
-
-import Types
-import Types.Backend
-import Utility
-import Messages
-import Types.Key
-
-backends :: [Backend Annex]
-backends = [backend]
-
-backend :: Backend Annex
-backend = Backend {
- name = "URL",
- getKey = keyValue,
- storeFileKey = dummyStore,
- retrieveKeyFile = downloadUrl,
- -- allow keys to be removed; presumably they can always be
- -- downloaded again
- removeKey = dummyRemove,
- -- similarly, keys are always assumed to be out there on the web
- hasKey = dummyOk,
- -- and nothing needed to fsck
- fsckKey = dummyFsck,
- -- and key upgrade not needed
- upgradableKey = \_ -> return False
-}
-
--- cannot generate url from filename
-keyValue :: FilePath -> Annex (Maybe Key)
-keyValue _ = return Nothing
-
--- cannot change url contents
-dummyStore :: FilePath -> Key -> Annex Bool
-dummyStore _ _ = return False
-
-dummyRemove :: Key -> Maybe a -> Annex Bool
-dummyRemove _ _ = return True
-
-dummyFsck :: Key -> Maybe FilePath -> Maybe a -> Annex Bool
-dummyFsck _ _ _ = return True
-
-dummyOk :: Key -> Annex Bool
-dummyOk _ = return True
-
-downloadUrl :: Key -> FilePath -> Annex Bool
-downloadUrl key file = do
- showNote $ "downloading"
- showProgress -- make way for curl progress bar
- liftIO $ boolSystem "curl" [Params "-# -o", File file, File url]
- where
- url = keyName key