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/portindex.tcl

    r29188 r29191  
    2929# ui_options(ports_quiet) - If set, don't output "standard messages"
    3030
    31 # ui_options accessor
    32 proc ui_isset {val} {
    33     global ui_options
    34     if {[info exists ui_options($val)]} {
    35         if {$ui_options($val) == "yes"} {
    36             return 1
    37         }
    38     }
    39     return 0
    40 }
    41 
    4231# UI Callback
    4332proc ui_prefix {priority} {
     
    6150    switch $priority {
    6251        debug {
    63             if {[ui_isset ports_debug]} {
     52            if {[macports::ui_isset ui_options ports_debug]} {
    6453                return {stderr}
    6554            } else {
     
    6857        }
    6958        info {
    70             if {[ui_isset ports_verbose]} {
     59            if {[macports::ui_isset ui_options ports_verbose]} {
    7160                return {stdout}
    7261            } else {
     
    7564        }
    7665        msg {
    77             if {[ui_isset ports_quiet]} {
     66            if {[macports::ui_isset ui_options ports_quiet]} {
    7867                return {}
    7968            } else {
Note: See TracChangeset for help on using the changeset viewer.