Lines 324-336
Link Here
|
324 |
def extractFilename(path): |
324 |
def extractFilename(path): |
325 |
return path |
325 |
return path |
326 |
|
326 |
|
327 |
def runTests(tests,results,ins): |
327 |
def runTests(tests,results,ins,recurse = 0,seen_base_classes=[]): |
328 |
for j in tests: |
328 |
inh_re = re.compile("^inherit (.*)") |
329 |
j.reset() |
|
|
330 |
|
329 |
|
331 |
for i in ins.readlines(): |
330 |
# don't reset things if we're an included parent class |
|
|
331 |
if recurse == 0: |
332 |
for j in tests: |
332 |
for j in tests: |
333 |
j.checkLine(i) |
333 |
j.reset() |
|
|
334 |
|
335 |
for i in ins.readlines(): |
336 |
|
337 |
# check to see if this is an inherit instruction |
338 |
# if it is, recurse into this function |
339 |
# this causes the "include" behavior |
340 |
inh = inh_re.match(i); |
341 |
if inh: |
342 |
base_classes = inh.group(1).split(" ") |
343 |
for base_class in base_classes: |
344 |
# make sure we haven't seen this guy before |
345 |
# i don't think we should include things twice |
346 |
# should this ever even happen? |
347 |
ok_to_include = 1 |
348 |
for already_seen in seen_base_classes: |
349 |
if base_class == already_seen: |
350 |
ok_to_include = 0 |
351 |
|
352 |
if ok_to_include == 1: |
353 |
inh_file = open("/usr/portage/eclass/" + base_class + ".eclass","r") |
354 |
seen_base_classes.append(base_class) |
355 |
runTests(tests,results,inh_file,1,seen_base_classes) |
356 |
#else: |
357 |
# print "NOT RE-INHERITING: " + base_class |
358 |
|
359 |
# or maybe this is a regular line. if so just parse it |
360 |
else: |
361 |
for j in tests: |
362 |
j.checkLine(i) |
363 |
|
364 |
# bug out if we're just an included parent class |
365 |
if recurse == 1: |
366 |
return |
334 |
|
367 |
|
335 |
hasWarning = 0 |
368 |
hasWarning = 0 |
336 |
hasError = 0 |
369 |
hasError = 0 |