Changeset 118304 for trunk/base
- Timestamp:
- Mar 29, 2014, 7:21:58 PM (10 years ago)
- Location:
- trunk/base/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/base/src/macports1.0/macports.tcl
r118298 r118304 1295 1295 } 1296 1296 1297 # notifications callback 1298 if {[info exists macports::ui_options(notifications_append)]} { 1299 $workername alias ui_notifications_append $macports::ui_options(notifications_append) 1300 } else { 1301 # provide a no-op if notifications_append wasn't set. See http://wiki.tcl.tk/3044 1302 $workername alias ui_notifications_append return -level 0 1303 } 1304 1297 1305 $workername alias ui_prefix ui_prefix 1298 1306 $workername alias ui_channels ui_channels -
trunk/base/src/port/port.tcl
r117702 r118304 4640 4640 } 4641 4641 4642 # Print notifications of just-activated ports. 4643 portclient::notifications::display 4644 4642 4645 # semaphore to exit 4643 4646 if {$action_status == -999} break … … 5168 5171 } 5169 5172 5173 namespace eval portclient::notifications { 5174 ## 5175 # Ports whose notifications to display; these were either installed 5176 # or requested to be installed. 5177 variable notificationsToPrint 5178 array set notificationsToPrint {} 5179 5180 ## 5181 # Add a port to the list for printing notifications. 5182 # 5183 # @param name 5184 # The name of the port. 5185 # @param note 5186 # A list of notes to be stored for the given port. 5187 proc append {name notes} { 5188 variable notificationsToPrint 5189 5190 set notificationsToPrint($name) $notes 5191 } 5192 5193 ## 5194 # Print port notifications. 5195 # 5196 proc display {} { 5197 global env 5198 variable notificationsToPrint 5199 5200 # Display notes at the end of the activation phase. 5201 if {[array size notificationsToPrint] > 0} { 5202 ui_notice "---> Some of the ports you installed have notes:" 5203 foreach {name notes} [array get notificationsToPrint] { 5204 ui_notice " $name has the following notes:" 5205 5206 # If env(COLUMNS) exists, limit each line's width to this width. 5207 if {[info exists env(COLUMNS)]} { 5208 set maxlen $env(COLUMNS) 5209 5210 foreach note $notes { 5211 foreach line [split $note "\n"] { 5212 set joiner "" 5213 set lines "" 5214 set newline " " 5215 5216 foreach word [split $line " "] { 5217 if {[string length $newline] + [string length $word] >= $maxlen} { 5218 lappend lines $newline 5219 set newline " " 5220 set joiner "" 5221 } 5222 ::append newline $joiner $word 5223 set joiner " " 5224 } 5225 if {$newline ne {}} { 5226 lappend lines $newline 5227 } 5228 ui_notice [join $lines "\n"] 5229 } 5230 } 5231 } else { 5232 foreach note $notes { 5233 ui_notice $note 5234 } 5235 } 5236 } 5237 } 5238 } 5239 } 5240 5170 5241 5171 5242 ########################################## … … 5222 5293 set ui_options(progress_generic) portclient::progress::generic 5223 5294 } 5295 5296 set ui_options(notifications_append) portclient::notifications::append 5224 5297 5225 5298 # Get arguments remaining after option processing -
trunk/base/src/port1.0/portactivate.tcl
r116820 r118304 61 61 62 62 proc portactivate::activate_main {args} { 63 global env subport version revision portvariants user_options PortInfo startupitem.autostart UI_PREFIX63 global subport version revision portvariants user_options PortInfo 64 64 65 65 registry_activate $subport $version $revision $portvariants [array get user_options] 66 67 # Display notes at the end of the activation phase. 68 if {[info exists PortInfo(notes)] && $PortInfo(notes) ne {}} { 69 ui_notice "" 70 foreach note $PortInfo(notes) { 71 # If env(COLUMNS) exists, limit each line's width to this width. 72 if {[info exists env(COLUMNS)]} { 73 set maxlen $env(COLUMNS) 74 75 foreach line [split $note "\n"] { 76 set joiner "" 77 set lines "" 78 set newline "" 79 80 foreach word [split $line " "] { 81 if {[string length $newline] + [string length $word] >= $maxlen} { 82 lappend lines $newline 83 set newline "" 84 set joiner "" 85 } 86 append newline $joiner $word 87 set joiner " " 88 } 89 if {$newline ne {}} { 90 lappend lines $newline 91 } 92 ui_notice [join $lines "\n"] 93 } 94 } else { 95 ui_notice $note 96 } 97 } 98 ui_notice "" 66 if {[info exists PortInfo(notes)] && [llength $PortInfo(notes)] > 0} { 67 ui_notifications_append $subport $PortInfo(notes) 99 68 } 100 69
Note: See TracChangeset
for help on using the changeset viewer.