[30996] trunk/base/src/port1.0/portlint.tcl
source_changes at macosforge.org
source_changes at macosforge.org
Tue Nov 13 03:38:09 PST 2007
Revision: 30996
http://trac.macosforge.org/projects/macports/changeset/30996
Author: afb at macports.org
Date: 2007-11-13 03:38:08 -0800 (Tue, 13 Nov 2007)
Log Message:
-----------
check Portfile directory against primary category (#13263)
Modified Paths:
--------------
trunk/base/src/port1.0/portlint.tcl
Modified: trunk/base/src/port1.0/portlint.tcl
===================================================================
--- trunk/base/src/port1.0/portlint.tcl 2007-11-13 11:29:15 UTC (rev 30995)
+++ trunk/base/src/port1.0/portlint.tcl 2007-11-13 11:38:08 UTC (rev 30996)
@@ -143,6 +143,10 @@
proc lint_main {args} {
global UI_PREFIX portname portpath portresourcepath
set portfile ${portpath}/Portfile
+ set portdirs [split ${portpath} /]
+ set last [llength $portdirs]
+ incr last -2
+ set portdir [lindex $portdirs $last]
set groupdir ${portresourcepath}/group
set warnings 0
@@ -343,12 +347,18 @@
if {[info exists categories]} {
set category [lindex $categories 0]
- if {[lsearch -exact $lint_categories $category] == -1} {
- ui_error "Unknown category: $category"
- incr errors
- } else {
- ui_info "OK: Found category: $category"
+ if {[lsearch -exact $lint_categories $category] == -1} {
+ ui_error "Unknown category: $category"
+ incr errors
+ } else {
+ ui_info "OK: Found category: $category"
+ }
+ foreach secondary $categories {
+ if {[string match $secondary $category]} {
+ continue
}
+ ui_info "OK: Found category: $secondary"
+ }
}
if {![string is integer -strict $portepoch]} {
@@ -392,6 +402,14 @@
incr warnings
}
+ # this check is only valid for ports stored in the regular tree directories
+ if {$portdir != $category} {
+ ui_error "Portfile directory $portdir does not match primary category $category"
+ incr errors
+ } else {
+ ui_info "OK: Portfile directory matches primary category"
+ }
+
if {[info exists patchfiles]} {
foreach patchfile $patchfiles {
if {![string match "patch-*.diff" $patchfile]} {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20071113/592f1516/attachment.html
More information about the macports-changes
mailing list