--- /usr/bin/lintool 2002-10-27 15:54:51.000000000 -0600 +++ /tmp/lintool 2002-10-27 16:52:33.000000000 -0600 @@ -324,13 +324,46 @@ def extractFilename(path): return path -def runTests(tests,results,ins): - for j in tests: - j.reset() +def runTests(tests,results,ins,recurse = 0,seen_base_classes=[]): + inh_re = re.compile("^inherit (.*)") - for i in ins.readlines(): + # don't reset things if we're an included parent class + if recurse == 0: for j in tests: - j.checkLine(i) + j.reset() + + for i in ins.readlines(): + + # check to see if this is an inherit instruction + # if it is, recurse into this function + # this causes the "include" behavior + inh = inh_re.match(i); + if inh: + base_classes = inh.group(1).split(" ") + for base_class in base_classes: + # make sure we haven't seen this guy before + # i don't think we should include things twice + # should this ever even happen? + ok_to_include = 1 + for already_seen in seen_base_classes: + if base_class == already_seen: + ok_to_include = 0 + + if ok_to_include == 1: + inh_file = open("/usr/portage/eclass/" + base_class + ".eclass","r") + seen_base_classes.append(base_class) + runTests(tests,results,inh_file,1,seen_base_classes) + #else: + # print "NOT RE-INHERITING: " + base_class + + # or maybe this is a regular line. if so just parse it + else: + for j in tests: + j.checkLine(i) + + # bug out if we're just an included parent class + if recurse == 1: + return hasWarning = 0 hasError = 0