summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-10-10 11:26:30 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-10-10 11:26:30 -0400
commit1a8eb3334f70065d281c7c798c1172ee5f56c941 (patch)
tree77e06d06e66c9a52b542c2466104de7b32fe2815
parent60af69bc6e7d3c35da8455f41c1c42d2b76ec491 (diff)
deal with incompatable api change in network 2.4.0.1
On the cabal side, let's just require this new version, and set -DURI_24 to enable the code using it.
-rw-r--r--Utility/Url.hs6
-rw-r--r--git-annex.cabal4
2 files changed, 9 insertions, 1 deletions
diff --git a/Utility/Url.hs b/Utility/Url.hs
index b75229e1b..6a45c559c 100644
--- a/Utility/Url.hs
+++ b/Utility/Url.hs
@@ -5,6 +5,8 @@
- Licensed under the GNU GPL version 3 or higher.
-}
+{-# LANGUAGE CPP #-}
+
module Utility.Url (
URLString,
check,
@@ -108,6 +110,10 @@ request url headers requesttype = go 5 url
Nothing -> return rsp
Just newURI -> go n newURI_abs
where
+#ifdef URI_24
+ newURI_abs = newURI `relativeTo` u
+#else
newURI_abs = fromMaybe newURI (newURI `relativeTo` u)
+#endif
addheaders req = setHeaders req (rqHeaders req ++ userheaders)
userheaders = rights $ map parseHeader headers
diff --git a/git-annex.cabal b/git-annex.cabal
index b372c3705..9586f8230 100644
--- a/git-annex.cabal
+++ b/git-annex.cabal
@@ -46,7 +46,8 @@ Flag Pairing
Executable git-annex
Main-Is: git-annex.hs
Build-Depends: MissingH, hslogger, directory, filepath,
- unix, containers, utf8-string, network, mtl, bytestring, old-locale, time,
+ unix, containers, utf8-string, network (>= 2.4.0.1), mtl,
+ bytestring, old-locale, time,
pcre-light, extensible-exceptions, dataenc, SHA, process, json, HTTP,
base == 4.5.*, monad-control, transformers-base, lifted-base,
IfElse, text, QuickCheck >= 2.1, bloomfilter, edit-distance, process
@@ -58,6 +59,7 @@ Executable git-annex
C-Sources: Utility/libkqueue.c
Extensions: CPP
GHC-Options: -threaded
+ CPP-Options: -DURI_24
if flag(S3)
Build-Depends: hS3