Ignore:
Timestamp:
Jun 8, 2013, 1:11:28 AM (6 years ago)
Author:
cal@…
Message:

active_variants: avoid using a variables named "name"

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/_resources/port1.0/group/active_variants-1.1.tcl

    r106779 r106780  
    9292        # path-style dependencies. This comes from port1.0/portutil.tcl and should
    9393        # probably not be considered public API.
    94         set name [_get_dep_port $depspec]
    95         if {$name == ""} {
     94        set port [_get_dep_port $depspec]
     95        if {$port == ""} {
    9696            ui_error "active_variants: Error: invalid port depspec '${depspec}'"
    9797            ui_error "  expecting either: port or (bin:lib:path):foo:port"
    9898            return 0
    9999        }
    100         if {$depspec != $name} {
    101             ui_debug "Checking $name for active variants for depspec '$depspec'"
     100        if {$depspec != $port} {
     101            ui_debug "Checking $port for active variants for depspec '$depspec'"
    102102        }
    103103
     
    112112        # In the SQLite case the call goes to registry2.0/receipt_sqlite.tcl,
    113113        # line 45, proc active, which in turn calls registry::entry installed
    114         # $name, which comes from registry2.0/entry.c, line 387. I won't dig
     114        # $port, which comes from registry2.0/entry.c, line 387. I won't dig
    115115        # deeper than that, since that's as far as we need to go to handle this
    116116        # correctly.
     
    123123        # block.
    124124
    125         # this will throw if $name isn't active
    126         set installed [lindex [registry_active $name] 0]
     125        # this will throw if $port isn't active
     126        set installed [lindex [registry_active $port] 0]
    127127
    128128        # In $installed there are in order: name, version, revision, variants,
     
    180180        foreach _require_active_variant $_require_active_variants_list {
    181181                set depspec [lindex $_require_active_variant 0]
    182                 set name [_get_dep_port $depspec]
     182                set port [_get_dep_port $depspec]
    183183                set required [lindex $_require_active_variant 1]
    184184                set forbidden [lindex $_require_active_variant 2]
    185185                if {[catch {set result [active_variants $depspec $required $forbidden]}] != 0} {
    186                         error "${name} is required, but not active."
     186                        error "${port} is required, but not active."
    187187                }
    188188                if {!$result} {
     
    199199                                set str_combine " and "
    200200                        }
    201                         error "${name} must be installed ${str_required}${str_combine}${str_forbidden}."
     201                        error "${port} must be installed ${str_required}${str_combine}${str_forbidden}."
    202202                }
    203203        }
Note: See TracChangeset for help on using the changeset viewer.