From 12bb467d36f9eb296108e60ec40a1f278e1f5d3e Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 26 Nov 2008 20:40:45 +0100 Subject: pkg: Make debug a no-op if it's not enabled --- bin/pkg | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/pkg b/bin/pkg index 1ef3ac1..ee086c9 100755 --- a/bin/pkg +++ b/bin/pkg @@ -25,7 +25,6 @@ error=$'\e[0;31m' reset=$'\e[0m' function debug { - (( DEBUG )) || return typeset func line if [[ ${#*} -ge 3 ]] { func=$1 @@ -109,6 +108,12 @@ while [[ $1 == [-+]* ]] { action=$1 shift +# Avoid calling debug without debug mode... just in case one needs more speed +if (( !DEBUG )) { + unalias debug + function debug {} +} + ## ## Make sure everything's sane ## Warn otherwise @@ -120,7 +125,7 @@ if [[ ! -d $PDIR ]] { ## -## Some additional variables related to PKG_ROOT +## Setup some additional variables related to PKG_ROOT ## # Protocol -- cgit v1.2.3