[U-Boot] moveconfig.py: Fix more Python3 UTF issues
diff mbox series

Message ID 20191111021937.20036-1-trini@konsulko.com
State Accepted
Commit 02b5670e65ae28d01dd8883968a2feddb77095b2
Delegated to: Tom Rini
Headers show
Series
  • [U-Boot] moveconfig.py: Fix more Python3 UTF issues
Related show

Commit Message

Tom Rini Nov. 11, 2019, 2:19 a.m. UTC
With the move to using Python 3 for real, we encounter two different
issues.  First, the file include/video_font_data.h includes at least one
UTF-16 character.  Given that it does not include any CONFIG symbols it
is easiest to just ignore this file.  Next, we encounter similar
problems with some dts/dtsi files that come from Linux.  In this case
it's easiest to simply ignore all dts/dtsi files as there will not be
CONFIG symbols for us to migrate in them.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
---
 tools/moveconfig.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Tom Rini Nov. 24, 2019, 2:56 p.m. UTC | #1
On Sun, Nov 10, 2019 at 09:19:37PM -0500, Tom Rini wrote:

> With the move to using Python 3 for real, we encounter two different
> issues.  First, the file include/video_font_data.h includes at least one
> UTF-16 character.  Given that it does not include any CONFIG symbols it
> is easiest to just ignore this file.  Next, we encounter similar
> problems with some dts/dtsi files that come from Linux.  In this case
> it's easiest to simply ignore all dts/dtsi files as there will not be
> CONFIG symbols for us to migrate in them.
> 
> Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
> Signed-off-by: Tom Rini <trini@konsulko.com>

Applied to u-boot/master, thanks!

Patch
diff mbox series

diff --git a/tools/moveconfig.py b/tools/moveconfig.py
index e2ff4cfc88b2..36160a397726 100755
--- a/tools/moveconfig.py
+++ b/tools/moveconfig.py
@@ -667,8 +667,11 @@  def cleanup_headers(configs, options):
             if dirpath == os.path.join('include', 'generated'):
                 continue
             for filename in filenames:
-                if not fnmatch.fnmatch(filename, '*~'):
+                if not filename.endswith(('~', '.dts', '.dtsi')):
                     header_path = os.path.join(dirpath, filename)
+                    # This file contains UTF-16 data and no CONFIG symbols
+                    if header_path == 'include/video_font_data.h':
+                        continue
                     cleanup_one_header(header_path, patterns, options)
                     cleanup_empty_blocks(header_path, options)