[139022] branches/gsoc15-dependency/base/src/macports1.0/macports.tcl

ijackson at macports.org ijackson at macports.org
Wed Jul 29 05:59:23 PDT 2015


Revision: 139022
          https://trac.macports.org/changeset/139022
Author:   ijackson at 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
     }
 }
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20150729/11221170/attachment.html>


More information about the macports-changes mailing list