<pre style='margin:0'>
Joshua Root (jmroot) pushed a commit to branch master
in repository mpbb.
</pre>
<p><a href="https://github.com/macports/mpbb/commit/f3f53485aa0043d722997056b90d6f7c9726a881">https://github.com/macports/mpbb/commit/f3f53485aa0043d722997056b90d6f7c9726a881</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit f3f53485aa0043d722997056b90d6f7c9726a881
</span>Author: Joshua Root <jmr@macports.org>
AuthorDate: Mon Mar 12 00:58:22 2018 +1100
<span style='display:block; white-space:pre;color:#404040;'> Better workaround for port mirror bug
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Check that the distfiles exist instead of running the checksum target,
</span><span style='display:block; white-space:pre;color:#404040;'> which can pull in dependencies.
</span>---
tools/mirror-multi.tcl | 25 ++++++++++++++++++++-----
1 file changed, 20 insertions(+), 5 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/tools/mirror-multi.tcl b/tools/mirror-multi.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index d7ccd47..bacb9ad 100755
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/tools/mirror-multi.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/tools/mirror-multi.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -143,6 +143,22 @@ proc get_variants {portinfovar} {
</span> return $variants
}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+# work around the bug where the mirror target claims to succeed when
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# the distfile checksums did not match
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+proc check_distfiles {mport} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set distpath [_mportkey $mport distpath]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[catch {_mportkey $mport all_dist_files} all_dist_files]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # no distfiles, no problem
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach distfile $all_dist_files {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {![file exists [file join $distpath $distfile]]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> proc mirror_port {portinfo_list} {
global platforms deptypes processed
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -163,12 +179,11 @@ proc mirror_port {portinfo_list} {
</span> }
array unset portinfo
array set portinfo [mportinfo $mport]
<span style='display:block; white-space:pre;background:#ffe0e0;'>- # have to checksum too since the mirror target claims to succeed
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # even if the checksums were wrong and the files deleted
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> if {$do_mirror} {
incr attempted
mportexec $mport clean
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[mportexec $mport mirror] == 0 && [mportexec $mport checksum] == 0} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[mportexec $mport mirror] == 0 && [check_distfiles $mport] == 0} {
</span> incr succeeded
}
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -189,7 +204,7 @@ proc mirror_port {portinfo_list} {
</span> lappend deps {*}[get_dep_list portinfo]
if {$do_mirror} {
mportexec $mport clean
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[mportexec $mport mirror] == 0 && [mportexec $mport checksum] == 0} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[mportexec $mport mirror] == 0 && [check_distfiles $mport] == 0} {
</span> incr succeeded
}
} else {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -210,7 +225,7 @@ proc mirror_port {portinfo_list} {
</span> lappend deps {*}[get_dep_list portinfo]
if {$do_mirror} {
mportexec $mport clean
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[mportexec $mport mirror] == 0 && [mportexec $mport checksum] == 0} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[mportexec $mport mirror] == 0 && [check_distfiles $mport] == 0} {
</span> incr succeeded
}
} else {
</pre><pre style='margin:0'>
</pre>