Ticket #28640: portlint2.diff
File portlint2.diff, 2.5 KB (added by kurthindenburg (Kurt Hindenburg), 10 years ago) |
---|
-
portlint.tcl
154 154 array set portgroups {} 155 155 156 156 set local_variants [list] 157 set local_dependstypes [list] 157 158 158 159 set f [open $portfile RDONLY] 159 160 # read binary (to check UTF-8) … … 331 332 332 333 ### TODO: more checks to Portfile syntax 333 334 335 # If portfile uses PortGroup, check current portfile for any depends_* without 336 # -append. If so, save them for later. 337 if ($seen_portgroup) { 338 if {[regexp {^(?:\s*)depends_([a-z]+)(.)(?:.*)} $line -> dependtype haveappend]} { 339 if {$haveappend ne "-"} { 340 lappend local_dependstypes $dependtype 341 } 342 } 343 } 344 334 345 incr lineno 335 346 } 336 347 … … 357 368 if ($seen_portgroup) { 358 369 # Using a PortGroup is optional 359 370 foreach {portgroup portgroupversion} [array get portgroups] { 360 if {![file exists [getportresourcepath $porturl "port1.0/group/${portgroup}-${portgroupversion}.tcl"]]} { 371 set portfile [getportresourcepath $porturl "port1.0/group/${portgroup}-${portgroupversion}.tcl"] 372 if {![file exists $portfile]} { 361 373 ui_error "Unknown PortGroup: $portgroup-$portgroupversion" 362 374 incr errors 363 375 } else { 364 376 ui_info "OK: Found PortGroup $portgroup-$portgroupversion" 377 378 # Determine if PortGroup has any depends_* matching local Portfile's 379 set f [open $portfile RDONLY] 380 while {1} { 381 set line [gets $f] 382 # Does depends_*-append in PortGroups make a difference to whether a port should use -append? 383 if {[regexp {^(?:\s*)depends_([a-z]+)(.)(?:.*)} $line -> dependtype haveappend]} { 384 if {[lsearch -exact $local_dependstypes $dependtype] >= 0} { 385 ui_error "PortGroup $portgroup uses depends_$dependtype, so use depends_$dependtype-append" 386 # Remove this dependtype to avoid duplicate messages 387 set local_dependstypes [lsearch -all -inline -not -exact $local_dependstypes $dependtype] 388 incr errors 389 } 390 } 391 if {[eof $f]} { 392 close $f 393 break 394 } 395 } 365 396 } 366 397 } 367 398 }