Changeset 1452 for trunk/base


Ignore:
Timestamp:
Dec 18, 2002, 3:43:18 AM (21 years ago)
Author:
kevin
Message:

Add channel parameter to ui_puts to select between stderr and stdout.

Location:
trunk/base/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/darwinports1.0/darwinportsui.tcl

    r420 r1452  
    109109# must pass "-nonewline" as the second argument.
    110110
    111 proc ui_puts {str {nonl ""}} {
     111proc ui_puts {chan str {nonl ""}} {
    112112    if ![ui_enabled] return
    113113
    114114    if {$nonl == "-nonewline"} {
    115         puts -nonewline stdout "$str"
    116         flush stdout
     115        puts -nonewline $chan "$str"
     116        flush $chan
    117117    } else {
    118         puts "$str"
     118        puts $chan "$str"
    119119    }
    120120}
     
    134134
    135135    if [isset ports_verbose] {
    136         ui_puts "$str" $nonl
     136        ui_puts stdout "$str" $nonl
    137137    }
    138138}
     
    143143
    144144    if ![isset ports_quiet] {
    145         ui_puts "$str" $nonl
     145        ui_puts stdout "$str" $nonl
    146146    }
    147147}
     
    149149# Output message unconditionally as an error message.
    150150proc ui_error {str} {
    151     ui_puts "Error: $str"
     151    ui_puts stderr "Error: $str"
    152152}
    153153
     
    173173    set satisfaction no
    174174    while {$satisfaction == "no"} {
    175         ui_puts $promptstr -nonewline
     175        ui_puts stdout $promptstr -nonewline
    176176        if {[ui_gets mystr] == 0} {
    177177            if {[string length $defvalue] > 0} {
     
    199199# "promptstr".  There is no return value.
    200200proc ui_confirm {promptstr} {
    201     ui_puts "$promptstr" -nonewline
     201    ui_puts stdout "$promptstr" -nonewline
    202202    ui_gets garbagestr
    203203}
  • trunk/base/src/port1.0/portutil.tcl

    r1450 r1452  
    622622    if [catch {flock $fd -exclusive -noblock} result] {
    623623        if {"$result" == "EAGAIN"} {
    624             ui_puts "Waiting for lock on $statefile"
     624            ui_msg "Waiting for lock on $statefile"
    625625        } elseif {"$result" == "EOPNOTSUPP"} {
    626626            # Locking not supported, just return
Note: See TracChangeset for help on using the changeset viewer.