From owner-svn-ports-all@freebsd.org Mon Dec 10 11:26:37 2018 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9695A13220B4; Mon, 10 Dec 2018 11:26:37 +0000 (UTC) (envelope-from lev@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 30F4873E84; Mon, 10 Dec 2018 11:26:37 +0000 (UTC) (envelope-from lev@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0C4D71F427; Mon, 10 Dec 2018 11:26:37 +0000 (UTC) (envelope-from lev@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBABQa76059463; Mon, 10 Dec 2018 11:26:36 GMT (envelope-from lev@FreeBSD.org) Received: (from lev@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBABQaS4059462; Mon, 10 Dec 2018 11:26:36 GMT (envelope-from lev@FreeBSD.org) Message-Id: <201812101126.wBABQaS4059462@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lev set sender to lev@FreeBSD.org using -f From: "Lev A. Serebryakov" Date: Mon, 10 Dec 2018 11:26:36 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r487153 - in head/devel/subversion: . files X-SVN-Group: ports-head X-SVN-Commit-Author: lev X-SVN-Commit-Paths: in head/devel/subversion: . files X-SVN-Commit-Revision: 487153 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 30F4873E84 X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; NEURAL_HAM_LONG(-0.99)[-0.991,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2018 11:26:37 -0000 Author: lev Date: Mon Dec 10 11:26:36 2018 New Revision: 487153 URL: https://svnweb.freebsd.org/changeset/ports/487153 Log: Add patch to support GitHub again. It is ugly hack, not approved by upstream, and it is turned off by default. Added: head/devel/subversion/files/extra-patch-github-request-id (contents, props changed) Modified: head/devel/subversion/Makefile Modified: head/devel/subversion/Makefile ============================================================================== --- head/devel/subversion/Makefile Mon Dec 10 11:07:58 2018 (r487152) +++ head/devel/subversion/Makefile Mon Dec 10 11:26:36 2018 (r487153) @@ -1,7 +1,7 @@ # Created by: rooneg@electricjellyfish.net # $FreeBSD$ -PORTREVISION= 0 +PORTREVISION= 1 MAINTAINER= lev@FreeBSD.org COMMENT= Version control system @@ -18,7 +18,8 @@ OPTIONS_DEFINE= \ BDB \ DOCS \ FREEBSD_TEMPLATE\ - GPG_AGENT \ + GITHUB_HACK \ + GPG_AGENT \ MAINTAINER_DEBUG\ NLS \ SASL \ @@ -31,6 +32,7 @@ OPTIONS_DEFINE= \ OPTIONS_DEFAULT=FREEBSD_TEMPLATE SERF TOOLS FREEBSD_TEMPLATE_DESC= FreeBSD Project log template +GITHUB_HACK_DESC= Enable use subversion with brain-dead github server GPG_AGENT_DESC= Enable GPG agent password store MAINTAINER_DEBUG_DESC= Build debug version SERF_DESC= WebDAV/Delta-V (HTTP/HTTPS) repo access module @@ -42,6 +44,8 @@ TOOLS_DESC= Install several tools # Patches required for use with the FreeBSD Project repository only FREEBSD_TEMPLATE_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-fbsd-template SVNSERVE_WRAPPER_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-svnserve-wrapper + +GITHUB_HACK_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-github-request-id USES+= shebangfix python:2.7,env python_OLD_CMD+= "/bin/env python" Added: head/devel/subversion/files/extra-patch-github-request-id ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/subversion/files/extra-patch-github-request-id Mon Dec 10 11:26:36 2018 (r487153) @@ -0,0 +1,70 @@ +Index: subversion/libsvn_ra_serf/options.c +=================================================================== +--- subversion/libsvn_ra_serf/options.c (revision 1846667) ++++ subversion/libsvn_ra_serf/options.c (working copy) +@@ -74,6 +74,10 @@ + /* Have we received any DAV headers at all? */ + svn_boolean_t received_dav_header; + ++ /* ### FIXME: SVN-4789 ++ Have we received the bespoke GitHub request ID header? */ ++ svn_boolean_t received_github_request_id_header; ++ + const char *activity_collection; + svn_revnum_t youngest_rev; + +@@ -355,6 +359,22 @@ + } + } + ++ /* ### FIXME: SVN-4789 ++ GitHub's Subversion bridge does not set any DAV: headers in its ++ response, even though it supports bits of our HTTP protocol and ++ returns a valid response body to an OPTIONS request. We try to work ++ around that monumental brokenness by checking for this ++ GitHub-specific response header. ++ ++ Note that the case-sensitive string comparison here is intentional; ++ we do *not* want to support any number of strange hacks, so if ++ GitHub changes the case of their header name, this becomes their ++ problem entirely. */ ++ else if (strcmp(key, "X-GitHub-Request-Id") == 0) ++ { ++ opt_ctx->received_github_request_id_header = TRUE; ++ } ++ + return 0; + } + +@@ -401,8 +421,19 @@ + serf_bucket_headers_do(hdrs, capabilities_headers_iterator_callback, + opt_ctx); + +- /* Bail out early if we're not talking to a DAV server. +- Note that this check is only valid if we've received a success ++ ++ /* ### FIXME: SVN-4789 ++ Treat GitHub as a DAV server, even though it's broken. */ ++ if (opt_ctx->received_github_request_id_header ++ && !opt_ctx->received_dav_header) ++ { ++ /* FIXME: We really should emit a warning here, but apparently ++ we don't have a notification API for that. */ ++ opt_ctx->received_dav_header = TRUE; ++ } ++ ++ /* Bail out early if we're not talking to a DAV server. Note ++ that this check is only valid if we've received a success + response; redirects and errors don't count. */ + if (opt_ctx->handler->sline.code >= 200 + && opt_ctx->handler->sline.code < 300 +@@ -410,7 +441,7 @@ + { + return svn_error_createf + (SVN_ERR_RA_DAV_OPTIONS_REQ_FAILED, NULL, +- _("The server at '%s' does not support the HTTP/DAV protocol"), ++ _("The server at '%s' does not support the WebDAV protocol"), + session->session_url_str); + } + +