summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2021-09-14 12:12:48 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2021-09-14 12:12:50 +0200
commita7862adf72889b5dad98b746fbd2f7e706acaf5c (patch)
tree86e97f0c612828839316df57134576d913c98ec5
parentca47cbbcc38eded46776e3c5a6e5ccdb0fdd5544 (diff)
downloadptxdist-a7862adf72889b5dad98b746fbd2f7e706acaf5c.tar.gz
ptxdist-a7862adf72889b5dad98b746fbd2f7e706acaf5c.tar.xz
ptxd_make_world_update_md5: handle layers
When layers are involved, then the delta config must be updated as well. Either update the existing symbol or add a new one at the end of the file. If it is added at the end, then print a warning, that 'oldconfig' should be used to correct the symbol oder in the file. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r--scripts/lib/ptxd_make_world_check_src.sh17
1 files changed, 14 insertions, 3 deletions
diff --git a/scripts/lib/ptxd_make_world_check_src.sh b/scripts/lib/ptxd_make_world_check_src.sh
index 71feae21a..6955c1ef2 100644
--- a/scripts/lib/ptxd_make_world_check_src.sh
+++ b/scripts/lib/ptxd_make_world_check_src.sh
@@ -17,11 +17,22 @@ ptxd_make_world_update_md5() {
local md5="${1}"
local PKG_MD5="PTXCONF_${PKG}_MD5"
- for conf in "${PTXDIST_PLATFORMCONFIG}" "${PTXDIST_PTXCONFIG}"; do
- conf="$(readlink -f "${conf}")"
- if [ $(grep "^${PKG_MD5}=\"" "${conf}" 2> /dev/null | wc -l) = 1 ]; then
+ for config in "${PTXDIST_PLATFORMCONFIG}" "${PTXDIST_PTXCONFIG}"; do
+ local conf="$(readlink -f "${config}")"
+ if grep -q "^${PKG_MD5}=\"" "${conf}"; then
sed -i "s/^${PKG_MD5}=\".*$/${PKG_MD5}=\"${md5}\"/" "${conf}"
ptxd_warning "New checksum for ${pkg_label}: ${md5} in $(ptxd_print_path "${conf}")"
+ if [ -e "${conf}.diff" ]; then
+ if grep -q "^${PKG_MD5}=\"" "${conf}.diff"; then
+ sed -i "s/^${PKG_MD5}=\".*$/${PKG_MD5}=\"${md5}\"/" "${conf}.diff"
+ else
+ echo "${PKG_MD5}=\"${md5}\"" >> "${conf}.diff"
+ if [ "${config}" == "${PTXDIST_PLATFORMCONFIG}" ]; then
+ arg=" platform"
+ fi
+ ptxd_warning "$(ptxd_print_path "${config}") is dirty. Run 'ptxdist oldconfig${arg}'."
+ fi
+ fi
return
fi
done