diff options
| author | Jonathan Bauer | 2013-02-25 17:39:20 +0100 |
|---|---|---|
| committer | Jonathan Bauer | 2013-02-25 17:39:20 +0100 |
| commit | e830b89fa5dcdfffd2f8bdafe4ab558945e4a366 (patch) | |
| tree | 95ff8152807dfacc3836734e03410e7132bec77f /helper | |
| parent | ? (diff) | |
| parent | fix build_core (diff) | |
| download | tm-scripts-e830b89fa5dcdfffd2f8bdafe4ab558945e4a366.tar.gz tm-scripts-e830b89fa5dcdfffd2f8bdafe4ab558945e4a366.tar.xz tm-scripts-e830b89fa5dcdfffd2f8bdafe4ab558945e4a366.zip | |
Merge branch 'master' of git.openslx.org:openslx-ng/tm-scripts
Diffstat (limited to 'helper')
| -rw-r--r-- | helper/fileutil.inc | 16 | ||||
| -rw-r--r-- | helper/logging.inc | 7 |
2 files changed, 13 insertions, 10 deletions
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 } |
