Ticket #48680: port-lint-add-option-to-disable-parent-dirs-checks.diff

File port-lint-add-option-to-disable-parent-dirs-checks.diff, 2.6 KB (added by xuchunyang (Chunyang Xu), 9 years ago)
  • src/port/port.tcl

     
    44124412    variants    {index}
    44134413    clean       {all archive dist work logs}
    44144414    mirror      {new}
    4415     lint        {nitpick}
     4415    lint        {nitpick nodir}
    44164416    select      {list set show summary}
    44174417    log         {{phase 1} {level 1}}
    44184418    upgrade     {force enforce-variants no-replace no-rev-upgrade}
  • src/port1.0/portlint.tcl

     
    123123}
    124124
    125125proc portlint::lint_main {args} {
    126     global UI_PREFIX name portpath porturl ports_lint_nitpick
     126    global UI_PREFIX name portpath porturl ports_lint_nitpick ports_lint_nodir
    127127    set portfile ${portpath}/Portfile
    128128    set portdirs [split ${portpath} /]
    129129    set last [llength $portdirs]
     
    144144        set nitpick false
    145145    }
    146146
     147    if {[info exists ports_lint_nodir] && $ports_lint_nodir eq "yes"} {
     148        set nodir true
     149    } else {
     150        set nodir false
     151    }
     152
    147153    set topline_number 1
    148154    set require_blank false
    149155    set require_after ""
     
    658664
    659665    }
    660666
    661     # these checks are only valid for ports stored in the regular tree directories
    662     if {[info exists category] && $portcatdir != $category} {
    663         ui_error "Portfile parent directory $portcatdir does not match primary category $category"
    664         incr errors
    665     } else {
    666         ui_info "OK: Portfile parent directory matches primary category"
     667    if !{$nodir} {
     668        # these checks are only valid for ports stored in the regular tree directories
     669        if {[info exists category] && $portcatdir != $category} {
     670            ui_error "Portfile parent directory $portcatdir does not match primary category $category"
     671            incr errors
     672        } else {
     673            ui_info "OK: Portfile parent directory matches primary category"
     674        }
     675        if {$portdir != $name} {
     676            ui_error "Portfile directory $portdir does not match port name $name"
     677            incr errors
     678        } else {
     679            ui_info "OK: Portfile directory matches port name"
     680        }
    667681    }
    668     if {$portdir != $name} {
    669         ui_error "Portfile directory $portdir does not match port name $name"
    670         incr errors
    671     } else {
    672         ui_info "OK: Portfile directory matches port name"
    673     }
    674682
    675683    if {$nitpick && [info exists patchfiles]} {
    676684        foreach patchfile $patchfiles {