summaryrefslogtreecommitdiffstats
path: root/scripts/libptxdist.sh
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2012-07-29 20:19:07 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2012-07-29 22:57:11 +0200
commita84aef85fda6d4ff714d27b9882df5e8d6c77166 (patch)
tree407301922f20a58a488ae51950aa048628e463d7 /scripts/libptxdist.sh
parentfdee2b7f44597526da82890a5c8fad16ef46ea0a (diff)
downloadptxdist-a84aef85fda6d4ff714d27b9882df5e8d6c77166.tar.gz
ptxdist-a84aef85fda6d4ff714d27b9882df5e8d6c77166.tar.xz
ptxdist: add --verbose option and start using it
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'scripts/libptxdist.sh')
-rw-r--r--scripts/libptxdist.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/scripts/libptxdist.sh b/scripts/libptxdist.sh
index a6313819e..57c599b9b 100644
--- a/scripts/libptxdist.sh
+++ b/scripts/libptxdist.sh
@@ -708,6 +708,28 @@ ptxd_warning() {
}
export -f ptxd_warning
+#
+# print a message if verbose building is enabled
+# the message will always be written to the logfile
+#
+ptxd_verbose() {
+ if [ "${PTXDIST_VERBOSE}" = "true" ]; then
+ echo "${PTXDIST_LOG_PROMPT}""${@}" >&2
+ else
+ echo "${PTXDIST_LOG_PROMPT}""${@}" >&7
+ fi
+}
+export -f ptxd_verbose
+
+#
+# execute the arguments with eval
+#
+ptxd_eval() {
+ ptxd_verbose "executing:" "${@}
+"
+ eval "${@}"
+}
+export -f ptxd_eval
#
# check if a previously executed pipe returned an error