Permalink
Browse files

Make compatible with `network-2.4` API

The specific API change in `relativeTo` this changeset
compensates for has been introduced in

 haskell/network@4a3fdef
  • Loading branch information...
1 parent 0a98e4c commit 39c31b02aa13cff2235f43adcae628f755e7a780 @hvr hvr committed Sep 19, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 cabal-install/Distribution/Client/BuildReports/Upload.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE PatternGuards #-}
+{-# LANGUAGE CPP, PatternGuards #-}
-- This is a quick hack for uploading build reports to Hackage.
module Distribution.Client.BuildReports.Upload
@@ -51,7 +51,11 @@ postBuildReport uri buildReport = do
}
case rspCode response of
(3,0,3) | [Just buildId] <- [ do rel <- parseRelativeReference location
+#if MIN_VERSION_network(2,4,0)
+ return $ relativeTo rel uri
+#else
relativeTo rel uri
+#endif
| Header HdrLocation location <- rspHeaders response ]
-> return $ buildId
_ -> error "Unrecognised response from server."

0 comments on commit 39c31b0

Please sign in to comment.