diff options
author | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2008-05-25 22:25:50 +0000 |
---|---|---|
committer | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2008-05-25 22:25:50 +0000 |
commit | 91c6e16780724fc68bcb58411057ae3ad484862a (patch) | |
tree | 5fa56769849caf0bd95e2a8bc40da55aa0b6a4fb /scripts/functions | |
parent | 3d9cc3d03658a35c9f5112d63a0b4e161d5602c5 (diff) | |
download | crosstool-ng-91c6e16780724fc68bcb58411057ae3ad484862a.tar.gz crosstool-ng-91c6e16780724fc68bcb58411057ae3ad484862a.tar.bz2 crosstool-ng-91c6e16780724fc68bcb58411057ae3ad484862a.zip |
Add a new helper function: CT_DoExecLog.
It is similar to CT_DoLog, but instead of printing its arguments, it uses them as a command, and logs the output of that command.
/trunk/scripts/functions | 8 8 0 0 ++++++++
1 file changed, 8 insertions(+)
Diffstat (limited to 'scripts/functions')
-rw-r--r-- | scripts/functions | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/functions b/scripts/functions index 09625ace..0e73143b 100644 --- a/scripts/functions +++ b/scripts/functions @@ -105,6 +105,14 @@ CT_DoLog() { return 0 } +# Execute an action, and log its messages +# Usage: CT_DoExecLog <level> <[VAR=val...] command [parameters...]> +CT_DoExecLog() { + local level="$1" + shift + eval "$@" 2>&1 |CT_DoLog "${level}" +} + # Tail message to be logged whatever happens # Usage: CT_DoEnd <level> CT_DoEnd() |