From d72a93836cc63272098d56da4fbc33c1924437d1 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Fri, 29 May 2026 23:34:53 -0400 Subject: [PATCH] nwztools: Update database generator script to work with python3 Change-Id: I662de90b57a3836755b88ff51537eb1597f226f4 --- .gitignore | 1 + utils/nwztools/database/gen_db.py | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index 581cfbaa98..46953989eb 100644 --- a/.gitignore +++ b/.gitignore @@ -193,6 +193,7 @@ __pycache__ # /utils/nwztools /utils/nwztools/scsitools/scsitool /utils/nwztools/upgtools/upgtool +/utils/nwztools/emmctools/emmctool # utils/rk27utils /utils/rk27utils/rkboottool/rkboottool diff --git a/utils/nwztools/database/gen_db.py b/utils/nwztools/database/gen_db.py index 9e8bc89102..c7cb1dcb98 100755 --- a/utils/nwztools/database/gen_db.py +++ b/utils/nwztools/database/gen_db.py @@ -51,7 +51,7 @@ for f in map_files: h = hashlib.md5() h.update(open(f, "rb").read()) hash = h.hexdigest() - codename = re.search('nvp/([^\.]*)\.txt', f).group(1) + codename = re.search('nvp/([^\\.]*)\\.txt', f).group(1) # sanity check if not (codename in g_series_codename): print("Warning: file %s does not have a match series in series.txt" % f) @@ -133,11 +133,11 @@ header_begin = \ """\ /*************************************************************************** * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \\ - * \/ \/ \/ \/ \/ + * Open \\______ \\ ____ ____ | | _\\_ |__ _______ ___ + * Source | _// _ \\_/ ___\\| |/ /| __ \\ / _ \\ \\/ / + * Jukebox | | ( <_> ) \\___| < | \\_\\ ( <_> > < < + * Firmware |____|_ /\\____/ \\___ >__|_ \\|___ /\\____/__/\\_ \\ + * \\/ \\/ \\/ \\/ \\/ * * Copyright (C) 2016 Amaury Pouly * @@ -153,7 +153,7 @@ header_begin = \ #ifndef __NWZ_DB_H__ #define __NWZ_DB_H__ -/** /!\ This file was automatically generated, DO NOT MODIFY IT DIRECTLY /!\ */ +/** /!\\ This file was automatically generated, DO NOT MODIFY IT DIRECTLY /!\\ */ /* List of all known NVP nodes */ enum nwz_nvp_node_t @@ -232,11 +232,11 @@ impl_begin = \ """\ /*************************************************************************** * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \\ - * \/ \/ \/ \/ \/ + * Open \\______ \\ ____ ____ | | _\\_ |__ _______ ___ + * Source | _// _ \\_/ ___\\| |/ /| __ \\ / _ \\ \\/ / + * Jukebox | | ( <_> ) \\___| < | \\_\\ ( <_> > < < + * Firmware |____|_ /\\____/ \\___ >__|_ \\|___ /\\____/__/\\_ \\ + * \\/ \\/ \\/ \\/ \\/ * * Copyright (C) 2016 Amaury Pouly * @@ -250,7 +250,7 @@ impl_begin = \ * ****************************************************************************/ -/** /!\ This file was automatically generated, DO NOT MODIFY IT DIRECTLY /!\ */ +/** /!\\ This file was automatically generated, DO NOT MODIFY IT DIRECTLY /!\\ */ #include "nwz-db.h"