<pre style='margin:0'>
Joshua Root (jmroot) pushed a commit to branch release-2.4
in repository macports-base.
</pre>
<p><a href="https://github.com/macports/macports-base/commit/aa8e2f7f2cec2993538852faeaae7588ddc6d9b0">https://github.com/macports/macports-base/commit/aa8e2f7f2cec2993538852faeaae7588ddc6d9b0</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit aa8e2f7f2cec2993538852faeaae7588ddc6d9b0
</span>Author: Joshua Root <jmr@macports.org>
AuthorDate: Tue Feb 14 23:45:19 2017 +1100
<span style='display:block; white-space:pre;color:#404040;'> Check for file size sanity in _archive_available
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> It seems that if 'curl getsize' is called with an FTP URL that points
</span><span style='display:block; white-space:pre;color:#404040;'> to a nonexistent file, it will return a size of -1 rather than throw
</span><span style='display:block; white-space:pre;color:#404040;'> an error like it does with HTTP.
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Fixes: https://trac.macports.org/ticket/53530
</span><span style='display:block; white-space:pre;color:#404040;'> (cherry picked from commit 6718cc6248373752d3172a1ed6412d883d6a96e4)
</span>---
src/port1.0/portutil.tcl | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/port1.0/portutil.tcl b/src/port1.0/portutil.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 60b0570..49b80b2 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/port1.0/portutil.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/port1.0/portutil.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -3300,7 +3300,9 @@ proc _archive_available {} {
</span> append site [option archive.subdir]
}
set url [portfetch::assemble_url $site $archivename]
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {![catch {curl getsize $url} result]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # curl getsize can return -1 instead of throwing an error for
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # nonexistent files on FTP sites.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {![catch {curl getsize $url} size] && $size > 0} {
</span> set archive_available_result 1
return 1
}
</pre><pre style='margin:0'>
</pre>