summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2019-05-31 10:48:33 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2019-05-31 17:37:39 +0200
commit34414684fb523f910b1ca57734d5c3e617c4daa7 (patch)
tree4604d1b2de6917bd5e6f34ab6b565aa089d839ec
parent80a5494ef64caa18fc8661ff799932c218766cff (diff)
downloadptxdist-34414684fb523f910b1ca57734d5c3e617c4daa7.tar.gz
ptxdist-34414684fb523f910b1ca57734d5c3e617c4daa7.tar.xz
ptxd_make_world_cfghash: make it more generic
This is in preparation to use it for other hashes. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r--rules/post/ptxd_make_world_prepare.make2
-rw-r--r--scripts/lib/ptxd_make_world_prepare.sh19
2 files changed, 13 insertions, 8 deletions
diff --git a/rules/post/ptxd_make_world_prepare.make b/rules/post/ptxd_make_world_prepare.make
index 248282c4d..498cf50bd 100644
--- a/rules/post/ptxd_make_world_prepare.make
+++ b/rules/post/ptxd_make_world_prepare.make
@@ -10,7 +10,7 @@
world/cfghash = \
+$(call world/env, $1) \
- ptxd_make_world_cfghash
+ ptxd_make_world_hash srchash
$(STATEDIR)/%.cfghash:
@$(call targetinfo)
diff --git a/scripts/lib/ptxd_make_world_prepare.sh b/scripts/lib/ptxd_make_world_prepare.sh
index 5c3b9b76d..ed3bd3d5b 100644
--- a/scripts/lib/ptxd_make_world_prepare.sh
+++ b/scripts/lib/ptxd_make_world_prepare.sh
@@ -8,30 +8,35 @@
# see the README file.
#
-ptxd_make_world_cfghash()
+ptxd_make_world_hash()
{
local -a hashes
local hash h
+ local target="${1}"
+ local ptr="pkg_${target}"
+ local pkg_hash="${!ptr}"
ptxd_make_world_init || return
- hashes=( "${ptx_state_dir}/${pkg_label}."*".cfghash" )
- hash="${ptx_state_dir}/${pkg_label}.${pkg_cfghash}.cfghash"
+ hashes=( "${ptx_state_dir}/${pkg_label}."*".${target}" )
+ hash="${ptx_state_dir}/${pkg_label}.${pkg_hash}.${target}"
- if [ ${hashes[0]} = "${ptx_state_dir}/${pkg_label}.*.cfghash" ]; then
+ if [ ${hashes[0]} = "${ptx_state_dir}/${pkg_label}.*.${target}" ]; then
hashes=()
fi
if [ ${#hashes[@]} -gt 1 ]; then
- ptxd_warning "more than one cfghash found!"
+ ptxd_warning "more than one ${target} found!"
fi
for h in "${hashes[@]}"; do
if [ "${h}" != "${hash}" ]; then
- echo -e "Configuration changed! Reconfiguring...\n"
+ if [ "${target}" = "pkghash" ]; then
+ echo -e "Configuration changed! Reconfiguring...\n"
+ fi
fi
rm "${h}" || break
done
}
-export -f ptxd_make_world_cfghash
+export -f ptxd_make_world_hash
#
# perform sanity check