webdav: Avoid trying to set props, avoiding incompatability with livedrive.com. Needs DAV version 0.3.
This commit is contained in:
parent
b4e2a8358e
commit
5460414486
4 changed files with 8 additions and 13 deletions
|
@ -14,8 +14,6 @@ import qualified Data.Map as M
|
||||||
import qualified Data.ByteString.UTF8 as B8
|
import qualified Data.ByteString.UTF8 as B8
|
||||||
import qualified Data.ByteString.Lazy.UTF8 as L8
|
import qualified Data.ByteString.Lazy.UTF8 as L8
|
||||||
import qualified Data.ByteString.Lazy as L
|
import qualified Data.ByteString.Lazy as L
|
||||||
import qualified Data.Text.Lazy as LT
|
|
||||||
import qualified Text.XML as XML
|
|
||||||
import Network.URI (normalizePathSegments)
|
import Network.URI (normalizePathSegments)
|
||||||
import qualified Control.Exception as E
|
import qualified Control.Exception as E
|
||||||
import Network.HTTP.Conduit (HttpException(..))
|
import Network.HTTP.Conduit (HttpException(..))
|
||||||
|
@ -109,8 +107,8 @@ storeHelper r k baseurl user pass b = catchBoolIO $ do
|
||||||
void $ catchMaybeHttp (deleteContent desturl user pass)
|
void $ catchMaybeHttp (deleteContent desturl user pass)
|
||||||
davMkdir (urlParent desturl) user pass
|
davMkdir (urlParent desturl) user pass
|
||||||
moveContent srcurl (B8.fromString desturl) user pass
|
moveContent srcurl (B8.fromString desturl) user pass
|
||||||
storehttp url v = putContentAndProps url user pass
|
storehttp url v = putContent url user pass
|
||||||
(noProps, (contentType, v))
|
(contentType, v)
|
||||||
|
|
||||||
retrieveCheap :: Remote -> Key -> FilePath -> Annex Bool
|
retrieveCheap :: Remote -> Key -> FilePath -> Annex Bool
|
||||||
retrieveCheap _ _ _ = return False
|
retrieveCheap _ _ _ = return False
|
||||||
|
@ -293,8 +291,8 @@ testDav :: String -> Maybe CredPair -> Annex ()
|
||||||
testDav baseurl (Just (u, p)) = do
|
testDav baseurl (Just (u, p)) = do
|
||||||
showSideAction "testing WebDAV server"
|
showSideAction "testing WebDAV server"
|
||||||
test "make directory" $ davMkdir baseurl user pass
|
test "make directory" $ davMkdir baseurl user pass
|
||||||
test "write file" $ putContentAndProps testurl user pass
|
test "write file" $ putContent testurl user pass
|
||||||
(noProps, (contentType, L.empty))
|
(contentType, L.empty)
|
||||||
test "delete file" $ deleteContent testurl user pass
|
test "delete file" $ deleteContent testurl user pass
|
||||||
where
|
where
|
||||||
test desc a = liftIO $
|
test desc a = liftIO $
|
||||||
|
@ -311,11 +309,6 @@ testDav _ Nothing = error "Need to configure webdav username and password."
|
||||||
contentType :: Maybe B8.ByteString
|
contentType :: Maybe B8.ByteString
|
||||||
contentType = Just $ B8.fromString "application/octet-stream"
|
contentType = Just $ B8.fromString "application/octet-stream"
|
||||||
|
|
||||||
{- The DAV library requires that properties be specified when storing a file.
|
|
||||||
- This just omits any real properties. -}
|
|
||||||
noProps :: XML.Document
|
|
||||||
noProps = XML.parseText_ XML.def $ LT.pack "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<propertyupdate/>"
|
|
||||||
|
|
||||||
getCreds :: RemoteConfig -> UUID -> Annex (Maybe CredPair)
|
getCreds :: RemoteConfig -> UUID -> Annex (Maybe CredPair)
|
||||||
getCreds c u = getRemoteCredPairFor "webdav" c (davCreds u)
|
getCreds c u = getRemoteCredPairFor "webdav" c (davCreds u)
|
||||||
|
|
||||||
|
|
2
debian/changelog
vendored
2
debian/changelog
vendored
|
@ -13,6 +13,8 @@ git-annex (3.20121128) UNRELEASED; urgency=low
|
||||||
associated with a file.
|
associated with a file.
|
||||||
* webapp: S3 and Glacier forms now have a select list of all
|
* webapp: S3 and Glacier forms now have a select list of all
|
||||||
currently-supported AWS regions.
|
currently-supported AWS regions.
|
||||||
|
* webdav: Avoid trying to set props, avoiding incompatability with
|
||||||
|
livedrive.com. Needs DAV version 0.3.
|
||||||
|
|
||||||
-- Joey Hess <joeyh@debian.org> Wed, 28 Nov 2012 13:31:07 -0400
|
-- Joey Hess <joeyh@debian.org> Wed, 28 Nov 2012 13:31:07 -0400
|
||||||
|
|
||||||
|
|
2
debian/control
vendored
2
debian/control
vendored
|
@ -13,7 +13,7 @@ Build-Depends:
|
||||||
libghc-http-dev,
|
libghc-http-dev,
|
||||||
libghc-utf8-string-dev,
|
libghc-utf8-string-dev,
|
||||||
libghc-hs3-dev (>= 0.5.6),
|
libghc-hs3-dev (>= 0.5.6),
|
||||||
libghc-dav-dev (>= 0.2),
|
libghc-dav-dev (>= 0.3),
|
||||||
libghc-testpack-dev,
|
libghc-testpack-dev,
|
||||||
libghc-quickcheck2-dev,
|
libghc-quickcheck2-dev,
|
||||||
libghc-monad-control-dev (>= 0.3),
|
libghc-monad-control-dev (>= 0.3),
|
||||||
|
|
|
@ -73,7 +73,7 @@ Executable git-annex
|
||||||
CPP-Options: -DWITH_S3
|
CPP-Options: -DWITH_S3
|
||||||
|
|
||||||
if flag(WebDAV)
|
if flag(WebDAV)
|
||||||
Build-Depends: DAV (>= 0.2), http-conduit, xml-conduit
|
Build-Depends: DAV (>= 0.3), http-conduit, xml-conduit
|
||||||
CPP-Options: -DWITH_WEBDAV
|
CPP-Options: -DWITH_WEBDAV
|
||||||
|
|
||||||
if flag(Assistant) && ! os(windows) && ! os(solaris)
|
if flag(Assistant) && ! os(windows) && ! os(solaris)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue