Merge "take care of books with sources in subdirectories"
This commit is contained in:
commit
4e57235d2e
13
validate.py
13
validate.py
|
@ -226,11 +226,16 @@ def build_affected_books(rootdir, book_exceptions, file_exceptions, force):
|
|||
modified_files = map(lambda x: os.path.abspath(x), modified_files)
|
||||
affected_books = []
|
||||
books = []
|
||||
book_root = rootdir
|
||||
for root, dirs, files in os.walk(rootdir):
|
||||
if ("pom.xml" in files and
|
||||
os.path.basename(root) not in book_exceptions):
|
||||
if os.path.basename(root) in book_exceptions:
|
||||
break
|
||||
elif "pom.xml" in files:
|
||||
books.append(root)
|
||||
book_root = root
|
||||
|
||||
os.chdir(root)
|
||||
|
||||
for f in files:
|
||||
if (f.endswith('.xml') and
|
||||
f != 'pom.xml' and
|
||||
|
@ -243,9 +248,9 @@ def build_affected_books(rootdir, book_exceptions, file_exceptions, force):
|
|||
if (href.endswith('.xml') and
|
||||
f not in file_exceptions and
|
||||
os.path.abspath(href) in modified_files):
|
||||
affected_books.append(root)
|
||||
affected_books.append(book_root)
|
||||
break
|
||||
if root in affected_books:
|
||||
if book_root in affected_books:
|
||||
break
|
||||
|
||||
if not force and affected_books:
|
||||
|
|
Loading…
Reference in New Issue