summaryrefslogtreecommitdiff
path: root/Backend
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-10-31 16:00:32 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-10-31 16:00:32 -0400
commitcf4c926f2e78bd315988c1aae063f6b4148a2fae (patch)
treef7fdc76a1cc92c2c2836aff9ea10543679ab0457 /Backend
parentb2c28c1ac0700eadc8689cdfb6f065d5147108bd (diff)
more Wall cleaning
Diffstat (limited to 'Backend')
-rw-r--r--Backend/File.hs15
-rw-r--r--Backend/SHA1.hs1
-rw-r--r--Backend/URL.hs10
-rw-r--r--Backend/WORM.hs3
4 files changed, 11 insertions, 18 deletions
diff --git a/Backend/File.hs b/Backend/File.hs
index b45354752..5b93d8227 100644
--- a/Backend/File.hs
+++ b/Backend/File.hs
@@ -15,25 +15,18 @@
module Backend.File (backend) where
import Control.Monad.State
-import System.IO
-import System.Cmd
-import System.Cmd.Utils
-import Control.Exception
import System.Directory
-import List
-import Maybe
import TypeInternals
import LocationLog
import Locations
import qualified Remotes
import qualified GitRepo as Git
-import Utility
import Core
import qualified Annex
import UUID
-import qualified Backend
+backend :: Backend
backend = Backend {
name = mustProvide,
getKey = mustProvide,
@@ -43,11 +36,12 @@ backend = Backend {
hasKey = checkKeyFile
}
+mustProvide :: a
mustProvide = error "must provide this field"
{- Storing a key is a no-op. -}
dummyStore :: FilePath -> Key -> Annex (Bool)
-dummyStore file key = return True
+dummyStore _ _ = return True
{- Just check if the .git/annex/ file for the key exists. -}
checkKeyFile :: Key -> Annex Bool
@@ -146,7 +140,8 @@ showLocations key = do
if (null uuidsf)
then showLongNote $ "No other repository is known to contain the file."
else showLongNote $ "Try making some of these repositories available:\n" ++ ppuuids
-
+
+showTriedRemotes :: [Git.Repo] -> Annex ()
showTriedRemotes [] = return ()
showTriedRemotes remotes =
showLongNote $ "I was unable to access these remotes: " ++
diff --git a/Backend/SHA1.hs b/Backend/SHA1.hs
index f6daeffec..76c368f84 100644
--- a/Backend/SHA1.hs
+++ b/Backend/SHA1.hs
@@ -15,6 +15,7 @@ import System.IO
import qualified Backend.File
import TypeInternals
+backend :: Backend
backend = Backend.File.backend {
name = "SHA1",
getKey = keyValue
diff --git a/Backend/URL.hs b/Backend/URL.hs
index 384f933eb..e6d3eb1ae 100644
--- a/Backend/URL.hs
+++ b/Backend/URL.hs
@@ -9,14 +9,12 @@ module Backend.URL (backend) where
import Control.Monad.State (liftIO)
import Data.String.Utils
-import System.Cmd
-import System.Cmd.Utils
-import System.Exit
import TypeInternals
import Core
import Utility
+backend :: Backend
backend = Backend {
name = "URL",
getKey = keyValue,
@@ -28,15 +26,15 @@ backend = Backend {
-- cannot generate url from filename
keyValue :: FilePath -> Annex (Maybe Key)
-keyValue file = return Nothing
+keyValue _ = return Nothing
-- cannot change url contents
dummyStore :: FilePath -> Key -> Annex Bool
-dummyStore file url = return False
+dummyStore _ _ = return False
-- allow keys to be removed; presumably they can always be downloaded again
dummyOk :: Key -> Annex Bool
-dummyOk url = return True
+dummyOk _ = return True
downloadUrl :: Key -> FilePath -> Annex Bool
downloadUrl key file = do
diff --git a/Backend/WORM.hs b/Backend/WORM.hs
index b5ae11807..848386ecd 100644
--- a/Backend/WORM.hs
+++ b/Backend/WORM.hs
@@ -10,12 +10,11 @@ module Backend.WORM (backend) where
import Control.Monad.State
import System.FilePath
import System.Posix.Files
-import qualified Data.ByteString.Lazy.Char8 as B
import qualified Backend.File
import TypeInternals
-import Utility
+backend :: Backend
backend = Backend.File.backend {
name = "WORM",
getKey = keyValue