summaryrefslogtreecommitdiff
path: root/Annex
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-05-05 20:15:32 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-05-05 20:16:56 -0400
commitf7d8982672fd330a466c2cb22f34388e7cc429c0 (patch)
treeb5739058cc2cb04fa4a119df2cecf449d4846c03 /Annex
parent657d09d49990af85c1a91b1154a195a30438477c (diff)
Fix use of several config settings
annex.ssh-options, annex.rsync-options, annex.bup-split-options. And adjust types to avoid the bugs that broke several config settings recently. Now "annex." prefixing is enforced at the type level.
Diffstat (limited to 'Annex')
-rw-r--r--Annex/Content.hs4
-rw-r--r--Annex/Queue.hs2
-rw-r--r--Annex/Ssh.hs2
-rw-r--r--Annex/UUID.hs14
-rw-r--r--Annex/Version.hs4
5 files changed, 13 insertions, 13 deletions
diff --git a/Annex/Content.hs b/Annex/Content.hs
index b5754e15b..2142d1f09 100644
--- a/Annex/Content.hs
+++ b/Annex/Content.hs
@@ -304,12 +304,12 @@ saveState oneshot = doSideAction $ do
( Annex.Branch.commit "update" , Annex.Branch.stage)
where
alwayscommit = fromMaybe True . Git.configTrue
- <$> getConfig "annex.alwayscommit" ""
+ <$> getConfig (annexConfig "alwayscommit") ""
{- Downloads content from any of a list of urls. -}
downloadUrl :: [Url.URLString] -> FilePath -> Annex Bool
downloadUrl urls file = do
- o <- map Param . words <$> getConfig "annex.web-options" ""
+ o <- map Param . words <$> getConfig (annexConfig "web-options") ""
headers <- getHttpHeaders
liftIO $ anyM (\u -> Url.download u headers o file) urls
diff --git a/Annex/Queue.hs b/Annex/Queue.hs
index 728e29645..24575e906 100644
--- a/Annex/Queue.hs
+++ b/Annex/Queue.hs
@@ -46,7 +46,7 @@ new = do
store q
return q
where
- queuesize = readish <$> getConfig "annex.queuesize" ""
+ queuesize = readish <$> getConfig (annexConfig "queuesize") ""
store :: Git.Queue.Queue -> Annex ()
store q = changeState $ \s -> s { repoqueue = Just q }
diff --git a/Annex/Ssh.hs b/Annex/Ssh.hs
index 6a230312a..f0824b119 100644
--- a/Annex/Ssh.hs
+++ b/Annex/Ssh.hs
@@ -48,7 +48,7 @@ sshInfo (host, port) = ifM caching
where
caching = fromMaybe SysConfig.sshconnectioncaching
. Git.configTrue
- <$> getConfig "annex.sshcaching" ""
+ <$> getConfig (annexConfig "sshcaching") ""
cacheParams :: FilePath -> [CommandParam]
cacheParams socketfile =
diff --git a/Annex/UUID.hs b/Annex/UUID.hs
index 5459cc7fe..517840fba 100644
--- a/Annex/UUID.hs
+++ b/Annex/UUID.hs
@@ -23,12 +23,11 @@ module Annex.UUID (
import Common.Annex
import qualified Git
import qualified Git.Config
-import qualified Git.Command
import qualified Build.SysConfig as SysConfig
import Config
-configkey :: String
-configkey = "annex.uuid"
+configkey :: ConfigKey
+configkey = annexConfig "uuid"
{- Generates a UUID. There is a library for this, but it's not packaged,
- so use the command line tool. -}
@@ -64,16 +63,17 @@ getRepoUUID r = do
cachekey = remoteConfig r "uuid"
removeRepoUUID :: Annex ()
-removeRepoUUID = inRepo $ Git.Command.run "config"
- [Param "--unset", Param configkey]
+removeRepoUUID = unsetConfig configkey
getUncachedUUID :: Git.Repo -> UUID
-getUncachedUUID = toUUID . Git.Config.get configkey ""
+getUncachedUUID = toUUID . Git.Config.get key ""
+ where
+ (ConfigKey key) = configkey
{- Make sure that the repo has an annex.uuid setting. -}
prepUUID :: Annex ()
prepUUID = whenM ((==) NoUUID <$> getUUID) $
storeUUID configkey =<< liftIO genUUID
-storeUUID :: String -> UUID -> Annex ()
+storeUUID :: ConfigKey -> UUID -> Annex ()
storeUUID configfield = setConfig configfield . fromUUID
diff --git a/Annex/Version.hs b/Annex/Version.hs
index a1d040244..7c909ae05 100644
--- a/Annex/Version.hs
+++ b/Annex/Version.hs
@@ -21,8 +21,8 @@ supportedVersions = [defaultVersion]
upgradableVersions :: [Version]
upgradableVersions = ["0", "1", "2"]
-versionField :: String
-versionField = "annex.version"
+versionField :: ConfigKey
+versionField = annexConfig "version"
getVersion :: Annex (Maybe Version)
getVersion = handle <$> getConfig versionField ""