Revision: 139518 https://trac.macports.org/changeset/139518 Author: chunyang@macports.org Date: 2015-08-19 13:06:54 -0700 (Wed, 19 Aug 2015) Log Message: ----------- base: Add --nodir option to port-lint for disabling parent directory check Modified Paths: -------------- branches/gsoc15-portfile/base/src/port/port.tcl branches/gsoc15-portfile/base/src/port1.0/portlint.tcl Modified: branches/gsoc15-portfile/base/src/port/port.tcl =================================================================== --- branches/gsoc15-portfile/base/src/port/port.tcl 2015-08-19 19:45:07 UTC (rev 139517) +++ branches/gsoc15-portfile/base/src/port/port.tcl 2015-08-19 20:06:54 UTC (rev 139518) @@ -4412,7 +4412,7 @@ variants {index} clean {all archive dist work logs} mirror {new} - lint {nitpick} + lint {nitpick nodir} select {list set show summary} log {{phase 1} {level 1}} upgrade {force enforce-variants no-replace no-rev-upgrade} Modified: branches/gsoc15-portfile/base/src/port1.0/portlint.tcl =================================================================== --- branches/gsoc15-portfile/base/src/port1.0/portlint.tcl 2015-08-19 19:45:07 UTC (rev 139517) +++ branches/gsoc15-portfile/base/src/port1.0/portlint.tcl 2015-08-19 20:06:54 UTC (rev 139518) @@ -123,7 +123,7 @@ } proc portlint::lint_main {args} { - global UI_PREFIX name portpath porturl ports_lint_nitpick + global UI_PREFIX name portpath porturl ports_lint_nitpick ports_lint_nodir set portfile ${portpath}/Portfile set portdirs [split ${portpath} /] set last [llength $portdirs] @@ -144,6 +144,12 @@ set nitpick false } + if {[info exists ports_lint_nodir] && $ports_lint_nodir eq "yes"} { + set nodir true + } else { + set nodir false + } + set topline_number 1 set require_blank false set require_after "" @@ -658,19 +664,21 @@ } - # these checks are only valid for ports stored in the regular tree directories - # if {[info exists category] && $portcatdir != $category} { - # ui_error "Portfile parent directory $portcatdir does not match primary category $category" - # incr errors - # } else { - # ui_info "OK: Portfile parent directory matches primary category" - # } - # if {$portdir != $name} { - # ui_error "Portfile directory $portdir does not match port name $name" - # incr errors - # } else { - # ui_info "OK: Portfile directory matches port name" - # } + if !{$nodir} { + # these checks are only valid for ports stored in the regular tree directories + if {[info exists category] && $portcatdir != $category} { + ui_error "Portfile parent directory $portcatdir does not match primary category $category" + incr errors + } else { + ui_info "OK: Portfile parent directory matches primary category" + } + if {$portdir != $name} { + ui_error "Portfile directory $portdir does not match port name $name" + incr errors + } else { + ui_info "OK: Portfile directory matches port name" + } + } if {$nitpick && [info exists patchfiles]} { foreach patchfile $patchfiles {
participants (1)
-
chunyang@macports.org