From 8989b603a3b3478f93980bee008612374ddc0322 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 25 Feb 2013 17:39:59 +0100 Subject: fix build_core --- helper/fileutil.inc | 16 +++++++++------- helper/logging.inc | 7 ++++--- 2 files changed, 13 insertions(+), 10 deletions(-) (limited to 'helper') diff --git a/helper/fileutil.inc b/helper/fileutil.inc index 3c165d99..3e1ea56a 100644 --- a/helper/fileutil.inc +++ b/helper/fileutil.inc @@ -1,16 +1,18 @@ # copy list of files using tar tarcopy () { [ $# -ne 2 ] && perror "Sanity check failed: tarcopy needs exactly two params, but $# were given." - if [ -z $1 ]; then - pwarning "tarcopy called with empty input list (dest was '$2')" + local FROM=$(trim "$1") + local TO=$(trim "$2") + if [ -z "$FROM" ]; then + pwarning "tarcopy called with empty input list (dest was '$TO')" return fi - local SHORT=$1 + local SHORT=$FROM [ ${#SHORT} -gt 23 ] && SHORT=$(echo "$SHORT" | cut -c-18)...$(echo "$SHORT" | cut -c$[${#SHORT} - 4]-) - [ -z $2 ] && perror "tarcopy called with empty destination." - tar -cp "$1" | tar -xp -C "$2" + [ -z "$TO" ] && perror "tarcopy called with empty destination." + tar -cp $FROM | tar -xp -C "$TO" local PS=(${PIPESTATUS[*]}) - [ "x${PS[0]}" != "x0" ] && perror "packing-part of tar-copy from '$SHORT' to '$2' failed. (${PS[0]})" - [ "x${PS[1]}" != "x0" ] && perror "unpacking-part of tar-copy from '$SHORT' to '$2' failed. (${PS[1]})" + [ "x${PS[0]}" != "x0" ] && perror "packing-part of tar-copy from '$SHORT' to '$TO' failed. (${PS[0]})" + [ "x${PS[1]}" != "x0" ] && perror "unpacking-part of tar-copy from '$SHORT' to '$TO' failed. (${PS[1]})" } diff --git a/helper/logging.inc b/helper/logging.inc index 4daf1e12..2d79c67c 100644 --- a/helper/logging.inc +++ b/helper/logging.inc @@ -20,9 +20,10 @@ set_quiet () { unset_quiet () { if [ "x$MLTK_QUIET" = "x1" ]; then - exec 1>&6 6>&- - exec 2>&7 7>&- - MLTK_QUIET="0" + exec 1>&6 6>&- + exec 2>&7 7>&- + exec 6>&2 + MLTK_QUIET="0" fi } -- cgit v1.2.3-55-g7522