Revision: 139022 https://trac.macports.org/changeset/139022 Author: ijackson@macports.org Date: 2015-07-29 05:59:23 -0700 (Wed, 29 Jul 2015) Log Message: ----------- Check if $result exists or not. If all the ports are installed, there will be nothing to be installed and $result will not be set. Add a check [info exists result] and if not found return {} instead of return $result which was giving "variable not found" error when nothing is to be installed. Modified Paths: -------------- branches/gsoc15-dependency/base/src/macports1.0/macports.tcl Modified: branches/gsoc15-dependency/base/src/macports1.0/macports.tcl =================================================================== --- branches/gsoc15-dependency/base/src/macports1.0/macports.tcl 2015-07-29 11:43:04 UTC (rev 139021) +++ branches/gsoc15-dependency/base/src/macports1.0/macports.tcl 2015-07-29 12:59:23 UTC (rev 139022) @@ -2023,16 +2023,22 @@ if {[macports::_target_needs_deps $target]} { set dep_res [macports::libsolv::dep_calc $portlist] ## Install each port. First use mportopen and then _mportexec. - foreach port $dep_res { - set portname [lindex $port 0] - set porturl [lindex $port 1] - ui_debug "Installing $portname" - set options(subport) $portname - ui_debug "mportopen $porturl [list subport $portname]" - set mport [mportopen $porturl [list subport $portname]] - set result [_mportexec activate $mport] + if {[info exists dep_res]} { + foreach port $dep_res { + set portname [lindex $port 0] + set porturl [lindex $port 1] + ui_debug "Installing $portname" + set options(subport) $portname + ui_debug "mportopen $porturl [list subport $portname]" + set mport [mportopen $porturl [list subport $portname]] + set result [_mportexec activate $mport] + } + if {[info exists result]} { + return $result + } else { + return {} + } } - return $result } }