<pre style='margin:0'>
Clemens Lang (neverpanic) pushed a commit to branch master
in repository macports-base.
</pre>
<p><a href="https://github.com/macports/macports-base/commit/83711dc4cc749931fa35af4f3766dbdb74c24f4d">https://github.com/macports/macports-base/commit/83711dc4cc749931fa35af4f3766dbdb74c24f4d</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new 83711dc4 tests: Fix curl isnewer test broken by braeburn update
</span>83711dc4 is described below
<span style='display:block; white-space:pre;color:#808000;'>commit 83711dc4cc749931fa35af4f3766dbdb74c24f4d
</span>Author: Clemens Lang <cal@macports.org>
AuthorDate: Fri Jun 12 18:21:35 2020 +0200
<span style='display:block; white-space:pre;color:#404040;'> tests: Fix curl isnewer test broken by braeburn update
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Updating braeburn to a subversion version >= 1.10.0 broke this test,
</span><span style='display:block; white-space:pre;color:#404040;'> because the subversion backend no longer delivers the Last-Modified
</span><span style='display:block; white-space:pre;color:#404040;'> header.
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Switch to a URL under our control that does and, adjust the other tests
</span><span style='display:block; white-space:pre;color:#404040;'> as required, update the timestamps to check in the 'curl isnewer'
</span><span style='display:block; white-space:pre;color:#404040;'> testcases, and drop unused variables.
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Ideally, we wouldn't be relying on a remote server for this test and
</span><span style='display:block; white-space:pre;color:#404040;'> start a local one, but Apple doesn't ship /usr/bin/python3 on modern
</span><span style='display:block; white-space:pre;color:#404040;'> systems, we should probably not rely on /usr/bin/python being around for
</span><span style='display:block; white-space:pre;color:#404040;'> very much longer, and I'm not aware of any other quick-and-dirty
</span><span style='display:block; white-space:pre;color:#404040;'> webservers we could start for the test short of writing our own.
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Closes: https://trac.macports.org/ticket/60630
</span>---
src/pextlib1.0/tests/curl.tcl | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/pextlib1.0/tests/curl.tcl b/src/pextlib1.0/tests/curl.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index b51d0e17..def4a625 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/pextlib1.0/tests/curl.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/pextlib1.0/tests/curl.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -8,20 +8,18 @@ proc main {pextlibname} {
</span> set tempfile /tmp/macports-pextlib-testcurl
# download a dummy file over HTTP.
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set dummyroot http://svn.macports.org/repository/macports/users/eridius/curltest
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- curl fetch --ignore-ssl-cert $dummyroot/dummy $tempfile
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set dummyfile http://distfiles.macports.org/MacPorts/MacPorts-2.6.2.tar.gz.asc
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ curl fetch $dummyfile $tempfile
</span>
# check the md5 sum of the file.
<span style='display:block; white-space:pre;background:#ffe0e0;'>- test "md5sum" {[md5 file $tempfile] == "5421fb0f76c086a1e14bf33d25b292d4"}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ test "md5sum" {[md5 file $tempfile] == "41023b6070d3dda3b5d34b7e773b40fc"}
</span>
# check we indeed get a 404 a dummy file over HTTP.
<span style='display:block; white-space:pre;background:#ffe0e0;'>- test "dummy404" {[catch {curl fetch --ignore-ssl-cert $dummyroot/404 $tempfile}]}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ test "dummy404" {[catch {curl fetch $dummyfile/404 $tempfile}]}
</span>
# check the modification date of the dummy file.
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set seconds [clock scan 2007-06-16Z]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- test "mtime1" {[curl isnewer --ignore-ssl-cert $dummyroot/dummy [clock scan 2007-06-16Z]]}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set seconds [clock scan 2007-06-17Z]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- test "mtime2" {![curl isnewer --ignore-ssl-cert $dummyroot/dummy [clock scan 2007-06-17Z]]}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ test "mtime1" {[curl isnewer $dummyfile [clock scan 2019-10-20Z]]}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ test "mtime2" {![curl isnewer $dummyfile [clock scan 2019-10-21Z]]}
</span>
# use --disable-epsv
#curl fetch --disable-epsv ftp://ftp.cup.hp.com/dist/networking/benchmarks/netperf/archive/netperf-2.2pl5.tar.gz $tempfile
</pre><pre style='margin:0'>
</pre>