Ignore:
Timestamp:
Oct 14, 2015, 3:36:25 AM (3 years ago)
Author:
dstrubbe@…
Message:

active_variants PortGroup:

  • Perform a check in the activate phase too, to catch the case that a port was deactivated, a dependency was installed with problematic variants, and then the port was reactivated. In this case a warning is written.
  • Typos.
File:
1 edited

Legend:

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

    r119335 r141271  
    5252#    is a list of variants that must be enabled for the test to succeed
    5353#    (required; remember this can also be a space-separated string or just
    54 #    a string for a single value. It's iterpreted as list, though.)
     54#    a string for a single value. It's interpreted as list, though.)
    5555#  $forbidden
    5656#    is a list of variants that may not be enabled for the test to succeed
     
    7171#
    7272# If all you want to do is bail out when the condition isn't fulfilled, there's
    73 # a convience wrapper available. If the condition isn't met it will print an
     73# a convenience wrapper available. If the condition isn't met it will print an
    7474# error message and exit in a pre-configure phase. This can't be run any
    7575# earlier, because not all dependency types are installed before configure
     
    165165}
    166166
    167 # global list holding all items the should be checked for and cause an error if
     167# global list holding all items should be checked for and cause an error if
    168168# not present
    169169set _require_active_variants_list [list]
     
    188188                        set deptypes "depends_fetch depends_extract depends_lib depends_build depends_run"
    189189                }
    190                 archivefetch {
     190                activate -
     191                archivefetch {
    191192                        set deptypes "depends_lib depends_run"
    192193                }
     
    198199        # for each type we're considering
    199200        foreach deptype $deptypes {
    200                 # check that there are any dependencies by that type
     201                # check whether there are any dependencies of that type
    201202                if {[info exists PortInfo($deptype)]} {
    202203                        # and for each dependency
     
    232233
    233234                if {[catch {set result [active_variants $depspec $required $forbidden]}] != 0} {
    234                         error "${port} is required, but not active."
     235                    set message "${port} is required, but not active."
     236                    if {$method == activate} {
     237                        ui_msg "Warning: $message"
     238                    } else {
     239                        error "$message"
     240                    }
    235241                }
    236242                if {!$result} {
     
    247253                                set str_combine " and "
    248254                        }
    249                         error "${port} must be installed ${str_required}${str_combine}${str_forbidden}."
     255                        set message "${port} must be installed ${str_required}${str_combine}${str_forbidden}."
     256                        if {$method == "activate"} {
     257                            ui_msg "Warning: $message"
     258                        } else {
     259                            error "$message"
     260                        }
    250261                }
    251262        }
     
    263274        _check_require_active_variants archivefetch
    264275}
     276
     277# be sure that a required variant was not changed since this port was built or fetched
     278pre-activate {
     279        _check_require_active_variants activate
     280}
Note: See TracChangeset for help on using the changeset viewer.