Don't descent into target dirs

build_affected_books failed on my system due to an invalid target/..xml
file.

Don't descend into "target" subdirectories for determining which books
are affected.

Change-Id: Iaadaacd26f3e3542c6de55bff52f871404ba9c11
This commit is contained in:
Andreas Jaeger 2013-08-28 19:36:13 +02:00
parent dc09e993f0
commit 626ac81f0e
1 changed files with 7 additions and 0 deletions

View File

@ -228,6 +228,13 @@ def build_affected_books(rootdir, book_exceptions, file_exceptions, force):
books = []
book_root = rootdir
for root, dirs, files in os.walk(rootdir):
# Don't descend into 'target' subdirectories
try:
ind = dirs.index('target')
del dirs[ind]
except ValueError:
pass
if os.path.basename(root) in book_exceptions:
break
elif "pom.xml" in files: