<pre style='margin:0'>
Joshua Root (jmroot) pushed a commit to branch master
in repository macports-base.
</pre>
<p><a href="https://github.com/macports/macports-base/commit/ca071954d482c752b7ebddb802ef6cf421fa5512">https://github.com/macports/macports-base/commit/ca071954d482c752b7ebddb802ef6cf421fa5512</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 ca07195 Improve version handling
</span>ca07195 is described below
<span style='display:block; white-space:pre;color:#808000;'>commit ca071954d482c752b7ebddb802ef6cf421fa5512
</span>Author: Joshua Root <jmr@macports.org>
AuthorDate: Wed May 27 10:43:03 2020 +1000
<span style='display:block; white-space:pre;color:#404040;'> Improve version handling
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Reject invalid version specifiers for all actions that operate only on
</span><span style='display:block; white-space:pre;color:#404040;'> the version currently in the ports tree. But allow a version to be
</span><span style='display:block; white-space:pre;color:#404040;'> specified iff it matches the actual current version. This should avoid
</span><span style='display:block; white-space:pre;color:#404040;'> breaking any use cases where a version is redundantly but correctly
</span><span style='display:block; white-space:pre;color:#404040;'> specified.
</span>---
src/port/port.tcl | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/port/port.tcl b/src/port/port.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 88e8002..f63e410 100755
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/port/port.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/port/port.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -4133,6 +4133,17 @@ proc action_target { action portlist opts } {
</span> set porturl $portinfo(porturl)
}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ # If version was specified, it can be a version glob for use
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # with the clean action. For other actions, error out if we're
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # being asked for a version we can't provide.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[string length $portversion]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {$action eq "clean"} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set options(ports_version_glob) $portversion
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } elseif {$portversion ne "$portinfo(version)_$portinfo(revision)"} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ break_softcontinue "$portname version $portversion is not available (current version is $portinfo(version)_$portinfo(revision))" 1 status
</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;'>+
</span> # use existing variants iff none were explicitly requested
if {[array get requested_variations] eq "" && [array get variations] ne ""} {
array unset requested_variations
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -4147,11 +4158,6 @@ proc action_target { action portlist opts } {
</span> }
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- # If version was specified, save it as a version glob for use
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # in port actions (e.g. clean).
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[string length $portversion]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set options(ports_version_glob) $portversion
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span> # if installing, mark the port as explicitly requested
if {$action eq "install"} {
if {![info exists options(ports_install_unrequested)]} {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -4765,13 +4771,6 @@ proc process_cmd { argv } {
</span> }
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {$action eq "install"} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- array set portinfo [lindex $portlist 0]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[info exists portinfo(version)] && $portinfo(version) ne "" } {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- fatal "install ignores the provided version $portinfo(version); remove it to continue."
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span> # execute the action
set action_status [$action_proc $action $portlist [array get global_options]]
</pre><pre style='margin:0'>
</pre>