[66790] trunk/base/src/port/port.tcl
raimue at macports.org
raimue at macports.org
Thu Apr 22 17:48:17 PDT 2010
Revision: 66790
http://trac.macports.org/changeset/66790
Author: raimue at macports.org
Date: 2010-04-22 17:48:15 -0700 (Thu, 22 Apr 2010)
Log Message:
-----------
port/port.tcl: Use ui_notice, removing lots of ![macports::ui_isset ports_quiet] tests
Modified Paths:
--------------
trunk/base/src/port/port.tcl
Modified: trunk/base/src/port/port.tcl
===================================================================
--- trunk/base/src/port/port.tcl 2010-04-23 00:46:23 UTC (rev 66789)
+++ trunk/base/src/port/port.tcl 2010-04-23 00:48:15 UTC (rev 66790)
@@ -184,9 +184,7 @@
# show the URL for the ticket reporting instructions
proc print_tickets_url {args} {
- if {![macports::ui_isset ports_quiet]} {
- ui_msg "To report a bug, see <http://guide.macports.org/#project.tickets>"
- }
+ ui_notice "To report a bug, see <http://guide.macports.org/#project.tickets>"
}
# Form a composite version as is sometimes used for registry functions
@@ -261,9 +259,7 @@
if { [llength $ilist] > 1 } {
# set portname again since the one we were passed may not have had the correct case
set portname [lindex [lindex $ilist 0] 0]
- if {![macports::ui_isset ports_quiet] && [isatty stdout]} {
- puts "The following versions of $portname are currently installed:"
- }
+ ui_notice "The following versions of $portname are currently installed:"
foreach i [portlist_sortint $ilist] {
set iname [lindex $i 0]
set iversion [lindex $i 1]
@@ -2105,9 +2101,7 @@
set ref [registry::open_entry $portname $version $revision $variants $epoch]
if { [string equal [registry::property_retrieve $ref installtype] "image"] } {
set imagedir [registry::property_retrieve $ref imagedir]
- if {![macports::ui_isset ports_quiet]} {
- puts "Port $portname ${version}_${revision}${variants} is installed as an image in:"
- }
+ ui_notice "Port $portname ${version}_${revision}${variants} is installed as an image in:"
puts $imagedir
} else {
break_softcontinue "Port $portname is not installed as an image." 1 status
@@ -2175,13 +2169,11 @@
set portname $portinfo(name)
# Display the notes.
- if {![macports::ui_isset ports_quiet]} {
- if {$portnotes ne {}} {
- puts "$portname has the following notes:"
- puts [wrap $portnotes 0 " " 1]
- } else {
- puts "$portname has no notes."
- }
+ if {$portnotes ne {}} {
+ ui_notice "$portname has the following notes:"
+ puts [wrap $portnotes 0 " " 1]
+ } else {
+ puts "$portname has no notes."
}
}
return $status
@@ -2344,17 +2336,13 @@
return 1
}
- if {![macports::ui_isset ports_quiet] && [isatty stdout]} {
- puts "Available versions for $group:"
- }
+ ui_notice "Available versions for $group:"
foreach v $versions {
- if {![macports::ui_isset ports_quiet] && [isatty stdout]} {
- puts -nonewline "\t"
- }
+ ui_notice -nonewline "\t"
if {$selected_version == $v} {
- puts "$v (active)"
+ ui_msg "$v (active)"
} else {
- puts "$v"
+ ui_msg "$v"
}
}
return 0
@@ -2371,12 +2359,12 @@
}
set version [lindex $portlist 1]
- puts -nonewline "Selecting '$version' for '$group' "
+ ui_msg -nonewline "Selecting '$version' for '$group' "
if {[catch {mportselect $command $group $version} result]} {
- puts "failed: $result"
+ ui_msg "failed: $result"
return 1
}
- puts "succeeded. '$version' is now active."
+ ui_msg "succeeded. '$version' is now active."
return 0
}
show {
@@ -2584,7 +2572,7 @@
foreach dep $deplist {
set depport [lindex $dep 2]
if {[macports::ui_isset ports_quiet]} {
- puts "$depport"
+ ui_msg "$depport"
} elseif {![macports::ui_isset ports_verbose]} {
ui_msg "$depport depends on $portname"
} else {
@@ -2850,9 +2838,7 @@
}
}
if { [llength $ilist] > 0 } {
- if {![macports::ui_isset ports_quiet]} {
- puts "The following ports are currently installed:"
- }
+ ui_notice "The following ports are currently installed:"
foreach i [portlist_sortint $ilist] {
set iname [lindex $i 0]
set iversion [lindex $i 1]
@@ -2884,13 +2870,9 @@
}
}
} elseif { $restrictedList } {
- if {![macports::ui_isset ports_quiet]} {
- puts "None of the specified ports are installed."
- }
+ ui_notice "None of the specified ports are installed."
} else {
- if {![macports::ui_isset ports_quiet]} {
- puts "No ports are installed."
- }
+ ui_notice "No ports are installed."
}
return $status
@@ -3018,8 +3000,8 @@
# Emit information
if {$comp_result < 0 || [macports::ui_isset ports_verbose]} {
- if { $num_outdated == 0 && ![macports::ui_isset ports_quiet]} {
- puts "The following installed ports are outdated:"
+ if {$num_outdated == 0} {
+ ui_notice "The following installed ports are outdated:"
}
incr num_outdated
@@ -3029,17 +3011,13 @@
}
}
- if { $num_outdated == 0 && ![macports::ui_isset ports_quiet]} {
- puts "No installed ports are outdated."
+ if {$num_outdated == 0} {
+ ui_notice "No installed ports are outdated."
}
} elseif { $restrictedList } {
- if {![macports::ui_isset ports_quiet]} {
- puts "None of the specified ports are outdated."
- }
+ ui_notice "None of the specified ports are outdated."
} else {
- if {![macports::ui_isset ports_quiet]} {
- puts "No ports are installed."
- }
+ ui_notice "No ports are installed."
}
return $status
@@ -3059,21 +3037,15 @@
set files [registry::port_registered $portname]
if { $files != 0 } {
if { [llength $files] > 0 } {
- if {![macports::ui_isset ports_quiet]} {
- puts "Port $portname contains:"
- }
+ ui_notice "Port $portname contains:"
foreach file $files {
puts " $file"
}
} else {
- if {![macports::ui_isset ports_quiet]} {
- puts "Port $portname does not contain any files or is not active."
- }
+ ui_notice "Port $portname does not contain any files or is not active."
}
} else {
- if {![macports::ui_isset ports_quiet]} {
- puts "Port $portname is not installed."
- }
+ ui_notice "Port $portname is not installed."
}
}
registry::close_file_map
@@ -3127,9 +3099,7 @@
# if this fails the port doesn't have any variants
if {![info exists portinfo(variants)]} {
- if {![macports::ui_isset ports_quiet]} {
- puts "$portname has no variants"
- }
+ ui_notice "$portname has no variants"
} else {
array unset vinfo
# Use the new format if it exists.
@@ -3141,9 +3111,7 @@
}
# print out all the variants
- if {![macports::ui_isset ports_quiet]} {
- puts "$portname has the variants:"
- }
+ ui_notice "$portname has the variants:"
foreach v [lsort $portinfo(variants)] {
unset -nocomplain vconflicts vdescription vrequires
# Retrieve variants' information from the new format.
@@ -3329,14 +3297,11 @@
set portfound 1
}
if { !$portfound } {
- if {![macports::ui_isset ports_quiet]} {
- ui_msg "No match for $portname found"
- }
+ ui_notice "No match for $portname found"
} elseif {[llength $res] > 1} {
if {(![info exists global_options(ports_search_line)]
- || $global_options(ports_search_line) != "yes")
- && ![macports::ui_isset ports_quiet]} {
- ui_msg "\nFound [llength $res] ports."
+ || $global_options(ports_search_line) != "yes")} {
+ ui_notice "\nFound [llength $res] ports."
}
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100422/39734ad8/attachment-0001.html>
More information about the macports-changes
mailing list