[93222] branches/release_2_1/base/src/macports1.0

cal at macports.org cal at macports.org
Thu May 17 17:00:32 PDT 2012


Revision: 93222
          https://trac.macports.org/changeset/93222
Author:   cal at macports.org
Date:     2012-05-17 17:00:32 -0700 (Thu, 17 May 2012)
Log Message:
-----------
Cherry-pick from trunk r93221: rev-upgrade: Only print interactive progress info when stdout is a shell, #34480

Revision Links:
--------------
    https://trac.macports.org/changeset/93221

Modified Paths:
--------------
    branches/release_2_1/base/src/macports1.0/macports.tcl

Property Changed:
----------------
    branches/release_2_1/base/src/macports1.0/


Property changes on: branches/release_2_1/base/src/macports1.0
___________________________________________________________________
Added: svn:mergeinfo
   + /branches/gsoc08-privileges/base/src/macports1.0:37343-46937
/branches/gsoc09-logging/base/src/macports1.0:51231-60371
/branches/gsoc11-rev-upgrade/base/src/macports1.0:78828-88375
/branches/universal-sanity/base/src/macports1.0:51872-52323
/branches/variant-descs-14482/base/src/macports1.0:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
/trunk/base/src/macports1.0:91825,91829,91834,92072,92342,92404,92546,92730,92785,92881,92903,93062,93129,93153,93197,93221
/users/perry/base-bugs_and_notes/src/macports1.0:45682-46060
/users/perry/base-select/src/macports1.0:44044-44692

Modified: branches/release_2_1/base/src/macports1.0/macports.tcl
===================================================================
--- branches/release_2_1/base/src/macports1.0/macports.tcl	2012-05-17 23:57:46 UTC (rev 93221)
+++ branches/release_2_1/base/src/macports1.0/macports.tcl	2012-05-18 00:00:32 UTC (rev 93222)
@@ -4103,13 +4103,14 @@
 
     set files [registry::file search active 1 binary -null]
     set files_count [llength $files]
+    set fancy_output [expr ![macports::ui_isset ports_debug] && [isatty stdout]]
     if {$files_count > 0} {
         registry::write {
             try {
                 ui_msg -nonewline "$macports::ui_prefix Updating database of binaries"
                 set i 1
                 foreach f $files {
-                    if {![macports::ui_isset ports_debug]} {
+                    if {$fancy_output} {
                         if {$files_count < 10000 || $i % 10 == 1 || $i == $files_count} {
                             ui_msg -nonewline "\r$macports::ui_prefix Updating database of binaries: [expr ($i * 1000 / $files_count) / 10.0]%"
                             flush stdout
@@ -4121,7 +4122,7 @@
 
                     if {0 != [catch {$f binary [fileIsBinary $fpath]} fileIsBinaryError]} {
                         # handle errors (e.g. file not found, permission denied) gracefully
-                        if {![macports::ui_isset ports_debug]} {
+                        if {$fancy_output} {
                             ui_msg ""
                         }
                         ui_warn "Error determining file type of `$fpath': $fileIsBinaryError"
@@ -4150,7 +4151,7 @@
 
         set i 1
         foreach b $binaries {
-            if {![macports::ui_isset ports_debug]} {
+            if {$fancy_output} {
                 if {$binary_count < 10000 || $i % 10 == 1 || $i == $binary_count} {
                     ui_msg -nonewline "\r$macports::ui_prefix Scanning binaries for linking errors: [expr ($i * 1000 / $binary_count) / 10.0]%"
                     flush stdout
@@ -4170,7 +4171,7 @@
                     # ignore silently, these are only static libs anyway
                     #ui_debug "Error parsing file ${bpath}: [machista::strerror $returncode]"
                 } else {
-                    if {![macports::ui_isset ports_debug]} {
+                    if {$fancy_output} {
                         ui_msg ""
                     }
                     ui_warn "Error parsing file ${bpath}: [machista::strerror $returncode]"
@@ -4192,7 +4193,7 @@
                                 } else {
                                     set portname "<unknown-port>"
                                 }
-                                if {![macports::ui_isset ports_debug]} {
+                                if {$fancy_output} {
                                     ui_msg ""
                                 }
                                 ui_warn "ID load command in ${bpath}, arch [machista::get_arch_name [$architecture cget -mat_arch]] (belonging to port $portname) contains relative path"
@@ -4203,7 +4204,7 @@
                                 } else {
                                     set portname "<unknown-port>"
                                 }
-                                if {![macports::ui_isset ports_debug]} {
+                                if {$fancy_output} {
                                     ui_msg ""
                                 }
                                 ui_warn "ID load command in ${bpath}, arch [machista::get_arch_name [$architecture cget -mat_arch]] refers to non-existant file $idloadcmdpath"
@@ -4220,7 +4221,7 @@
                                     } else {
                                         set portname "<unknown-port>"
                                     }
-                                    if {![macports::ui_isset ports_debug]} {
+                                    if {$fancy_output} {
                                         ui_msg ""
                                     }
                                     ui_warn "ID load command in ${bpath}, arch [machista::get_arch_name [$architecture cget -mat_arch]] refers to file $idloadcmdpath, which is a different file"
@@ -4348,7 +4349,7 @@
             incr broken_port_counts($portname)
             if {$broken_port_counts($portname) > 3} {
                 ui_error "Port $portname is still broken after rebuiling it more than 3 times."
-                if {![macports::ui_isset ports_debug]} {
+                if {$fancy_output} {
                     ui_error "Please run port -d -y rev-upgrade and use the output to report a bug."
                 }
                 error "Port $portname still broken after rebuilding [expr $broken_port_counts($portname) - 1] time(s)"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120517/b9ba5de9/attachment-0001.html>


More information about the macports-changes mailing list