[arch-commits] Commit in git-annex/repos (6 files)

Felix Yan felixonmars at archlinux.org
Sat Dec 10 15:49:23 UTC 2016


    Date: Saturday, December 10, 2016 @ 15:49:23
  Author: felixonmars
Revision: 198758

archrelease: copy trunk to community-i686, community-x86_64

Added:
  git-annex/repos/community-i686/PKGBUILD
    (from rev 198757, git-annex/trunk/PKGBUILD)
  git-annex/repos/community-i686/http-conduit-2.2.patch
    (from rev 198757, git-annex/trunk/http-conduit-2.2.patch)
  git-annex/repos/community-x86_64/PKGBUILD
    (from rev 198757, git-annex/trunk/PKGBUILD)
  git-annex/repos/community-x86_64/http-conduit-2.2.patch
    (from rev 198757, git-annex/trunk/http-conduit-2.2.patch)
Deleted:
  git-annex/repos/community-i686/PKGBUILD
  git-annex/repos/community-x86_64/PKGBUILD

-----------------------------------------+
 /PKGBUILD                               |  122 ++++++++++++++++++++++++++++
 community-i686/PKGBUILD                 |   55 ------------
 community-i686/http-conduit-2.2.patch   |  129 ++++++++++++++++++++++++++++++
 community-x86_64/PKGBUILD               |   55 ------------
 community-x86_64/http-conduit-2.2.patch |  129 ++++++++++++++++++++++++++++++
 5 files changed, 380 insertions(+), 110 deletions(-)

Deleted: community-i686/PKGBUILD
===================================================================
--- community-i686/PKGBUILD	2016-12-10 15:48:55 UTC (rev 198757)
+++ community-i686/PKGBUILD	2016-12-10 15:49:23 UTC (rev 198758)
@@ -1,55 +0,0 @@
-# $Id$
-# Maintainer: Felix Yan <felixonmars at archlinux.org>
-# Contributor: Arch Haskell Team <arch-haskell at haskell.org>
-
-pkgname=git-annex
-pkgver=6.20160613
-pkgrel=8
-pkgdesc="Manage files with git, without checking their contents into git"
-url="http://git-annex.branchable.com/"
-license=("AGPL3")
-arch=('i686' 'x86_64')
-depends=('git' 'rsync' 'libxml2' 'gsasl' 'file')
-makedepends=("ghc=8.0.1" "git" "haskell-aeson" "haskell-async" "haskell-aws"
-             "haskell-blaze-builder" "haskell-bloomfilter" "haskell-byteable"
-             "haskell-case-insensitive" "haskell-clientsession" "haskell-concurrent-output"
-             "haskell-conduit" "haskell-conduit-extra" "haskell-crypto-api" "haskell-cryptonite"
-             "haskell-data-default" "haskell-dav" "haskell-dbus" "haskell-disk-free-space"
-             "haskell-dlist" "haskell-dns" "haskell-edit-distance" "haskell-esqueleto"
-             "haskell-exceptions" "haskell-fdo-notify" "haskell-feed" "haskell-gnutls"
-             "haskell-hinotify" "haskell-hslogger" "haskell-http-client" "haskell-http-conduit"
-             "haskell-http-types" "haskell-ifelse" "haskell-json" "haskell-magic"
-             "haskell-missingh" "haskell-monad-control" "haskell-monad-logger"
-             "haskell-mountpoints" "haskell-mtl" "haskell-network" "haskell-network-info"
-             "haskell-network-multicast" "haskell-network-protocol-xmpp" "haskell-network-uri"
-             "haskell-old-locale" "haskell-optparse-applicative" "haskell-path-pieces"
-             "haskell-persistent" "haskell-persistent-sqlite" "haskell-persistent-template"
-             "haskell-quickcheck" "haskell-random" "haskell-regex-tdfa" "haskell-resourcet"
-             "haskell-safesemaphore" "haskell-sandi" "haskell-securemem" "haskell-shakespeare"
-             "haskell-stm" "haskell-tasty" "haskell-tasty-hunit" "haskell-tasty-quickcheck"
-             "haskell-tasty-rerun" "haskell-text" "haskell-torrent" "haskell-unix-compat"
-             "haskell-utf8-string" "haskell-uuid" "haskell-wai" "haskell-wai-extra" "haskell-warp"
-             "haskell-warp-tls" "haskell-xml-types" "haskell-yesod" "haskell-yesod-core"
-             "haskell-yesod-default" "haskell-yesod-form" "haskell-yesod-static")
-source=("git+https://github.com/joeyh/git-annex.git#tag=$pkgver")
-sha256sums=('SKIP')
-
-build() {
-    cd "${srcdir}/${pkgname}"
-    
-    runhaskell Setup configure -O --prefix=/usr --docdir="/usr/share/doc/${pkgname}" \
-        -fcryptonite -fnetwork-uri -f-ekg -fconcurrentoutput -ftorrentparser \
-        -ftestsuite -f-androidsplice -f-android -fproduction -fpairing -fwebapp \
-        -fassistant -fwebdav -fs3 -f-benchmark -fdbus -fxmpp -fmagicmime
-    runhaskell Setup build
-}
-
-package() {
-    cd "${srcdir}/${pkgname}"
-    runhaskell Setup copy --destdir="${pkgdir}"
-
-    install -Dm644 bash-completion.bash "${pkgdir}/usr/share/bash-completion/completions/git-annex"
-
-    rm "$pkgdir/usr/share/doc/git-annex/COPYRIGHT"
-    rmdir "$pkgdir/usr/share/doc/git-annex" "$pkgdir/usr/share/doc"
-}

Copied: git-annex/repos/community-i686/PKGBUILD (from rev 198757, git-annex/trunk/PKGBUILD)
===================================================================
--- community-i686/PKGBUILD	                        (rev 0)
+++ community-i686/PKGBUILD	2016-12-10 15:49:23 UTC (rev 198758)
@@ -0,0 +1,61 @@
+# $Id$
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+# Contributor: Arch Haskell Team <arch-haskell at haskell.org>
+
+pkgname=git-annex
+pkgver=6.20161118
+pkgrel=1
+pkgdesc="Manage files with git, without checking their contents into git"
+url="http://git-annex.branchable.com/"
+license=("AGPL3")
+arch=('i686' 'x86_64')
+depends=('git' 'rsync' 'libxml2' 'gsasl' 'file')
+makedepends=("ghc=8.0.1" "git" "haskell-aeson" "haskell-async" "haskell-aws" "haskell-blaze-builder"
+             "haskell-bloomfilter" "haskell-byteable" "haskell-case-insensitive"
+             "haskell-clientsession" "haskell-concurrent-output" "haskell-conduit"
+             "haskell-crypto-api" "haskell-cryptonite" "haskell-data-default" "haskell-dav"
+             "haskell-dbus" "haskell-disk-free-space" "haskell-dlist" "haskell-dns"
+             "haskell-edit-distance" "haskell-esqueleto" "haskell-exceptions" "haskell-fdo-notify"
+             "haskell-feed" "haskell-gnutls" "haskell-hinotify" "haskell-hslogger"
+             "haskell-http-client" "haskell-http-conduit" "haskell-http-types" "haskell-ifelse"
+             "haskell-magic" "haskell-missingh" "haskell-monad-control" "haskell-monad-logger"
+             "haskell-mountpoints" "haskell-mtl" "haskell-network" "haskell-network-info"
+             "haskell-network-multicast" "haskell-network-protocol-xmpp" "haskell-network-uri"
+             "haskell-old-locale" "haskell-optparse-applicative" "haskell-path-pieces"
+             "haskell-persistent" "haskell-persistent-sqlite" "haskell-persistent-template"
+             "haskell-quickcheck" "haskell-random" "haskell-regex-tdfa" "haskell-resourcet"
+             "haskell-safesemaphore" "haskell-sandi" "haskell-securemem" "haskell-shakespeare"
+             "haskell-stm" "haskell-tasty" "haskell-tasty-hunit" "haskell-tasty-quickcheck"
+             "haskell-tasty-rerun" "haskell-text" "haskell-torrent" "haskell-unix-compat"
+             "haskell-unordered-containers" "haskell-utf8-string" "haskell-uuid" "haskell-wai"
+             "haskell-wai-extra" "haskell-warp" "haskell-warp-tls" "haskell-xml-types"
+             "haskell-yesod" "haskell-yesod-core" "haskell-yesod-default" "haskell-yesod-form"
+             "haskell-yesod-static")
+source=("git+https://github.com/joeyh/git-annex.git#tag=$pkgver"
+        http-conduit-2.2.patch)
+sha256sums=('SKIP'
+            '6b9e3cd4b3e5f37a3432c85454e705a91c287c5ccd1d27cf3730cfecdc3353be')
+
+prepare() {
+  cd git-annex
+  patch -p1 -i ../http-conduit-2.2.patch
+}
+
+build() {
+  cd git-annex
+  
+  runhaskell Setup configure -O --prefix=/usr --docdir="/usr/share/doc/$pkgname" \
+    -fcryptonite -fnetwork-uri -fconcurrentoutput -ftorrentparser \
+    -ftestsuite -f-androidsplice -f-android -fproduction -fpairing -fwebapp \
+    -fassistant -fwebdav -fs3 -f-benchmark -fdbus -fxmpp -fmagicmime
+  runhaskell Setup build
+}
+
+package() {
+  cd git-annex
+  runhaskell Setup copy --destdir="$pkgdir"
+  make DESTDIR="$pkgdir" install-misc
+
+  rm "$pkgdir"/usr/share/doc/git-annex/COPYRIGHT
+  rmdir "$pkgdir"/usr/share/doc/git-annex "$pkgdir"/usr/share/doc
+}

Copied: git-annex/repos/community-i686/http-conduit-2.2.patch (from rev 198757, git-annex/trunk/http-conduit-2.2.patch)
===================================================================
--- community-i686/http-conduit-2.2.patch	                        (rev 0)
+++ community-i686/http-conduit-2.2.patch	2016-12-10 15:49:23 UTC (rev 198758)
@@ -0,0 +1,129 @@
+From 93a22a1c972d58b17bc0e23a4b5c9768310f943c Mon Sep 17 00:00:00 2001
+From: Alper Nebi Yasak <alpernebiyasak at gmail.com>
+Date: Sat, 10 Dec 2016 15:24:27 +0300
+Subject: [PATCH] Remove http-conduit (<2.2.0) constraint
+
+Since https://github.com/aristidb/aws/issues/206 is resolved, this
+constraint is no longer necessary. However, http-conduit (>=2.2.0)
+requires http-client (>=0.5.0) which introduces some breaking changes.
+This commit also implements those changes depending on the version.
+Fixes: https://git-annex.branchable.com/bugs/Build_with_aws_head_fails/
+
+Signed-off-by: Alper Nebi Yasak <alpernebiyasak at gmail.com>
+---
+ Remote/S3.hs     |  8 +++++++-
+ Remote/WebDAV.hs | 17 +++++++++++++++++
+ Utility/Url.hs   |  8 ++++++++
+ git-annex.cabal  |  3 +--
+ 4 files changed, 33 insertions(+), 3 deletions(-)
+
+diff --git a/Remote/S3.hs b/Remote/S3.hs
+index 4c1bd57..9563b5a 100644
+--- a/Remote/S3.hs
++++ b/Remote/S3.hs
+@@ -49,6 +49,12 @@ import Annex.Content
+ import Annex.Url (withUrlOptions)
+ import Utility.Url (checkBoth, managerSettings, closeManager)
+ 
++#if MIN_VERSION_http_client(0,5,0)
++import Network.HTTP.Client (responseTimeoutNone)
++#else
++responseTimeoutNone = Nothing
++#endif
++
+ type BucketName = String
+ 
+ remote :: RemoteType
+@@ -430,7 +436,7 @@ withS3HandleMaybe c gc u a = do
+   where
+ 	s3cfg = s3Configuration c
+ 	httpcfg = managerSettings
+-		{ managerResponseTimeout = Nothing }
++		{ managerResponseTimeout = responseTimeoutNone }
+ 
+ s3Configuration :: RemoteConfig -> S3.S3Configuration AWS.NormalQuery
+ s3Configuration c = cfg
+diff --git a/Remote/WebDAV.hs b/Remote/WebDAV.hs
+index 19dbaa8..14947f1 100644
+--- a/Remote/WebDAV.hs
++++ b/Remote/WebDAV.hs
+@@ -5,6 +5,7 @@
+  - Licensed under the GNU GPL version 3 or higher.
+  -}
+ 
++{-# LANGUAGE CPP #-}
+ {-# LANGUAGE ScopedTypeVariables #-}
+ 
+ module Remote.WebDAV (remote, davCreds, configUrl) where
+@@ -34,6 +35,10 @@ import Utility.Url (URLString, matchStatusCodeException)
+ import Annex.UUID
+ import Remote.WebDAV.DavLocation
+ 
++#if MIN_VERSION_http_client(0,5,0)
++import Network.HTTP.Client (HttpExceptionContent(..), responseStatus)
++#endif
++
+ remote :: RemoteType
+ remote = RemoteType {
+ 	typename = "webdav",
+@@ -302,6 +307,17 @@ goDAV (DavHandle ctx user pass _) a = choke $ run $ prettifyExceptions $ do
+ {- Catch StatusCodeException and trim it to only the statusMessage part,
+  - eliminating a lot of noise, which can include the whole request that
+  - failed. The rethrown exception is no longer a StatusCodeException. -}
++#if MIN_VERSION_http_client(0,5,0)
++prettifyExceptions :: DAVT IO a -> DAVT IO a
++prettifyExceptions a = catchJust (matchStatusCodeException (const True)) a go
++  where
++	go (HttpExceptionRequest _ (StatusCodeException response message)) = error $ unwords
++		[ "DAV failure:"
++		, show (responseStatus response)
++		, show (message)
++		]
++	go e = throwM e
++#else
+ prettifyExceptions :: DAVT IO a -> DAVT IO a
+ prettifyExceptions a = catchJust (matchStatusCodeException (const True)) a go
+   where
+@@ -311,6 +327,7 @@ prettifyExceptions a = catchJust (matchStatusCodeException (const True)) a go
+ 		, show (statusMessage status)
+ 		]
+ 	go e = throwM e
++#endif
+ 
+ prepDAV :: DavUser -> DavPass -> DAVT IO ()
+ prepDAV user pass = do
+diff --git a/Utility/Url.hs b/Utility/Url.hs
+index 9b68871..d0e1b37 100644
+--- a/Utility/Url.hs
++++ b/Utility/Url.hs
+@@ -350,8 +350,16 @@ hUserAgent = "User-Agent"
+  -
+  - > catchJust (matchStatusCodeException (== notFound404))
+  -}
++#if MIN_VERSION_http_client(0,5,0)
++matchStatusCodeException :: (Status -> Bool) -> HttpException -> Maybe HttpException
++matchStatusCodeException want e@(HttpExceptionRequest _ (StatusCodeException r _))
++	| want (responseStatus r) = Just e
++	| otherwise = Nothing
++matchStatusCodeException _ _ = Nothing
++#else
+ matchStatusCodeException :: (Status -> Bool) -> HttpException -> Maybe HttpException
+ matchStatusCodeException want e@(StatusCodeException s _ _)
+ 	| want s = Just e
+ 	| otherwise = Nothing
+ matchStatusCodeException _ _ = Nothing
++#endif
+diff --git a/git-annex.cabal b/git-annex.cabal
+index ec54a14..83d45a1 100644
+--- a/git-annex.cabal
++++ b/git-annex.cabal
+@@ -357,8 +357,7 @@ Executable git-annex
+    resourcet,
+    http-client,
+    http-types,
+-   -- Old version needed due to https://github.com/aristidb/aws/issues/206
+-   http-conduit (<2.2.0),
++   http-conduit,
+    time,
+    old-locale,
+    esqueleto,

Deleted: community-x86_64/PKGBUILD
===================================================================
--- community-x86_64/PKGBUILD	2016-12-10 15:48:55 UTC (rev 198757)
+++ community-x86_64/PKGBUILD	2016-12-10 15:49:23 UTC (rev 198758)
@@ -1,55 +0,0 @@
-# $Id$
-# Maintainer: Felix Yan <felixonmars at archlinux.org>
-# Contributor: Arch Haskell Team <arch-haskell at haskell.org>
-
-pkgname=git-annex
-pkgver=6.20160613
-pkgrel=8
-pkgdesc="Manage files with git, without checking their contents into git"
-url="http://git-annex.branchable.com/"
-license=("AGPL3")
-arch=('i686' 'x86_64')
-depends=('git' 'rsync' 'libxml2' 'gsasl' 'file')
-makedepends=("ghc=8.0.1" "git" "haskell-aeson" "haskell-async" "haskell-aws"
-             "haskell-blaze-builder" "haskell-bloomfilter" "haskell-byteable"
-             "haskell-case-insensitive" "haskell-clientsession" "haskell-concurrent-output"
-             "haskell-conduit" "haskell-conduit-extra" "haskell-crypto-api" "haskell-cryptonite"
-             "haskell-data-default" "haskell-dav" "haskell-dbus" "haskell-disk-free-space"
-             "haskell-dlist" "haskell-dns" "haskell-edit-distance" "haskell-esqueleto"
-             "haskell-exceptions" "haskell-fdo-notify" "haskell-feed" "haskell-gnutls"
-             "haskell-hinotify" "haskell-hslogger" "haskell-http-client" "haskell-http-conduit"
-             "haskell-http-types" "haskell-ifelse" "haskell-json" "haskell-magic"
-             "haskell-missingh" "haskell-monad-control" "haskell-monad-logger"
-             "haskell-mountpoints" "haskell-mtl" "haskell-network" "haskell-network-info"
-             "haskell-network-multicast" "haskell-network-protocol-xmpp" "haskell-network-uri"
-             "haskell-old-locale" "haskell-optparse-applicative" "haskell-path-pieces"
-             "haskell-persistent" "haskell-persistent-sqlite" "haskell-persistent-template"
-             "haskell-quickcheck" "haskell-random" "haskell-regex-tdfa" "haskell-resourcet"
-             "haskell-safesemaphore" "haskell-sandi" "haskell-securemem" "haskell-shakespeare"
-             "haskell-stm" "haskell-tasty" "haskell-tasty-hunit" "haskell-tasty-quickcheck"
-             "haskell-tasty-rerun" "haskell-text" "haskell-torrent" "haskell-unix-compat"
-             "haskell-utf8-string" "haskell-uuid" "haskell-wai" "haskell-wai-extra" "haskell-warp"
-             "haskell-warp-tls" "haskell-xml-types" "haskell-yesod" "haskell-yesod-core"
-             "haskell-yesod-default" "haskell-yesod-form" "haskell-yesod-static")
-source=("git+https://github.com/joeyh/git-annex.git#tag=$pkgver")
-sha256sums=('SKIP')
-
-build() {
-    cd "${srcdir}/${pkgname}"
-    
-    runhaskell Setup configure -O --prefix=/usr --docdir="/usr/share/doc/${pkgname}" \
-        -fcryptonite -fnetwork-uri -f-ekg -fconcurrentoutput -ftorrentparser \
-        -ftestsuite -f-androidsplice -f-android -fproduction -fpairing -fwebapp \
-        -fassistant -fwebdav -fs3 -f-benchmark -fdbus -fxmpp -fmagicmime
-    runhaskell Setup build
-}
-
-package() {
-    cd "${srcdir}/${pkgname}"
-    runhaskell Setup copy --destdir="${pkgdir}"
-
-    install -Dm644 bash-completion.bash "${pkgdir}/usr/share/bash-completion/completions/git-annex"
-
-    rm "$pkgdir/usr/share/doc/git-annex/COPYRIGHT"
-    rmdir "$pkgdir/usr/share/doc/git-annex" "$pkgdir/usr/share/doc"
-}

Copied: git-annex/repos/community-x86_64/PKGBUILD (from rev 198757, git-annex/trunk/PKGBUILD)
===================================================================
--- community-x86_64/PKGBUILD	                        (rev 0)
+++ community-x86_64/PKGBUILD	2016-12-10 15:49:23 UTC (rev 198758)
@@ -0,0 +1,61 @@
+# $Id$
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+# Contributor: Arch Haskell Team <arch-haskell at haskell.org>
+
+pkgname=git-annex
+pkgver=6.20161118
+pkgrel=1
+pkgdesc="Manage files with git, without checking their contents into git"
+url="http://git-annex.branchable.com/"
+license=("AGPL3")
+arch=('i686' 'x86_64')
+depends=('git' 'rsync' 'libxml2' 'gsasl' 'file')
+makedepends=("ghc=8.0.1" "git" "haskell-aeson" "haskell-async" "haskell-aws" "haskell-blaze-builder"
+             "haskell-bloomfilter" "haskell-byteable" "haskell-case-insensitive"
+             "haskell-clientsession" "haskell-concurrent-output" "haskell-conduit"
+             "haskell-crypto-api" "haskell-cryptonite" "haskell-data-default" "haskell-dav"
+             "haskell-dbus" "haskell-disk-free-space" "haskell-dlist" "haskell-dns"
+             "haskell-edit-distance" "haskell-esqueleto" "haskell-exceptions" "haskell-fdo-notify"
+             "haskell-feed" "haskell-gnutls" "haskell-hinotify" "haskell-hslogger"
+             "haskell-http-client" "haskell-http-conduit" "haskell-http-types" "haskell-ifelse"
+             "haskell-magic" "haskell-missingh" "haskell-monad-control" "haskell-monad-logger"
+             "haskell-mountpoints" "haskell-mtl" "haskell-network" "haskell-network-info"
+             "haskell-network-multicast" "haskell-network-protocol-xmpp" "haskell-network-uri"
+             "haskell-old-locale" "haskell-optparse-applicative" "haskell-path-pieces"
+             "haskell-persistent" "haskell-persistent-sqlite" "haskell-persistent-template"
+             "haskell-quickcheck" "haskell-random" "haskell-regex-tdfa" "haskell-resourcet"
+             "haskell-safesemaphore" "haskell-sandi" "haskell-securemem" "haskell-shakespeare"
+             "haskell-stm" "haskell-tasty" "haskell-tasty-hunit" "haskell-tasty-quickcheck"
+             "haskell-tasty-rerun" "haskell-text" "haskell-torrent" "haskell-unix-compat"
+             "haskell-unordered-containers" "haskell-utf8-string" "haskell-uuid" "haskell-wai"
+             "haskell-wai-extra" "haskell-warp" "haskell-warp-tls" "haskell-xml-types"
+             "haskell-yesod" "haskell-yesod-core" "haskell-yesod-default" "haskell-yesod-form"
+             "haskell-yesod-static")
+source=("git+https://github.com/joeyh/git-annex.git#tag=$pkgver"
+        http-conduit-2.2.patch)
+sha256sums=('SKIP'
+            '6b9e3cd4b3e5f37a3432c85454e705a91c287c5ccd1d27cf3730cfecdc3353be')
+
+prepare() {
+  cd git-annex
+  patch -p1 -i ../http-conduit-2.2.patch
+}
+
+build() {
+  cd git-annex
+  
+  runhaskell Setup configure -O --prefix=/usr --docdir="/usr/share/doc/$pkgname" \
+    -fcryptonite -fnetwork-uri -fconcurrentoutput -ftorrentparser \
+    -ftestsuite -f-androidsplice -f-android -fproduction -fpairing -fwebapp \
+    -fassistant -fwebdav -fs3 -f-benchmark -fdbus -fxmpp -fmagicmime
+  runhaskell Setup build
+}
+
+package() {
+  cd git-annex
+  runhaskell Setup copy --destdir="$pkgdir"
+  make DESTDIR="$pkgdir" install-misc
+
+  rm "$pkgdir"/usr/share/doc/git-annex/COPYRIGHT
+  rmdir "$pkgdir"/usr/share/doc/git-annex "$pkgdir"/usr/share/doc
+}

Copied: git-annex/repos/community-x86_64/http-conduit-2.2.patch (from rev 198757, git-annex/trunk/http-conduit-2.2.patch)
===================================================================
--- community-x86_64/http-conduit-2.2.patch	                        (rev 0)
+++ community-x86_64/http-conduit-2.2.patch	2016-12-10 15:49:23 UTC (rev 198758)
@@ -0,0 +1,129 @@
+From 93a22a1c972d58b17bc0e23a4b5c9768310f943c Mon Sep 17 00:00:00 2001
+From: Alper Nebi Yasak <alpernebiyasak at gmail.com>
+Date: Sat, 10 Dec 2016 15:24:27 +0300
+Subject: [PATCH] Remove http-conduit (<2.2.0) constraint
+
+Since https://github.com/aristidb/aws/issues/206 is resolved, this
+constraint is no longer necessary. However, http-conduit (>=2.2.0)
+requires http-client (>=0.5.0) which introduces some breaking changes.
+This commit also implements those changes depending on the version.
+Fixes: https://git-annex.branchable.com/bugs/Build_with_aws_head_fails/
+
+Signed-off-by: Alper Nebi Yasak <alpernebiyasak at gmail.com>
+---
+ Remote/S3.hs     |  8 +++++++-
+ Remote/WebDAV.hs | 17 +++++++++++++++++
+ Utility/Url.hs   |  8 ++++++++
+ git-annex.cabal  |  3 +--
+ 4 files changed, 33 insertions(+), 3 deletions(-)
+
+diff --git a/Remote/S3.hs b/Remote/S3.hs
+index 4c1bd57..9563b5a 100644
+--- a/Remote/S3.hs
++++ b/Remote/S3.hs
+@@ -49,6 +49,12 @@ import Annex.Content
+ import Annex.Url (withUrlOptions)
+ import Utility.Url (checkBoth, managerSettings, closeManager)
+ 
++#if MIN_VERSION_http_client(0,5,0)
++import Network.HTTP.Client (responseTimeoutNone)
++#else
++responseTimeoutNone = Nothing
++#endif
++
+ type BucketName = String
+ 
+ remote :: RemoteType
+@@ -430,7 +436,7 @@ withS3HandleMaybe c gc u a = do
+   where
+ 	s3cfg = s3Configuration c
+ 	httpcfg = managerSettings
+-		{ managerResponseTimeout = Nothing }
++		{ managerResponseTimeout = responseTimeoutNone }
+ 
+ s3Configuration :: RemoteConfig -> S3.S3Configuration AWS.NormalQuery
+ s3Configuration c = cfg
+diff --git a/Remote/WebDAV.hs b/Remote/WebDAV.hs
+index 19dbaa8..14947f1 100644
+--- a/Remote/WebDAV.hs
++++ b/Remote/WebDAV.hs
+@@ -5,6 +5,7 @@
+  - Licensed under the GNU GPL version 3 or higher.
+  -}
+ 
++{-# LANGUAGE CPP #-}
+ {-# LANGUAGE ScopedTypeVariables #-}
+ 
+ module Remote.WebDAV (remote, davCreds, configUrl) where
+@@ -34,6 +35,10 @@ import Utility.Url (URLString, matchStatusCodeException)
+ import Annex.UUID
+ import Remote.WebDAV.DavLocation
+ 
++#if MIN_VERSION_http_client(0,5,0)
++import Network.HTTP.Client (HttpExceptionContent(..), responseStatus)
++#endif
++
+ remote :: RemoteType
+ remote = RemoteType {
+ 	typename = "webdav",
+@@ -302,6 +307,17 @@ goDAV (DavHandle ctx user pass _) a = choke $ run $ prettifyExceptions $ do
+ {- Catch StatusCodeException and trim it to only the statusMessage part,
+  - eliminating a lot of noise, which can include the whole request that
+  - failed. The rethrown exception is no longer a StatusCodeException. -}
++#if MIN_VERSION_http_client(0,5,0)
++prettifyExceptions :: DAVT IO a -> DAVT IO a
++prettifyExceptions a = catchJust (matchStatusCodeException (const True)) a go
++  where
++	go (HttpExceptionRequest _ (StatusCodeException response message)) = error $ unwords
++		[ "DAV failure:"
++		, show (responseStatus response)
++		, show (message)
++		]
++	go e = throwM e
++#else
+ prettifyExceptions :: DAVT IO a -> DAVT IO a
+ prettifyExceptions a = catchJust (matchStatusCodeException (const True)) a go
+   where
+@@ -311,6 +327,7 @@ prettifyExceptions a = catchJust (matchStatusCodeException (const True)) a go
+ 		, show (statusMessage status)
+ 		]
+ 	go e = throwM e
++#endif
+ 
+ prepDAV :: DavUser -> DavPass -> DAVT IO ()
+ prepDAV user pass = do
+diff --git a/Utility/Url.hs b/Utility/Url.hs
+index 9b68871..d0e1b37 100644
+--- a/Utility/Url.hs
++++ b/Utility/Url.hs
+@@ -350,8 +350,16 @@ hUserAgent = "User-Agent"
+  -
+  - > catchJust (matchStatusCodeException (== notFound404))
+  -}
++#if MIN_VERSION_http_client(0,5,0)
++matchStatusCodeException :: (Status -> Bool) -> HttpException -> Maybe HttpException
++matchStatusCodeException want e@(HttpExceptionRequest _ (StatusCodeException r _))
++	| want (responseStatus r) = Just e
++	| otherwise = Nothing
++matchStatusCodeException _ _ = Nothing
++#else
+ matchStatusCodeException :: (Status -> Bool) -> HttpException -> Maybe HttpException
+ matchStatusCodeException want e@(StatusCodeException s _ _)
+ 	| want s = Just e
+ 	| otherwise = Nothing
+ matchStatusCodeException _ _ = Nothing
++#endif
+diff --git a/git-annex.cabal b/git-annex.cabal
+index ec54a14..83d45a1 100644
+--- a/git-annex.cabal
++++ b/git-annex.cabal
+@@ -357,8 +357,7 @@ Executable git-annex
+    resourcet,
+    http-client,
+    http-types,
+-   -- Old version needed due to https://github.com/aristidb/aws/issues/206
+-   http-conduit (<2.2.0),
++   http-conduit,
+    time,
+    old-locale,
+    esqueleto,



More information about the arch-commits mailing list