summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2017-01-09 21:48:43 +0100
committerAmaury Pouly <amaury.pouly@gmail.com>2017-01-09 21:48:43 +0100
commit90284b6fe0e5ba89fe63943212bfd7ffc3e96d47 (patch)
treea8fb4291b53849568b4b4d6c581d4632773dd04a /utils
parent1d7b37eda1fe475a76b8c3be1cc21fe3e893ad17 (diff)
downloadrockbox-90284b6fe0e5ba89fe63943212bfd7ffc3e96d47.tar.gz
rockbox-90284b6fe0e5ba89fe63943212bfd7ffc3e96d47.tar.bz2
rockbox-90284b6fe0e5ba89fe63943212bfd7ffc3e96d47.zip
nwztools: fix typo (nwz-zx100 -> nw-zx100)
Also now gen_db.py can check for such mismatch Change-Id: I4d91aae0dde08c866eda2ed5da3c11431c46e06a
Diffstat (limited to 'utils')
-rwxr-xr-xutils/nwztools/database/gen_db.py5
-rw-r--r--utils/nwztools/database/nvp/nodes-nw-zx100.txt (renamed from utils/nwztools/database/nvp/nodes-nwz-zx100.txt)0
-rw-r--r--utils/nwztools/database/nvp/nw-zx100.txt (renamed from utils/nwztools/database/nvp/nwz-zx100.txt)0
-rw-r--r--utils/nwztools/database/nwz_db.c2
4 files changed, 6 insertions, 1 deletions
diff --git a/utils/nwztools/database/gen_db.py b/utils/nwztools/database/gen_db.py
index cf1423f2a5..8b7d1cbaaf 100755
--- a/utils/nwztools/database/gen_db.py
+++ b/utils/nwztools/database/gen_db.py
@@ -13,6 +13,7 @@ with open('models.txt') as fp:
g_models.append({'mid': int(mid, 0), 'name': name})
# parse series.txt
g_series = []
+g_series_codename = set()
with open('series.txt') as fp:
for line in fp:
# we unpack and repack 1) to make the format obvious 2) to catch errors
@@ -25,6 +26,7 @@ with open('series.txt') as fp:
models = []
models = [int(mid,0) for mid in models]
g_series.append({'codename': codename, 'name': name, 'models': models})
+ g_series_codename.add(codename)
# parse all maps in nvp/
# since most nvps are the same, what we actually do is to compute the md5sum hash
# of all files, to identify groups and then each entry in the name is in fact the
@@ -38,6 +40,9 @@ for line in subprocess.run(["md5sum"] + map_files, stdout = subprocess.PIPE).std
continue
hash, file = line.rstrip().split()
codename = re.search('nvp/(.*)\.txt', file).group(1)
+ # sanity check
+ if not (codename in g_series_codename):
+ print("Warning: file %s does not have a match series in series.txt" % file)
hash = hash[:HASH_SIZE]
# only keep one file
if not (hash in g_hash_nvp):
diff --git a/utils/nwztools/database/nvp/nodes-nwz-zx100.txt b/utils/nwztools/database/nvp/nodes-nw-zx100.txt
index 2beb185b6c..2beb185b6c 100644
--- a/utils/nwztools/database/nvp/nodes-nwz-zx100.txt
+++ b/utils/nwztools/database/nvp/nodes-nw-zx100.txt
diff --git a/utils/nwztools/database/nvp/nwz-zx100.txt b/utils/nwztools/database/nvp/nw-zx100.txt
index e7ed5a0bd4..e7ed5a0bd4 100644
--- a/utils/nwztools/database/nvp/nwz-zx100.txt
+++ b/utils/nwztools/database/nvp/nw-zx100.txt
diff --git a/utils/nwztools/database/nwz_db.c b/utils/nwztools/database/nwz_db.c
index 4edbb2e1c2..d5c226203b 100644
--- a/utils/nwztools/database/nwz_db.c
+++ b/utils/nwztools/database/nwz_db.c
@@ -1144,6 +1144,6 @@ struct nwz_series_info_t nwz_series[NWZ_SERIES_COUNT] =
{ "nw-s780", "NW-S780 Series", 4, models_nw_s780, &nvp_index_6485c8 },
{ "nw-wm1", "NW-WM1 Series", 2, models_nw_wm1, &nvp_index_398250 },
{ "nwz-x1000", "NWZ-X1000 Series", 9, models_nwz_x1000, 0 },
- { "nw-zx100", "NW-ZX100 Series", 6, models_nw_zx100, 0 },
+ { "nw-zx100", "NW-ZX100 Series", 6, models_nw_zx100, &nvp_index_92faee },
{ "nwz-noname", "NONAME", 3, models_nwz_noname, 0 },
};