summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2018-12-10 06:16:59 +0100
committerMichael Olbrich <m.olbrich@pengutronix.de>2018-12-10 08:30:25 +0100
commit9c858b6ba4bfdda308676070f9c77572a506f30b (patch)
tree24fae8ab152840fbd31d0090c1ed7d23cbc856f1
parent923a30fab77d11f43e68d5a637ef31bbf24cdd1b (diff)
downloadptxdist-9c858b6ba4bfdda308676070f9c77572a506f30b.tar.gz
ptxdist-9c858b6ba4bfdda308676070f9c77572a506f30b.tar.xz
ptxd_make_progress: make the dry-run more robust
Set MAKE=false to ensure any sub-make fails immediately if the dry-run setup does not work correctly. Also, don't ignore errors during 'make --dry-run'. Note: only errors for 'make' are relevant. 'grep' fails if no targets are found. That can happen if nothing needs to be done. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r--scripts/lib/ptxd_make_progress.sh10
1 files changed, 7 insertions, 3 deletions
diff --git a/scripts/lib/ptxd_make_progress.sh b/scripts/lib/ptxd_make_progress.sh
index 9e12d3e37..d6a595976 100644
--- a/scripts/lib/ptxd_make_progress.sh
+++ b/scripts/lib/ptxd_make_progress.sh
@@ -11,10 +11,14 @@
ptxd_make_setup_progress() {
if [ -n "${PTXDIST_PROGRESS}" -a -n "${PTXDIST_QUIET}" ]; then
ptxd_make_target_count=$( \
- "${PTXCONF_SETUP_HOST_MAKE}" --dry-run \
- -f "${RULESDIR}/other/Toplevel.make" "${@}" 2>/dev/null | \
+ MAKE=false "${PTXCONF_SETUP_HOST_MAKE}" --dry-run \
+ -f "${RULESDIR}/other/Toplevel.make" "${@}" | \
grep -E '^target=.*\.(get|extract|prepare|compile|install|targetinstall|report).* touch' | \
- wc -l)
+ wc -l ; exit ${PIPESTATUS[0]})
+ if [ $? -ne 0 ]; then
+ echo "Failed to initialize progress data! $x" >&2
+ exit 1
+ fi
export ptxd_make_target_count
exec {ptxd_make_target_count_start}>> "${PTXDIST_TEMPDIR}/ptxd_make_target_count_start"
exec {ptxd_make_target_count_stop}>> "${PTXDIST_TEMPDIR}/ptxd_make_target_count_stop"