Changeset 29043 for trunk/base


Ignore:
Timestamp:
Sep 13, 2007, 5:50:48 PM (12 years ago)
Author:
afb@…
Message:

lint variants and their descriptions

File:
1 edited

Legend:

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

    r29042 r29043  
    9191        ]
    9292
     93set lint_variants [list \
     94        "universal" \
     95        "docs" \
     96        "x11" \
     97        ]
     98
    9399
    94100proc seems_utf8 {str} {
     
    147153    set in_description false
    148154
     155    set local_variants [list]
     156
    149157    set f [open $portfile RDONLY]
    150158    # read binary (to check UTF-8)
     
    235243        }
    236244
     245        if {[string match "variant*" $line]} {
     246            regexp {variant\s+(\w+)} $line -> variantname
     247            if {[info exists variantname]} {
     248                 lappend local_variants $variantname
     249            }
     250        }
     251
    237252        ### TODO: more checks to Portfile syntax
    238253
     
    246261    # hoping for "noarch" :
    247262    set portarch ${os.arch}
    248     global description long_description categories maintainers platforms homepage master_sites checksums
     263    global description long_description platforms categories all_variants
     264    global maintainers homepage master_sites checksums
    249265   
    250     global lint_portsystem lint_platforms lint_categories lint_required lint_optional
     266    global lint_portsystem lint_platforms lint_categories
     267    global lint_required lint_optional lint_variants
    251268
    252269    if (!$seen_portsystem) {
     
    329346    }
    330347
     348    set variantnumber 1
     349    foreach variant $all_variants {
     350        set variantname [ditem_key $variant name]
     351        set variantdesc [lindex [ditem_key $variant description] 0]
     352        if {![info exists variantname] || $variantname == ""} {
     353            ui_error "Variant number $variantnumber does not have a name"
     354            incr errors
     355        } elseif {![info exists variantdesc] || $variantdesc == ""} {
     356            ui_info "OK: Found variant: $variantname"
     357            # don't warn about missing descriptions for global variants
     358            if {[lsearch -exact $local_variants $variantname] != -1 &&
     359                [lsearch -exact $lint_variants $variantname] == -1} {
     360                ui_warn "Variant $variantname does not have a description"
     361                incr warnings
     362            }
     363        } else {
     364            ui_info "OK: Found variant $variantname: $variantdesc"
     365        }
     366        incr variantnumber
     367    }
     368
    331369    if {[string match "*darwinports@opendarwin.org*" $maintainers]} {
    332370        ui_warn "Using legacy email for no/open maintainer"
Note: See TracChangeset for help on using the changeset viewer.