[117233] trunk/base/src/port/port.tcl

cal at macports.org cal at macports.org
Wed Feb 19 15:50:54 PST 2014


Revision: 117233
          https://trac.macports.org/changeset/117233
Author:   cal at macports.org
Date:     2014-02-19 15:50:54 -0800 (Wed, 19 Feb 2014)
Log Message:
-----------
port.tcl: make term::ansi::send from tcllib an optional dependency for Leopard compatibility

Modified Paths:
--------------
    trunk/base/src/port/port.tcl

Modified: trunk/base/src/port/port.tcl
===================================================================
--- trunk/base/src/port/port.tcl	2014-02-19 23:23:13 UTC (rev 117232)
+++ trunk/base/src/port/port.tcl	2014-02-19 23:50:54 UTC (rev 117233)
@@ -34,15 +34,22 @@
 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 # POSSIBILITY OF SUCH DAMAGE.
 
-package require term::ansi::send
+# Create a namespace for some local variables
+namespace eval portclient::progress {
+    ##
+    # Indicate whether the term::ansi::send tcllib package is available and was
+    # imported. "yes", if the package is available, "no" otherwise.
+    variable hasTermAnsiSend no
+}
 
+if {![catch {package require term::ansi::send}]} {
+    set portclient::progress::hasTermAnsiSend yes
+}
+
 source [file join "@macports_tcl_dir@" macports1.0 macports_fastload.tcl]
 package require macports
 package require Pextlib 1.0
 
-# Create a namespace for some local variables
-namespace eval portclient {}
-
 # Standard procedures
 proc print_usage {{verbose 1}} {
     global cmdname
@@ -5158,7 +5165,9 @@
     exit 1
 }
 
-if {[isatty stdout] && (![info exists ui_options(ports_quiet)] || $ui_options(ports_quiet) ne "yes")} {
+if {[isatty stdout]
+    && $portclient::progress::hasTermAnsiSend eq yes
+    && (![info exists ui_options(ports_quiet)] || $ui_options(ports_quiet) ne "yes")} {
     set ui_options(progress_download) portclient::progress::download
     set ui_options(progress_generic)  portclient::progress::generic
 }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140219/72eebe84/attachment.html>


More information about the macports-changes mailing list