Changeset 221


Ignore:
Timestamp:
Aug 21, 2002, 7:18:41 AM (18 years ago)
Author:
jkh
Message:

Add more appropriate types and grades of verbosity.

Location:
trunk/base/src/port1.0
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/port1.0/portbuild.tcl

    r218 r221  
    1515options make.cmd make.type make.target.all make.target.install
    1616
     17set UI_PREFIX "---> "
     18
    1719proc build_main {args} {
    18     global portname portpath workdir worksrcdir prefix make.type make.cmd make.worksrcdir make.target.all
     20    global portname portpath workdir worksrcdir prefix make.type make.cmd make.worksrcdir make.target.all UI_PREFIX
    1921
    2022    default make.type bsd
     
    3234    }
    3335    default make.target.all all
     36    ui_msg "$UI_PREFIX Building $portname with target ${make.target.all}"
    3437    system "${make.cmd} ${make.target.all}"
    3538    return 0
  • trunk/base/src/port1.0/portchecksum.tcl

    r214 r221  
    1414options checksums
    1515
     16set UI_PREFIX "---> "
     17
    1618proc md5 {file} {
    17     global distpath
     19    global distpath UI_PREFIX
    1820
    1921    set md5regex "^(MD5)\[ \]\\(($file)\\)\[ \]=\[ \](\[A-Za-z0-9\]+)\n$"
     
    2426    } else {
    2527        # XXX Handle this error beter
    26         ui_puts $line
    27         ui_puts "md5sum failed!"
     28        ui_error "$UI_PREFIX $line - md5sum failed!"
    2829        return -1
    2930    }
     
    4243
    4344proc checksum_main {args} {
    44     global checksums distpath portpath all_dist_files
     45    global checksums distpath portpath all_dist_files UI_PREFIX
    4546
    4647    # If no files have been downloaded there is nothing to checksum
     
    5051
    5152    if ![info exists checksums] {
    52         ui_puts "No MD5 checksums."
     53        ui_error "$UI_PREFIX No MD5 checksums."
    5354        return -1
    5455    }
     
    5859        set dchecksum [dmd5 $distfile]
    5960        if {$dchecksum == -1} {
    60             ui_puts "No checksum recorded for $distfile"
     61            ui_error "$UI_PREFIX No checksum recorded for $distfile"
    6162            return -1
    6263        }
    6364        if {$checksum == $dchecksum} {
    64             ui_puts "Checksum OK for $distfile"
     65            ui_msg "$UI_PREFIX Checksum OK for $distfile"
    6566        } else {
    66             ui_puts "Checksum mismatch for $distfile"
     67            ui_error "$UI_PREFIX Checksum mismatch for $distfile"
    6768            return -1
    6869        }
  • trunk/base/src/port1.0/portconfigure.tcl

    r218 r221  
    1515options configure.type configure.args configure.worksrcdir automake automake.env automake.args autoconf autoconf.env autoconf.args xmkmf libtool
    1616
     17set UI_PREFIX "---> "
     18
    1719proc configure_main {args} {
    18     global configure configure.type configure.args configure.worksrcdir automake automake.env automake.args autoconf autoconf.env autoconf.args xmkmf libtool portname portpath workdir worksrcdir prefix
     20    global configure configure.type configure.args configure.worksrcdir automake automake.env automake.args autoconf autoconf.env autoconf.args xmkmf libtool portname portpath workdir worksrcdir prefix UI_PREFIX
    1921
    2022    if [info exists configure.worksrcdir] {
     
    2931    }
    3032
     33    ui_msg "$UI_PREFIX Running configure script"
    3134    if [info exists configure.args] {
    3235        system "./configure --prefix=${prefix} ${configure.args}"
  • trunk/base/src/port1.0/portextract.tcl

    r218 r221  
    1717options extract_opts extract.only extract.cmd extract.before_args extract.after_args
    1818
     19set UI_PREFIX "---> "
     20
    1921proc extract_main {args} {
    20     global portname portpath portpath workdir distname distpath distfiles use_bzip2 extract.only extract.cmd extract.before_args extract.after_args
     22    global portname portpath portpath workdir distname distpath distfiles use_bzip2 extract.only extract.cmd extract.before_args extract.after_args UI_PREFIX
    2123
    2224    if {![info exists distfiles] && ![info exists extract.only]} {
     
    3941    }
    4042
    41     ui_puts "Extracting for $distname"
     43    ui_msg "$UI_PREFIX Extracting for $distname"
    4244
    4345    cd $portpath/$workdir
    4446    foreach distfile ${extract.only} {
    45         ui_puts "$distfile: " -nonewline
    46         flush stdout
     47        ui_info "$UI_PREFIX Extracting $distfile ... " -nonewline
    4748        set cmd "${extract.cmd} [join ${extract.before_args}] $distpath/$distfile [join ${extract.after_args}]"
    4849        if [catch {system $cmd} result] {
    49             ui_puts $result
     50            ui_error "$UI_PREFIX $result"
    5051            return -1
    5152        }
    52         ui_puts "done"
     53        ui_info "Done"
    5354    }
    5455    return 0
  • trunk/base/src/port1.0/portfetch.tcl

    r220 r221  
    1717# Defaults
    1818default extract_sufx tar.gz
     19
     20set UI_PREFIX "---> "
    1921
    2022proc suffix {distname} {
     
    4749
    4850proc fetchfiles {args} {
    49     global distpath all_dist_files master_sites
     51    global distpath all_dist_files master_sites UI_PREFIX
    5052
    5153    if {![file isdirectory $distpath]} {
     
    5557    foreach distfile $all_dist_files {
    5658        if {![file isfile $distpath/$distfile]} {
    57             ui_puts "$distfile doesn't seem to exist in $distpath"
     59            ui_info "$UI_PREFIX $distfile doesn't seem to exist in $distpath"
    5860            foreach site $master_sites {
    59                 ui_puts "Attempting to fetch from $site"
     61                ui_msg "$UI_PREFIX Attempting to fetch $distfile from $site"
    6062                if ![catch {exec curl -o ${distpath}/${distfile} ${site}${distfile} >&@ stdout} result] {
    6163                    set fetched 1
  • trunk/base/src/port1.0/portpatch.tcl

    r218 r221  
    1212register com.apple.patch swdep build depends_build
    1313
     14set UI_PREFIX "---> "
     15
    1416proc patch_main {args} {
    15     global portname patchfiles distpath filedir workdir portpath
     17    global portname patchfiles distpath filedir workdir portpath UI_PREFIX
    1618
    1719    if ![info exists patchfiles] {
     
    3032    cd $portpath/$workdir
    3133    foreach patch $patchlist {
     34        ui_info "$UI_PREFIX Applying $patch"
    3235        switch -glob -- [file tail $patch] {
    3336            *.Z -
  • trunk/base/src/port1.0/portui.tcl

    r214 r221  
    1515# If set, output informational messages (ui_info)
    1616options ports_verbose
     17
     18# If set, don't output "standard messages"
     19options ports_quiet
    1720
    1821# do whatever interesting things need to be done to initialize the UI
     
    7073
    7174# Output message if ports_verbose is set.
    72 # Output debugging messages if the ports_debug variable is set.
    73 proc ui_info {str} {
     75proc ui_info {str {nonl ""}} {
    7476    global ports_verbose
    7577
    7678    if [tbool ports_verbose] {
    77         ui_puts $str
     79        ui_puts $str $nonl
    7880    }
     81}
     82
     83# Output message unless ports_quiet is set.
     84proc ui_msg {str {nonl ""}} {
     85    global ports_quiet
     86
     87    if ![tbool ports_quiet] {
     88        ui_puts $str $nonl
     89    }
     90}
     91
     92# Output message unconditionally as an error message.
     93proc ui_error {str} {
     94    ui_puts Error: $str
    7995}
    8096
  • trunk/base/src/port1.0/portutil.tcl

    r217 r221  
    140140        set procedure [lindex $args 1]
    141141        if {[dlist_has_key targets $name procedure,$chain]} {
    142             ui_puts "Warning: target '$name' re-registered for chain $chain (new procedure: '$procedure')"
     142            ui_info "Warning: target '$name' re-registered for chain $chain (new procedure: '$procedure')"
    143143        }
    144144        dlist_set_key targets $name procedure,$chain $procedure
     
    161161            dlist_append_key targets $name $mode $args
    162162        } else {
    163             ui_puts "Warning: target '$name' not-registered in register $mode"
     163            ui_info "Warning: target '$name' not-registered in register $mode"
    164164        }
    165165       
     
    407407    if { [llength $names] > 0} {
    408408        # somebody broke!
    409         ui_puts "Warning: the following items did not execute: "
     409        ui_info "Warning: the following items did not execute: "
    410410        foreach name $names {
    411             ui_puts "$uplist($name) " -nonewline
    412         }
    413         ui_puts ""
     411            ui_info "$uplist($name) " -nonewline
     412        }
     413        ui_info ""
    414414    }
    415415}
     
    429429            }
    430430        } else {
    431             ui_puts "$chain error: $name returned $result"
     431            ui_error "$chain error: $name returned $result"
    432432            set result failure
    433433        }
    434434    } else {
    435         ui_puts "Warning: $name does not support chain $chain"
     435        ui_info "Warning: $name does not support chain $chain"
    436436        set result failure
    437437    }
     
    452452            # Special-case 'all'
    453453        } elseif {![string equal $target all]} {
    454             ui_puts "Warning: unknown target: $target"
     454            ui_info "Warning: unknown target: $target"
    455455            return
    456456        }
Note: See TracChangeset for help on using the changeset viewer.