diff -r 7cee158cb8cd -r 26b2b12093af build/buildutils/checkjavapackages.py --- a/build/buildutils/checkjavapackages.py Wed Sep 15 12:05:25 2010 +0300 +++ b/build/buildutils/checkjavapackages.py Wed Oct 13 14:23:59 2010 +0300 @@ -16,17 +16,13 @@ # Checks that all the java source files declare a package and that # the directory within a java source file is located corresponds # properly to the package. -# -# Ignores tsrc directories unless the option -all is given. import sys, os, re def main(): - root = sys.argv[1] - all = len(sys.argv) > 2 and sys.argv[2] == '-all' - + files = [] # Create a reg exp matching to "package x.y.z;" with whitespace ignored regex = re.compile("\\s*package\\s*([\\w.]*);.*", re.IGNORECASE) @@ -35,12 +31,8 @@ # Skip SVN directories if dirname.find("\\.svn") != -1: - return + return names - # Skip tsrc - if not all and dirname.find("\\tsrc") != -1: - return - for f in names: if not f.endswith(".java"): continue @@ -71,7 +63,7 @@ except IOError: print "Error reading the file " + fname - os.path.walk(sys.argv[1], visitFun, None) + os.path.walk(sys.argv[1], visitFun, files) if __name__ == "__main__":