[146730] trunk/base/src
ijackson at macports.org
ijackson at macports.org
Wed Mar 16 03:04:57 PDT 2016
Revision: 146730
https://trac.macports.org/changeset/146730
Author: ijackson at macports.org
Date: 2016-03-16 03:04:56 -0700 (Wed, 16 Mar 2016)
Log Message:
-----------
ui_ask_singlechoice returns 0-based index instead of 1-based
Update proc _check_registry{} in portimage.tcl to return the
new 0-based index instead of using the old 1-based index.
Modified Paths:
--------------
trunk/base/src/port/port.tcl
trunk/base/src/registry2.0/portimage.tcl
Modified: trunk/base/src/port/port.tcl
===================================================================
--- trunk/base/src/port/port.tcl 2016-03-16 09:58:02 UTC (rev 146729)
+++ trunk/base/src/port/port.tcl 2016-03-16 10:04:56 UTC (rev 146730)
@@ -5446,7 +5446,7 @@
}
signal -restart error {TERM INT}
if {($input <= [llength $ports] && [string is integer -strict $input])} {
- return $input
+ return [expr {$input - 1}]
} else {
puts "Please enter an index from the above list."
}
Modified: trunk/base/src/registry2.0/portimage.tcl
===================================================================
--- trunk/base/src/registry2.0/portimage.tcl 2016-03-16 09:58:02 UTC (rev 146729)
+++ trunk/base/src/registry2.0/portimage.tcl 2016-03-16 10:04:56 UTC (rev 146730)
@@ -252,8 +252,7 @@
}
if {[info exists macports::ui_options(questions_singlechoice)]} {
set retvalue [$macports::ui_options(questions_singlechoice) $msg "Choice_Q1" $portilist]
- set index [expr { $retvalue - 1 }]
- return [lindex $ilist $index]
+ return [lindex $ilist $retvalue]
}
throw registry::invalid "Registry error: Please specify the full version as recorded in the port registry."
} elseif { [llength $ilist] == 1 } {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20160316/7e525d29/attachment.html>
More information about the macports-changes
mailing list