Module: Mesa
Branch: main
Commit: d8038c8d096f968e61edbb6b5501f7ef382a011e
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=d8038c8d096f968e61edbb6b5501f7ef382a011e

Author: Jordan Justen <[email protected]>
Date:   Tue Aug 15 15:26:34 2023 -0700

intel/genxml: Ignore tail leading/trailing whitespace in node_validator()

When importing or flattening genxml with the genxml_import.py script
in MR !20593, it can lead to the tail portion of xml items differing
in whitespace.

If we strip the trailing and leading whitespace from the tail string,
and the strings are equivalent, then we can consider the xml items to
be equivalent.

Signed-off-by: Jordan Justen <[email protected]>
Reviewed-by: Lionel Landwerlin <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24903>

---

 src/intel/genxml/intel_genxml.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/intel/genxml/intel_genxml.py b/src/intel/genxml/intel_genxml.py
index 64a7a7967f6..21fe15952e5 100755
--- a/src/intel/genxml/intel_genxml.py
+++ b/src/intel/genxml/intel_genxml.py
@@ -105,7 +105,7 @@ def node_validator(old: et.Element, new: et.Element) -> 
bool:
         # Check that the attributes are the same
         old.tag == new.tag and
         old.text == new.text and
-        old.tail == new.tail and
+        (old.tail or "").strip() == (new.tail or "").strip() and
         list(old.attrib.items()) == list(new.attrib.items()) and
         len(old) == len(new) and
 

Reply via email to