Check also for non-xml include files

Check for any type of include file, not just xml files.

Change-Id: I1290ee317b7b7787e16f204c9780f0811773ff8f
This commit is contained in:
Andreas Jaeger 2013-09-17 18:50:31 +02:00
parent f31335a707
commit 24036dc150
2 changed files with 4 additions and 8 deletions

View File

@ -202,8 +202,7 @@ def check_deleted_files(rootdir, file_exceptions):
ns = {"xi": "http://www.w3.org/2001/XInclude"}
for node in doc.xpath('//xi:include', namespaces=ns):
href = node.get('href')
if (href.endswith('.xml') and
os.path.abspath(href) in deleted_files):
if (os.path.abspath(href) in deleted_files):
print(" File %s has an xi:include on deleted file %s " % (f, href))
missing_reference = True
if missing_reference:
@ -321,8 +320,7 @@ def build_affected_books(rootdir, book_exceptions, file_exceptions, force=False,
ns = {"xi": "http://www.w3.org/2001/XInclude"}
for node in doc.xpath('//xi:include', namespaces=ns):
href = node.get('href')
if (href.endswith('.xml') and
f not in file_exceptions and
if (f not in file_exceptions and
os.path.abspath(href) in modified_files):
affected_books.append(book_root)
break

View File

@ -205,8 +205,7 @@ def check_deleted_files(rootdir, file_exceptions):
ns = {"xi": "http://www.w3.org/2001/XInclude"}
for node in doc.xpath('//xi:include', namespaces=ns):
href = node.get('href')
if (href.endswith('.xml') and
os.path.abspath(href) in deleted_files):
if (os.path.abspath(href) in deleted_files):
print(" File %s has an xi:include on deleted file %s " % (f, href))
missing_reference = True
if missing_reference:
@ -322,8 +321,7 @@ def build_affected_books(rootdir, book_exceptions, file_exceptions, force):
ns = {"xi": "http://www.w3.org/2001/XInclude"}
for node in doc.xpath('//xi:include', namespaces=ns):
href = node.get('href')
if (href.endswith('.xml') and
f not in file_exceptions and
if (f not in file_exceptions and
os.path.abspath(href) in modified_files):
affected_books.append(book_root)
break