diff options
author | Joey Hess <joey@kitenet.net> | 2014-07-30 11:19:05 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2014-07-30 11:20:35 -0400 |
commit | 58e7f9b8681f24304ddc20cc6b32691f7c5070b1 (patch) | |
tree | adb3274007ba31ff6bcb5b67a4785af42b00226d | |
parent | a6b6666c488f37e2e02ca0ec151283e0a41c5631 (diff) |
WebDAV: Dropped support for DAV before 0.6.1.
0.6.1 is in testing, and stable does not have DAV at all, so I can dispense
with this compatability code
-rw-r--r-- | Remote/WebDAV.hs | 45 | ||||
-rw-r--r-- | debian/changelog | 1 | ||||
-rw-r--r-- | git-annex.cabal | 2 |
3 files changed, 4 insertions, 44 deletions
diff --git a/Remote/WebDAV.hs b/Remote/WebDAV.hs index 31e4225e4..d6644cdc7 100644 --- a/Remote/WebDAV.hs +++ b/Remote/WebDAV.hs @@ -5,7 +5,7 @@ - Licensed under the GNU GPL version 3 or higher. -} -{-# LANGUAGE ScopedTypeVariables, CPP #-} +{-# LANGUAGE ScopedTypeVariables #-} module Remote.WebDAV (remote, davCreds, configUrl) where @@ -16,11 +16,7 @@ import qualified Data.ByteString.Lazy.UTF8 as L8 import qualified Data.ByteString.Lazy as L import qualified Control.Exception as E import qualified Control.Exception.Lifted as EL -#if MIN_VERSION_DAV(0,6,0) import Network.HTTP.Client (HttpException(..)) -#else -import Network.HTTP.Conduit (HttpException(..)) -#endif import Network.HTTP.Types import System.Log.Logger (debugM) import System.IO.Error @@ -308,57 +304,37 @@ debugDAV :: DavUrl -> String -> IO () debugDAV msg url = debugM "DAV" $ msg ++ " " ++ url {--------------------------------------------------------------------- - - Low-level DAV operations, using the new DAV monad when available. + - Low-level DAV operations. ---------------------------------------------------------------------} putDAV :: DavUrl -> DavUser -> DavPass -> L.ByteString -> IO () putDAV url user pass b = do debugDAV "PUT" url -#if MIN_VERSION_DAV(0,6,0) goDAV url user pass $ putContentM (contentType, b) -#else - putContent url user pass (contentType, b) -#endif getDAV :: DavUrl -> DavUser -> DavPass -> IO (Maybe L.ByteString) getDAV url user pass = do debugDAV "GET" url eitherToMaybe <$> tryNonAsync go where -#if MIN_VERSION_DAV(0,6,0) go = goDAV url user pass $ snd <$> getContentM -#else - go = snd . snd <$> getPropsAndContent url user pass -#endif deleteDAV :: DavUrl -> DavUser -> DavPass -> IO () deleteDAV url user pass = do debugDAV "DELETE" url -#if MIN_VERSION_DAV(0,6,0) goDAV url user pass delContentM -#else - deleteContent url user pass -#endif moveDAV :: DavUrl -> DavUrl -> DavUser -> DavPass -> IO () moveDAV url newurl user pass = do debugDAV ("MOVE to " ++ newurl ++ " from ") url -#if MIN_VERSION_DAV(0,6,0) goDAV url user pass $ moveContentM newurl' -#else - moveContent url newurl' user pass -#endif where newurl' = B8.fromString newurl mkdirDAV :: DavUrl -> DavUser -> DavPass -> IO Bool mkdirDAV url user pass = do debugDAV "MKDIR" url -#if MIN_VERSION_DAV(0,6,0) goDAV url user pass mkCol -#else - makeCollection url user pass -#endif existsDAV :: DavUrl -> DavUser -> DavPass -> IO (Either String Bool) existsDAV url user pass = do @@ -366,35 +342,19 @@ existsDAV url user pass = do either (Left . show) id <$> tryNonAsync check where ispresent = return . Right -#if MIN_VERSION_DAV(0,6,0) check = goDAV url user pass $ do setDepth Nothing EL.catchJust (matchStatusCodeException notFound404) (getPropsM >> ispresent True) (const $ ispresent False) -#else - check = E.catchJust - (matchStatusCodeException notFound404) -#if ! MIN_VERSION_DAV(0,4,0) - (getProps url user pass >> ispresent True) -#else - (getProps url user pass Nothing >> ispresent True) -#endif - (const $ ispresent False) -#endif matchStatusCodeException :: Status -> HttpException -> Maybe () -#if MIN_VERSION_DAV(0,6,0) matchStatusCodeException want (StatusCodeException s _ _) -#else -matchStatusCodeException want (StatusCodeException s _) -#endif | s == want = Just () | otherwise = Nothing matchStatusCodeException _ _ = Nothing -#if MIN_VERSION_DAV(0,6,0) goDAV :: DavUrl -> DavUser -> DavPass -> DAVT IO a -> IO a goDAV url user pass a = choke $ evalDAVT url $ do setResponseTimeout Nothing -- disable default (5 second!) timeout @@ -407,4 +367,3 @@ goDAV url user pass a = choke $ evalDAVT url $ do case x of Left e -> error e Right r -> return r -#endif diff --git a/debian/changelog b/debian/changelog index 32704de56..bacd89080 100644 --- a/debian/changelog +++ b/debian/changelog @@ -14,6 +14,7 @@ git-annex (5.20140718) UNRELEASED; urgency=medium Fix this, including support for fixing up repositories that were incompletely repaired before. * Fix cost calculation for non-encrypted remotes. + * WebDAV: Dropped support for DAV before 0.6.1. -- Joey Hess <joeyh@debian.org> Mon, 21 Jul 2014 14:41:26 -0400 diff --git a/git-annex.cabal b/git-annex.cabal index ba23d281e..0d0d979ea 100644 --- a/git-annex.cabal +++ b/git-annex.cabal @@ -142,7 +142,7 @@ Executable git-annex CPP-Options: -DWITH_S3 if flag(WebDAV) - Build-Depends: DAV ((>= 0.3 && < 0.6) || > 0.6), + Build-Depends: DAV (> 0.6), http-client, http-conduit, http-types, lifted-base CPP-Options: -DWITH_WEBDAV |