Ignore:
Timestamp:
Sep 17, 2007, 7:55:36 AM (12 years ago)
Author:
jmpp@…
Message:

API change:

  • move ui_isset and global_option_isset procs that are found in every single macports1.0 client into macports1.0 itself, sparing the clients from implementing them repeatedly;
  • change their prototypes to require the arrays as arguments, so that the library clients can still set and fill them up as desired;
  • update every macports1.0 client in our tree to use this new API (this expands to the port, portindex and portmirror scripts in the base/src/port, do let me know of I'm missing any).

PS: The purpose of this commit is to further simplify macports1.0 scripting, so that a client is not forced to do all the UI initialization plumbing.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/port/portmirror.tcl

    r29189 r29191  
    2626# ui_options(ports_quiet) - If set, don't output "standard messages"
    2727
    28 # ui_options accessor
    29 proc ui_isset {val} {
    30     global ui_options
    31     if {[info exists ui_options($val)]} {
    32     if {$ui_options($val) == "yes"} {
    33         return 1
    34     }
    35     }
    36     return 0
    37 }
    3828
    3929# UI Callback
     
    5848    switch $priority {
    5949        debug {
    60             if {[ui_isset ports_debug]} {
     50            if {[macports::ui_isset ui_options ports_debug]} {
    6151                return {stderr}
    6252            } else {
     
    6555        }
    6656        info {
    67             if {[ui_isset ports_verbose]} {
     57            if {[macports::ui_isset ui_options ports_verbose]} {
    6858                return {stdout}
    6959            } else {
     
    7262        }
    7363        msg {
    74             if {[ui_isset ports_quiet]} {
     64            if {[macports::ui_isset ui_options ports_quiet]} {
    7565                return {}
    7666            } else {
Note: See TracChangeset for help on using the changeset viewer.