<pre style='margin:0'>
Rainer Müller (raimue) pushed a commit to branch vcs-fetch
in repository macports-base.
</pre>
<p><a href="https://github.com/macports/macports-base/commit/c8ec2dcedc88cde0bff24fa42efd0cdda9582aac">https://github.com/macports/macports-base/commit/c8ec2dcedc88cde0bff24fa42efd0cdda9582aac</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit c8ec2dcedc88cde0bff24fa42efd0cdda9582aac
</span>Author: Rainer Müller <raimue@macports.org>
AuthorDate: Sun Apr 15 19:09:58 2018 +0200
<span style='display:block; white-space:pre;color:#404040;'> fetch: Respect fetch.ignore_sslcert in VCS fetch
</span>---
src/port1.0/portfetch.tcl | 31 +++++++++++++++++++++++--------
1 file changed, 23 insertions(+), 8 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/port1.0/portfetch.tcl b/src/port1.0/portfetch.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index f1ab690..c3cefaf 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/port1.0/portfetch.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/port1.0/portfetch.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -392,6 +392,7 @@ proc portfetch::bzrfetch {args} {
</span> global UI_PREFIX \
env distpath workpath worksrcpath \
bzr.url bzr.revision bzr.file bzr.file_prefix \
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ fetch.ignore_sslcert \
</span> name distname fetch.type
set generatedfile "${distpath}/${bzr.file}"
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -421,11 +422,16 @@ proc portfetch::bzrfetch {args} {
</span> set env(HTTPS_PROXY) http://${orig_https_proxy}/
}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ set connectargs ""
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {${fetch.ignore_sslcert}} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ append connectargs " -Ossl.cert_reqs=none"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> try -pass_signal {
ui_info "$UI_PREFIX Checking out ${fetch.type} repository"
set exportpath [file join ${workpath} export]
file mkdir ${exportpath}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set cmdstring "${bzr.cmd} --builtin --no-aliases checkout --lightweight --verbose -r ${bzr.revision} ${bzr.url} ${exportpath}/${bzr.file_prefix}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set cmdstring "${bzr.cmd} --builtin --no-aliases ${connectargs} checkout --lightweight --verbose -r ${bzr.revision} ${bzr.url} ${exportpath}/${bzr.file_prefix}"
</span> if {[catch {system $cmdstring} result]} {
error [msgcat::mc "Bazaar checkout failed"]
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -439,7 +445,7 @@ proc portfetch::bzrfetch {args} {
</span> ui_info "$UI_PREFIX Generating tarball ${bzr.file}"
# get timestamp of latest revision
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set cmdstring "${bzr.cmd} --builtin --no-aliases version-info --format=custom --template=\"{date}\" ${exportpath}/${bzr.file_prefix}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set cmdstring "${bzr.cmd} --builtin --no-aliases ${connectargs} version-info --format=custom --template=\"{date}\" ${exportpath}/${bzr.file_prefix}"
</span> if {[catch {system -o out -e err $cmdstring} result]} {
ui_error $err
error [msgcat::mc "Bazaar version-info failed: $result"]
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -594,7 +600,7 @@ proc portfetch::svnfetch {args} {
</span> global UI_PREFIX \
distpath workpath worksrcpath \
svn.url svn.revision svn.subdirs svn.ignore_keywords svn.file svn.file_prefix \
<span style='display:block; white-space:pre;background:#ffe0e0;'>- fetch.user fetch.password \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ fetch.user fetch.password fetch.ignore_sslcert \
</span> name distname fetch.type
set generatedfile "${distpath}/${svn.file}"
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -630,6 +636,9 @@ proc portfetch::svnfetch {args} {
</span> if {${fetch.password} ne ""} {
append connectargs " --password ${fetch.password}"
}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {${fetch.ignore_sslcert}} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ append connectargs " --trust-server-cert"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span>
ui_info "$UI_PREFIX Checking out ${fetch.type} repository"
set exportpath [file join ${workpath} export]
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -777,6 +786,7 @@ proc portfetch::gitfetch {args} {
</span> global UI_PREFIX portverbose \
distpath workpath worksrcpath prefix \
git.url git.branch git.fetch_submodules git.file git.file_prefix \
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ fetch.ignore_sslcert \
</span> name distname fetch.type
set generatedfile "${distpath}/${git.file}"
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -787,6 +797,11 @@ proc portfetch::gitfetch {args} {
</span>
set git.cmd ${prefix}/bin/git
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ set connectargs ""
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {${fetch.ignore_sslcert}} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ append connectargs " -c http.sslVerify=false"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> set options ""
if {$portverbose} {
set options "--progress"
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -803,7 +818,7 @@ proc portfetch::gitfetch {args} {
</span>
ui_info "$UI_PREFIX Cloning ${fetch.type} repository"
set exportpath [file join ${workpath} export]
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set cmdstring "${git.cmd} clone $options ${git.url} ${exportpath}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set cmdstring "${git.cmd} ${connectargs} clone $options ${git.url} ${exportpath}"
</span> if {[catch {system $cmdstring} result]} {
return -code error [msgcat::mc "Git clone failed"]
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -821,7 +836,7 @@ proc portfetch::gitfetch {args} {
</span> # fetch all submodules
if {[file isfile "$exportpath/.gitmodules"] && [tbool git.fetch_submodules]} {
ui_info "$UI_PREFIX Cloning git submodules"
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set cmdstring "${git.cmd} submodule -q update --init --recursive"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set cmdstring "${git.cmd} ${connectargs} submodule -q update --init --recursive"
</span> if {[catch {system -W $exportpath $cmdstring} result]} {
return -code error [msgcat::mc "Git submodule init failed"]
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -889,13 +904,13 @@ proc portfetch::hgfetch {args} {
</span>
ui_info "$UI_PREFIX Checking out ${fetch.type} repository"
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set insecureflag ""
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set connectargs ""
</span> if {${fetch.ignore_sslcert}} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set insecureflag " --insecure"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ append connectargs " --insecure"
</span> }
set exportpath [file join ${workpath} export]
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set cmdstring "${hg.cmd} clone${insecureflag} --rev \"${hg.tag}\" ${hg.url} ${exportpath}/${hg.file_prefix}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set cmdstring "${hg.cmd} clone ${connectargs} --rev \"${hg.tag}\" ${hg.url} ${exportpath}/${hg.file_prefix}"
</span> if {[catch {system $cmdstring} result]} {
return -code error [msgcat::mc "Mercurial clone failed"]
}
</pre><pre style='margin:0'>
</pre>