fix build without servant

This commit is contained in:
Joey Hess 2024-07-24 15:12:16 -04:00
parent 515c42e1e3
commit ab22938c0b
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
4 changed files with 44 additions and 50 deletions

View file

@ -65,15 +65,6 @@ parseP2PHttpUrl us
case UUID.fromString p of
Nothing -> Nothing
Just _ -> return (UUID (encodeBS p))
-- The servant server uses urls that start with "/git-annex/",
-- and so the servant client adds that to the base url. So remove
-- it from the url that the user provided. However, it may not be
-- present, eg if some other server is speaking the git-annex
-- protocol. The UUID is also removed from the end of the url.
basepath u = case drop 1 $ reverse $ P.splitDirectories (uriPath u) of
("git-annex":"/":rest) -> P.joinPath (reverse rest)
rest -> P.joinPath (reverse rest)
#ifdef WITH_SERVANT
mkbaseurl s u = do
@ -87,6 +78,15 @@ parseP2PHttpUrl us
, baseUrlPath = basepath u
, baseUrlPort = port
}
-- The servant server uses urls that start with "/git-annex/",
-- and so the servant client adds that to the base url. So remove
-- it from the url that the user provided. However, it may not be
-- present, eg if some other server is speaking the git-annex
-- protocol. The UUID is also removed from the end of the url.
basepath u = case drop 1 $ reverse $ P.splitDirectories (uriPath u) of
("git-annex":"/":rest) -> P.joinPath (reverse rest)
rest -> P.joinPath (reverse rest)
#endif
p2pHttpUrlWithoutUUID :: String -> String