summaryrefslogtreecommitdiff
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.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:
13 g_models.append({'mid': int(mid, 0), 'name': name}) 13 g_models.append({'mid': int(mid, 0), 'name': name})
14# parse series.txt 14# parse series.txt
15g_series = [] 15g_series = []
16g_series_codename = set()
16with open('series.txt') as fp: 17with open('series.txt') as fp:
17 for line in fp: 18 for line in fp:
18 # we unpack and repack 1) to make the format obvious 2) to catch errors 19 # we unpack and repack 1) to make the format obvious 2) to catch errors
@@ -25,6 +26,7 @@ with open('series.txt') as fp:
25 models = [] 26 models = []
26 models = [int(mid,0) for mid in models] 27 models = [int(mid,0) for mid in models]
27 g_series.append({'codename': codename, 'name': name, 'models': models}) 28 g_series.append({'codename': codename, 'name': name, 'models': models})
29 g_series_codename.add(codename)
28# parse all maps in nvp/ 30# parse all maps in nvp/
29# since most nvps are the same, what we actually do is to compute the md5sum hash 31# since most nvps are the same, what we actually do is to compute the md5sum hash
30# of all files, to identify groups and then each entry in the name is in fact the 32# 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
38 continue 40 continue
39 hash, file = line.rstrip().split() 41 hash, file = line.rstrip().split()
40 codename = re.search('nvp/(.*)\.txt', file).group(1) 42 codename = re.search('nvp/(.*)\.txt', file).group(1)
43 # sanity check
44 if not (codename in g_series_codename):
45 print("Warning: file %s does not have a match series in series.txt" % file)
41 hash = hash[:HASH_SIZE] 46 hash = hash[:HASH_SIZE]
42 # only keep one file 47 # only keep one file
43 if not (hash in g_hash_nvp): 48 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] =
1144 { "nw-s780", "NW-S780 Series", 4, models_nw_s780, &nvp_index_6485c8 }, 1144 { "nw-s780", "NW-S780 Series", 4, models_nw_s780, &nvp_index_6485c8 },
1145 { "nw-wm1", "NW-WM1 Series", 2, models_nw_wm1, &nvp_index_398250 }, 1145 { "nw-wm1", "NW-WM1 Series", 2, models_nw_wm1, &nvp_index_398250 },
1146 { "nwz-x1000", "NWZ-X1000 Series", 9, models_nwz_x1000, 0 }, 1146 { "nwz-x1000", "NWZ-X1000 Series", 9, models_nwz_x1000, 0 },
1147 { "nw-zx100", "NW-ZX100 Series", 6, models_nw_zx100, 0 }, 1147 { "nw-zx100", "NW-ZX100 Series", 6, models_nw_zx100, &nvp_index_92faee },
1148 { "nwz-noname", "NONAME", 3, models_nwz_noname, 0 }, 1148 { "nwz-noname", "NONAME", 3, models_nwz_noname, 0 },
1149}; 1149};