Merge "Improve checking for modified files"
This commit is contained in:
commit
9596bcd5c9
@ -415,11 +415,25 @@ def build_affected_books(rootdir, book_exceptions, file_exceptions,
|
||||
|
||||
os.chdir(root)
|
||||
|
||||
# We can scan only for depth of one of inclusion
|
||||
# therefore skip the common directory since there's no
|
||||
# book build in it.
|
||||
if not root.endswith('doc/common'):
|
||||
for f in files:
|
||||
if (f.endswith('.xml') and
|
||||
f != 'pom.xml' and
|
||||
f not in file_exceptions):
|
||||
path = os.path.abspath(os.path.join(root, f))
|
||||
# If the file itself is modified, build the book
|
||||
if path in modified_files:
|
||||
affected_books.append(book_root)
|
||||
break
|
||||
|
||||
# If the file itself is modified, build the book.
|
||||
# Note this is an optimization in most cases but
|
||||
# needed for bk-*.xml since those are included by
|
||||
# pom.xml and pom.xml is not checked for
|
||||
# modification of included files.
|
||||
doc = etree.parse(path)
|
||||
|
||||
# Check for inclusion of files as part of imagedata
|
||||
@ -478,7 +492,7 @@ def build_affected_books(rootdir, book_exceptions, file_exceptions,
|
||||
|
||||
if voting and any_failures:
|
||||
sys.exit(1)
|
||||
|
||||
print("Building finished.")
|
||||
|
||||
def main(args):
|
||||
|
||||
|
@ -407,11 +407,28 @@ def build_affected_books(rootdir, book_exceptions, file_exceptions, force):
|
||||
|
||||
os.chdir(root)
|
||||
|
||||
# We can scan only for depth of one of inclusion
|
||||
# therefore skip the common directory since there's no
|
||||
# book build in it.
|
||||
if not root.endswith('doc/common'):
|
||||
for f in files:
|
||||
if (f.endswith('.xml') and
|
||||
f != 'pom.xml' and
|
||||
f not in file_exceptions):
|
||||
path = os.path.abspath(os.path.join(root, f))
|
||||
|
||||
# If the file itself is modified, build the book.
|
||||
# Note this is an optimization in most cases but
|
||||
# needed for bk-*.xml since those are included by
|
||||
# pom.xml and pom.xml is not checked for
|
||||
# modification of included files.
|
||||
if path in modified_files:
|
||||
affected_books.append(book_root)
|
||||
break
|
||||
|
||||
# Now check whether the file includes a file that
|
||||
# was modified (scanning one level only)
|
||||
|
||||
doc = etree.parse(path)
|
||||
|
||||
# Check for inclusion of files as part of imagedata
|
||||
@ -469,6 +486,7 @@ def build_affected_books(rootdir, book_exceptions, file_exceptions, force):
|
||||
print("\n%s" % output)
|
||||
if any_failures:
|
||||
sys.exit(1)
|
||||
print("Building finished.")
|
||||
|
||||
|
||||
def main(rootdir, force, verbose):
|
||||
|
Loading…
Reference in New Issue
Block a user