Ignore:
Timestamp:
Jan 16, 2003, 2:59:55 AM (16 years ago)
Author:
landonf
Message:

Handle deprecated options with no replacement

File:
1 edited

Legend:

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

    r1651 r1689  
    118118# Causes a warning to be printed when an option is set or accessed
    119119proc option_deprecate {option {newoption ""} } {
    120     eval "proc warn_deprecated_$option \{option action args\} \{ \n\
    121         global portname $option $newoption \n\
    122         if \{\"$newoption\" != \"\" \&\& \$action != \"read\" \} \{ \n\
    123             $newoption \[set $option\] \n\
    124         \} else \{ \n\
    125             ui_warn \"Port \$portname using deprecated option \\\"$option\\\".\" \n\
    126             if \{ \"$newoption\" != \"\" && \$action == \"read\" \} \{ \n\
     120    # If a new option is specified, default the option to {${newoption}}
     121    # Display a warning
     122    if {$newoption != ""} {
     123        eval "proc warn_deprecated_$option \{option action args\} \{ \n\
     124            global portname $option $newoption \n\
     125            if \{\$action != \"read\"\} \{ \n\
     126                $newoption \[set \$option\] \n\
     127            \} else \{ \n\
     128                ui_warn \"Port \$portname using deprecated option \\\"$option\\\".\" \n\
    127129                $option \[set $newoption\] \n\
    128130            \} \n\
    129         \}
    130     \}"
    131     # If a new option is specified, default the option to {${newoption}}
    132     if {$newoption != ""} {
    133         eval "default $option {\$\{$newoption\}}"
     131        \}"
     132    } else {
     133        eval "proc warn_deprecated_$option \{option action args\} \{ \n\
     134            global portname $option $newoption \n\
     135            ui_warn \"Port \$portname using deprecated option \\\"$option\\\".\" \n\
     136        \}"
    134137    }
    135138    option_proc $option warn_deprecated_$option
Note: See TracChangeset for help on using the changeset viewer.