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.
This commit is contained in:
Joey Hess 2012-10-10 11:26:30 -04:00
parent eb85b34487
commit 8fcb84dd2f
2 changed files with 9 additions and 1 deletions

View file

@ -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

View file

@ -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