summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2017-01-04 16:26:07 +0100
committerGerrit Rockbox <gerrit@rockbox.org>2017-01-04 17:03:14 +0100
commit3c3e133f99f38f9746df7c51ded6671ffa987504 (patch)
tree9b5763c18c9e0d430aadd8ba8b0126eb8907a836
parentd7770a1cddeb94826046b9c58107f967e5462810 (diff)
downloadrockbox-3c3e133.tar.gz
rockbox-3c3e133.tar.bz2
rockbox-3c3e133.zip
nwztools: small fixes
Make sure scripts use bash, make nwz database generator more deterministic Change-Id: I26812b697abe0406fb3c60d6eb231cb27edc81d5
-rwxr-xr-xutils/nwztools/database/gen_db.py6
-rwxr-xr-xutils/nwztools/database/nvp/parse_all_nvp_headers.sh2
-rwxr-xr-xutils/nwztools/database/nvp/parse_all_nvp_nodes.sh2
-rwxr-xr-xutils/nwztools/database/nvp/parse_nvp_header.sh1
-rwxr-xr-xutils/nwztools/database/nvp/parse_nvp_nodes.sh1
-rw-r--r--utils/nwztools/emmctools/nvp.c2
6 files changed, 8 insertions, 6 deletions
diff --git a/utils/nwztools/database/gen_db.py b/utils/nwztools/database/gen_db.py
index 61c08f919a..792a1b91c2 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 e84eaae8f5..331016b045 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 3aae79deb0..3e67b3d354 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 853df93557..8baab3c9eb 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 cf42504e32..456a707e5d 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 c679c1098b..bbc05563b5 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
+}