diff options
Diffstat (limited to 'src/chroot-tools/chcleanup')
-rwxr-xr-x | src/chroot-tools/chcleanup | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/chroot-tools/chcleanup b/src/chroot-tools/chcleanup index d2d9a70..fa6a572 100755 --- a/src/chroot-tools/chcleanup +++ b/src/chroot-tools/chcleanup @@ -12,18 +12,24 @@ DRYRUN=${DRYRUN:-false} ################################################################################ # Define these here to avoid having dependencies on outside files +if type gettext &>/dev/null; then + _() { gettext "$@"; } +else + _() { echo "$@"; } +fi + msg() { - local mesg=$1; shift + local mesg="$(_ "$1")"; shift printf "${GREEN}==>${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2 } msg2() { - local mesg=$1; shift + local mesg="$(_ "$1")"; shift printf "${BLUE} ->${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2 } error() { - local mesg=$1; shift + local mesg="$(_ "$1")"; shift printf "${RED}==> $(gettext "ERROR:")${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2 } |