diff options
| author | Amaury Pouly <amaury.pouly@gmail.com> | 2017-01-04 16:26:07 +0100 |
|---|---|---|
| committer | Gerrit Rockbox <gerrit@rockbox.org> | 2017-01-04 17:03:14 +0100 |
| commit | 3c3e133f99f38f9746df7c51ded6671ffa987504 (patch) | |
| tree | 9b5763c18c9e0d430aadd8ba8b0126eb8907a836 /utils | |
| parent | d7770a1cddeb94826046b9c58107f967e5462810 (diff) | |
| download | rockbox-3c3e133f99f38f9746df7c51ded6671ffa987504.zip rockbox-3c3e133f99f38f9746df7c51ded6671ffa987504.tar.gz rockbox-3c3e133f99f38f9746df7c51ded6671ffa987504.tar.bz2 rockbox-3c3e133f99f38f9746df7c51ded6671ffa987504.tar.xz | |
nwztools: small fixes
Make sure scripts use bash, make nwz database generator more deterministic
Change-Id: I26812b697abe0406fb3c60d6eb231cb27edc81d5
Diffstat (limited to 'utils')
| -rwxr-xr-x | utils/nwztools/database/gen_db.py | 6 | ||||
| -rwxr-xr-x | utils/nwztools/database/nvp/parse_all_nvp_headers.sh | 2 | ||||
| -rwxr-xr-x | utils/nwztools/database/nvp/parse_all_nvp_nodes.sh | 2 | ||||
| -rwxr-xr-x | utils/nwztools/database/nvp/parse_nvp_header.sh | 1 | ||||
| -rwxr-xr-x | utils/nwztools/database/nvp/parse_nvp_nodes.sh | 1 | ||||
| -rw-r--r-- | utils/nwztools/emmctools/nvp.c | 2 |
6 files changed, 8 insertions, 6 deletions
diff --git a/utils/nwztools/database/gen_db.py b/utils/nwztools/database/gen_db.py index 61c08f9..792a1b9 100755 --- a/utils/nwztools/database/gen_db.py +++ b/utils/nwztools/database/gen_db.py @@ -199,9 +199,9 @@ with open("nwz_db.h", "w") as fp: # generate list of all nvp nodes for name in sorted(g_nvp_names): # create comment to explain the meaning, gather several meaning together - # if there are more than one + # if there are more than one (sorted to keep a stable order when we update) explain = "" - if name in g_nvp_desc: + if name in sorted(g_nvp_desc): explain = " | ".join(list(g_nvp_desc[name])) # overwrite desc set with a single string for later g_nvp_desc[name] = explain @@ -257,7 +257,7 @@ with open("nwz_db.c", "w") as fp: fp.write(" { %s, \"%s\" },\n" % (hex(model["mid"]), model["name"])) fp.write("};\n") # generate nvps - for hash in g_hash_nvp: + for hash in sorted(g_hash_nvp): nvp = g_hash_nvp[hash] fp.write("\nstatic int nvp_index_%s[NWZ_NVP_COUNT] =\n" % hash) fp.write("{\n") diff --git a/utils/nwztools/database/nvp/parse_all_nvp_headers.sh b/utils/nwztools/database/nvp/parse_all_nvp_headers.sh index e84eaae..331016b 100755 --- a/utils/nwztools/database/nvp/parse_all_nvp_headers.sh +++ b/utils/nwztools/database/nvp/parse_all_nvp_headers.sh @@ -1,4 +1,4 @@ -# +#!/bin/bash # usage: parse_all_nvp_headers /path/to/directory # # the expected structure is: diff --git a/utils/nwztools/database/nvp/parse_all_nvp_nodes.sh b/utils/nwztools/database/nvp/parse_all_nvp_nodes.sh index 3aae79d..3e67b3d 100755 --- a/utils/nwztools/database/nvp/parse_all_nvp_nodes.sh +++ b/utils/nwztools/database/nvp/parse_all_nvp_nodes.sh @@ -1,4 +1,4 @@ -# +#!/bin/bash # usage: parse_all_nvp_nodes /path/to/directory # # the expected structure is: diff --git a/utils/nwztools/database/nvp/parse_nvp_header.sh b/utils/nwztools/database/nvp/parse_nvp_header.sh index 853df93..8baab3c 100755 --- a/utils/nwztools/database/nvp/parse_nvp_header.sh +++ b/utils/nwztools/database/nvp/parse_nvp_header.sh @@ -1,3 +1,4 @@ +#!/bin/bash # usage # parse_header.sh /path/to/icx_nvp.h # parse_header.sh /path/to/linux/source [file] diff --git a/utils/nwztools/database/nvp/parse_nvp_nodes.sh b/utils/nwztools/database/nvp/parse_nvp_nodes.sh index cf42504..456a707 100755 --- a/utils/nwztools/database/nvp/parse_nvp_nodes.sh +++ b/utils/nwztools/database/nvp/parse_nvp_nodes.sh @@ -1,3 +1,4 @@ +#!/bin/bash # usage # parse_nodes.sh /path/to/icx_nvp_emmc.ko output_file # parse_nodes.sh /path/to/rootfs/dir output_file diff --git a/utils/nwztools/emmctools/nvp.c b/utils/nwztools/emmctools/nvp.c index c679c10..bbc0556 100644 --- a/utils/nwztools/emmctools/nvp.c +++ b/utils/nwztools/emmctools/nvp.c @@ -553,4 +553,4 @@ int nvp_info(void) } return 0; -}
\ No newline at end of file +} |