diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2019-05-31 10:48:33 +0200 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2019-05-31 17:37:39 +0200 |
commit | 34414684fb523f910b1ca57734d5c3e617c4daa7 (patch) | |
tree | 4604d1b2de6917bd5e6f34ab6b565aa089d839ec /scripts | |
parent | 80a5494ef64caa18fc8661ff799932c218766cff (diff) | |
download | ptxdist-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>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/lib/ptxd_make_world_prepare.sh | 19 |
1 files changed, 12 insertions, 7 deletions
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 |