Ticket #34480: mp-base-no-progress-if-stdout-no-tty.patch
File mp-base-no-progress-if-stdout-no-tty.patch, 4.6 KB (added by neverpanic (Clemens Lang), 12 years ago) |
---|
-
src/macports1.0/macports.tcl
4136 4136 4137 4137 set files [registry::file search active 1 binary -null] 4138 4138 set files_count [llength $files] 4139 set fancy_output [expr ![macports::ui_isset ports_debug] && [isatty stdout]] 4139 4140 if {$files_count > 0} { 4140 4141 registry::write { 4141 4142 try { 4142 4143 ui_msg -nonewline "$macports::ui_prefix Updating database of binaries" 4143 4144 set i 1 4144 4145 foreach f $files { 4145 if { ![macports::ui_isset ports_debug]} {4146 if {$fancy_output} { 4146 4147 if {$files_count < 10000 || $i % 10 == 1 || $i == $files_count} { 4147 4148 ui_msg -nonewline "\r$macports::ui_prefix Updating database of binaries: [expr ($i * 1000 / $files_count) / 10.0]%" 4148 4149 flush stdout … … 4154 4155 4155 4156 if {0 != [catch {$f binary [fileIsBinary $fpath]} fileIsBinaryError]} { 4156 4157 # handle errors (e.g. file not found, permission denied) gracefully 4157 if { ![macports::ui_isset ports_debug]} {4158 if {$fancy_output} { 4158 4159 ui_msg "" 4159 4160 } 4160 4161 ui_warn "Error determining file type of `$fpath': $fileIsBinaryError" … … 4183 4184 4184 4185 set i 1 4185 4186 foreach b $binaries { 4186 if { ![macports::ui_isset ports_debug]} {4187 if {$fancy_output} { 4187 4188 if {$binary_count < 10000 || $i % 10 == 1 || $i == $binary_count} { 4188 4189 ui_msg -nonewline "\r$macports::ui_prefix Scanning binaries for linking errors: [expr ($i * 1000 / $binary_count) / 10.0]%" 4189 4190 flush stdout … … 4203 4204 # ignore silently, these are only static libs anyway 4204 4205 #ui_debug "Error parsing file ${bpath}: [machista::strerror $returncode]" 4205 4206 } else { 4206 if { ![macports::ui_isset ports_debug]} {4207 if {$fancy_output} { 4207 4208 ui_msg "" 4208 4209 } 4209 4210 ui_warn "Error parsing file ${bpath}: [machista::strerror $returncode]" … … 4225 4226 } else { 4226 4227 set portname "<unknown-port>" 4227 4228 } 4228 if { ![macports::ui_isset ports_debug]} {4229 if {$fancy_output} { 4229 4230 ui_msg "" 4230 4231 } 4231 4232 ui_warn "ID load command in ${bpath}, arch [machista::get_arch_name [$architecture cget -mat_arch]] (belonging to port $portname) contains relative path" … … 4236 4237 } else { 4237 4238 set portname "<unknown-port>" 4238 4239 } 4239 if { ![macports::ui_isset ports_debug]} {4240 if {$fancy_output} { 4240 4241 ui_msg "" 4241 4242 } 4242 4243 ui_warn "ID load command in ${bpath}, arch [machista::get_arch_name [$architecture cget -mat_arch]] refers to non-existant file $idloadcmdpath" … … 4253 4254 } else { 4254 4255 set portname "<unknown-port>" 4255 4256 } 4256 if { ![macports::ui_isset ports_debug]} {4257 if {$fancy_output} { 4257 4258 ui_msg "" 4258 4259 } 4259 4260 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" … … 4366 4367 incr broken_port_counts($portname) 4367 4368 if {$broken_port_counts($portname) > 3} { 4368 4369 ui_error "Port $portname is still broken after rebuiling it more than 3 times." 4369 if { ![macports::ui_isset ports_debug]} {4370 if {$fancy_output} { 4370 4371 ui_error "Please run port -d -y rev-upgrade and use the output to report a bug." 4371 4372 } 4372 4373 error "Port $portname still broken after rebuilding [expr $broken_port_counts($portname) - 1] time(s)"