From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from 3.mo5.mail-out.ovh.net ([46.105.40.108] helo=mo5.mail-out.ovh.net) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TBNbt-0003VO-CA for barebox@lists.infradead.org; Tue, 11 Sep 2012 10:22:28 +0000 Received: from mail404.ha.ovh.net (b9.ovh.net [213.186.33.59]) by mo5.mail-out.ovh.net (Postfix) with SMTP id 79896FFA333 for ; Tue, 11 Sep 2012 12:27:56 +0200 (CEST) From: Jean-Christophe PLAGNIOL-VILLARD Date: Tue, 11 Sep 2012 12:19:26 +0200 Message-Id: <1347358767-1180-6-git-send-email-plagnioj@jcrosoft.com> In-Reply-To: <1347358767-1180-1-git-send-email-plagnioj@jcrosoft.com> References: <1347358767-1180-1-git-send-email-plagnioj@jcrosoft.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: barebox-bounces@lists.infradead.org Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 6/7] defaultenv-2/ansi-colors: export color only if enable To: barebox@lists.infradead.org This will allow to do not check it everywhere Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- defaultenv-2/base/data/ansi-colors | 4 ++++ defaultenv-2/menu/menu/mainmenu | 4 +--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/defaultenv-2/base/data/ansi-colors b/defaultenv-2/base/data/ansi-colors index c71b6b7..6365329 100644 --- a/defaultenv-2/base/data/ansi-colors +++ b/defaultenv-2/base/data/ansi-colors @@ -1,5 +1,9 @@ #!/bin/sh +if [ ${global.allow_color} != "true" ]; then + exit +fi + # Colors export RED='\e[1;31m' export BLUE='\e[1;34m' diff --git a/defaultenv-2/menu/menu/mainmenu b/defaultenv-2/menu/menu/mainmenu index d7b0033..5bd7027 100644 --- a/defaultenv-2/menu/menu/mainmenu +++ b/defaultenv-2/menu/menu/mainmenu @@ -3,9 +3,7 @@ savepath=$PATH export menupath=$PATH:/env/menu -if [ ${global.allow_color} = "true" ]; then - . /env/data/ansi-colors -fi +. /env/data/ansi-colors while true; do export PATH=${menupath} -- 1.7.10.4 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox