Changeset 30011 for trunk/base


Ignore:
Timestamp:
Oct 18, 2007, 6:53:07 AM (12 years ago)
Author:
jmpp@…
Message:

Start the separation between port.tcl's private options and those that are passed to the macports1.0 API.
For the time being, simply store "ports_no_args" into the "private_options" array and poll the latter
whereever the former is needed, thus fixing the regressions introduced by the recent API tweaks. More
separation (taking away from ui_options and global_options) will come later on in follow-up commits.

Also remove some unnecessary calls to the global arrays in varios procs, as they are no longer needed
to be in scope due to the API tweaks.

This commit fixes #12837.

File:
1 edited

Legend:

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

    r29931 r30011  
    136136# case we continue
    137137proc fatal_softcontinue s {
    138     global global_options
    139138    if {[macports::global_option_isset ports_force]} {
    140139        ui_error $s
     
    150149# case we continue
    151150proc break_softcontinue { msg status name_status } {
    152     global ui_options
    153151    upvar $name_status status_var
    154152    ui_error $msg
     
    485483
    486484proc get_outdated_ports {} {
    487     global macports::registry.installtype ui_options
     485    global macports::registry.installtype
    488486    set is_image_mode [expr 0 == [string compare "image" ${macports::registry.installtype}]]
    489487
     
    10741072
    10751073proc action_info { action portlist opts } {
    1076     global ui_options
    10771074    set status 0
    10781075    require_portlist portlist
     
    14271424
    14281425proc action_uninstall { action portlist opts } {
    1429     global global_options
    14301426    set status 0
    14311427    if {[macports::global_option_isset port_uninstall_old]} {
     
    14511447
    14521448proc action_installed { action portlist opts } {
    1453     global global_options
     1449    global private_options
    14541450    set status 0
    14551451    set restrictedList 0
    14561452    set ilist {}
    14571453   
    1458     if { [llength $portlist] || ![macports::global_option_isset ports_no_args]} {
     1454    if { [llength $portlist] || ![info exists private_options(ports_no_args)] } {
    14591455        set restrictedList 1
    14601456        foreachport $portlist {
     
    15031499
    15041500proc action_outdated { action portlist opts } {
    1505     global macports::registry.installtype ui_options global_options
     1501    global macports::registry.installtype private_options
    15061502    set is_image_mode [expr 0 == [string compare "image" ${macports::registry.installtype}]]
    15071503
     
    15111507    set ilist {}
    15121508    set restrictedList 0
    1513     if { [llength $portlist] || ![macports::global_option_isset ports_no_args]} {
     1509    if { [llength $portlist] || ![info exists private_options(ports_no_args)] } {
    15141510        set restrictedList 1
    15151511        foreach portspec $portlist {
     
    17571753
    17581754proc action_search { action portlist opts } {
    1759     global global_options
     1755    global private_options
    17601756    set status 0
    1761     if {![llength $portlist] && [macports::global_option_isset ports_no_args]} {
     1757    if {![llength $portlist] && [info exists private_options(ports_no_args)]} {
    17621758        ui_error "You must specify a search pattern"
    17631759        return 1
     
    18061802
    18071803proc action_list { action portlist opts } {
    1808     global global_options
     1804    global private_options
    18091805    set status 0
    18101806   
    18111807    # Default to list all ports if no portnames are supplied
    1812     if {![llength $portlist] && [macports::global_option_isset ports_no_args]} {
     1808    if { ![llength $portlist] && [info exists private_options(ports_no_args)] } {
    18131809        add_to_portlist portlist [list name "-all-"]
    18141810    }
     
    23052301proc process_cmd { argv } {
    23062302    global cmd_argc cmd_argv cmd_argn
    2307     global global_options global_options_base ui_options
     2303    global global_options global_options_base private_options ui_options
    23082304    global current_portdir
    23092305    set cmd_argv $argv
     
    23472343            ;       -
    23482344            _EOF_ {
    2349                 set global_options(ports_no_args) yes
     2345                set private_options(ports_no_args) yes
    23502346            }
    23512347            default {
     
    24742470
    24752471proc process_command_file { in } {
    2476     global current_portdir ui_options
     2472    global current_portdir
    24772473
    24782474    # Initialize readline
     
    25402536
    25412537proc process_command_files { filelist } {
    2542     global ui_options
    25432538    set exit_status 0
    25442539
     
    25802575##########################################
    25812576
    2582 # globals
     2577# Global arrays used by the macports1.0 layer
    25832578array set ui_options        {}
    25842579array set global_options    {}
    25852580array set global_variations {}
     2581
     2582# Global options private to this script
     2583array set private_options {}
    25862584
    25872585# Save off a copy of the environment before mportinit monkeys with it
Note: See TracChangeset for help on using the changeset viewer.