diff options
-rwxr-xr-x | utils/nwztools/database/gen_db.py | 5 | ||||
-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.c | 2 |
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 |
15 | g_series = [] | 15 | g_series = [] |
16 | g_series_codename = set() | ||
16 | with open('series.txt') as fp: | 17 | with 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 | }; |