From patchwork Wed Jan 22 18:48:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Bj=C3=B8rn_Forsman?= X-Patchwork-Id: 313362 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id 5C5622C0097 for ; Thu, 23 Jan 2014 05:49:06 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 0AE7E8A6F4; Wed, 22 Jan 2014 18:49:05 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ro8bD-f76GZQ; Wed, 22 Jan 2014 18:49:02 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 17AE385C14; Wed, 22 Jan 2014 18:49:02 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 31DD11CE7C9 for ; Wed, 22 Jan 2014 18:49:01 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 2CE4485C14 for ; Wed, 22 Jan 2014 18:49:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SnJa8U+4nrgF for ; Wed, 22 Jan 2014 18:49:00 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-la0-f43.google.com (mail-la0-f43.google.com [209.85.215.43]) by whitealder.osuosl.org (Postfix) with ESMTPS id EA72283941 for ; Wed, 22 Jan 2014 18:48:59 +0000 (UTC) Received: by mail-la0-f43.google.com with SMTP id pv20so669600lab.30 for ; Wed, 22 Jan 2014 10:48:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=BHfdv3OY8LJlNplea7mKbUfwdjTQ+YeU7OKO0RInYHU=; b=o1YmOo55O4b7ryfKlsvq5P1CpIfWfVx1DJmmk0Mk7gHEL3Xapj9GZPNTc2nud6L7xr L9cV3AC/LP5EZp3cc5GfQaBg6qxsTsb+NYCxT0GpXcxhIG1qOdfOh/KaGRHx6o0pjtl9 qANCmJsVl607IATzWC1tBc2MNyf/GNUd13KBcmRxWiL00436PqFIOyrzxoIEYgHMHMUe fzvdwxpkeTWMk9QNiPaSm81Ng96B2ylc8e/N9Ws0V8MWzaGD+E4wZMXUNqqbDSVXhpw1 MXld9pvy2QbuyolqJWLthWVRX11tiN4s88+18v1g8O7/ReqHmIiiwtwPCTXoySqtkVN5 aVKg== X-Received: by 10.152.170.199 with SMTP id ao7mr2144243lac.40.1390416538030; Wed, 22 Jan 2014 10:48:58 -0800 (PST) Received: from localhost (cm-84.208.207.142.getinternet.no. [84.208.207.142]) by mx.google.com with ESMTPSA id t5sm11468730lat.6.2014.01.22.10.48.56 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Jan 2014 10:48:57 -0800 (PST) From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= To: buildroot@busybox.net Date: Wed, 22 Jan 2014 19:48:52 +0100 Message-Id: <1390416532-2328-1-git-send-email-bjorn.forsman@gmail.com> X-Mailer: git-send-email 1.8.5.2 MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/1] dependencies.sh: stop mixing echo and printf (use echo) X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net 'printf' was introduced because it is more portable than 'echo -e'. But when the escape sequences are just newlines we can just as well use plain 'echo' (and remove the newline escape sequences). This looks cleaner than having some lines with echo and some with printf. Signed-off-by: Bjørn Forsman --- support/dependencies/dependencies.sh | 67 +++++++++++++++++++++++------------- 1 file changed, 44 insertions(+), 23 deletions(-) diff --git a/support/dependencies/dependencies.sh b/support/dependencies/dependencies.sh index 8cfbcf6..47d4d10 100755 --- a/support/dependencies/dependencies.sh +++ b/support/dependencies/dependencies.sh @@ -7,7 +7,8 @@ export LC_ALL=C # Verify that grep works echo "WORKS" | grep "WORKS" >/dev/null 2>&1 if test $? != 0 ; then - printf "\ngrep doesn't work\n" + echo + echo "grep doesn't work" exit 1 fi @@ -19,8 +20,9 @@ if test -n "$LD_LIBRARY_PATH" ; then echo TRiGGER_start"$LD_LIBRARY_PATH"TRiGGER_end | grep ':\.TRiGGER_end' >/dev/null 2>&1 || echo TRiGGER_start"$LD_LIBRARY_PATH"TRiGGER_end | grep 'TRiGGER_start\.TRiGGER_end' >/dev/null 2>&1 if test $? = 0; then - printf "\nYou seem to have the current working directory in your" - printf "LD_LIBRARY_PATH environment variable. This doesn't work.\n" + echo + echo "You seem to have the current working directory in your" + echo "LD_LIBRARY_PATH environment variable. This doesn't work." exit 1; fi fi; @@ -34,14 +36,16 @@ if test -n "$PATH" ; then echo TRiGGER_start"$PATH"TRiGGER_end | grep ':\.TRiGGER_end' >/dev/null 2>&1 || echo TRiGGER_start"$PATH"TRiGGER_end | grep 'TRiGGER_start\.TRiGGER_end' >/dev/null 2>&1 if test $? = 0; then - printf "\nYou seem to have the current working directory in your" - printf "PATH environment variable. This doesn't work.\n" + echo + echo "You seem to have the current working directory in your" + echo "PATH environment variable. This doesn't work." exit 1; fi fi; if test -n "$PERL_MM_OPT" ; then - printf "\nYou have PERL_MM_OPT defined because Perl local::lib" + echo + echo "You have PERL_MM_OPT defined because Perl local::lib" echo "is installed on your system. Please unset this variable" echo "before starting Buildroot, otherwise the compilation of" echo "Perl related packages will fail" @@ -50,30 +54,35 @@ fi # Verify that which is installed if ! which which > /dev/null ; then - printf "\nYou must install 'which' on your build machine\n"; + echo + echo "You must install 'which' on your build machine"; exit 1; fi; if ! which sed > /dev/null ; then - printf "\nYou must install 'sed' on your build machine\n" + echo + echo "You must install 'sed' on your build machine" exit 1 fi # Check make MAKE=$(which make 2> /dev/null) if [ -z "$MAKE" ] ; then - printf "\nYou must install 'make' on your build machine\n"; + echo + echo "You must install 'make' on your build machine"; exit 1; fi; MAKE_VERSION=$($MAKE --version 2>&1 | sed -e 's/^.* \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q') if [ -z "$MAKE_VERSION" ] ; then - printf "\nYou must install 'make' on your build machine\n"; + echo + echo "You must install 'make' on your build machine"; exit 1; fi; MAKE_MAJOR=$(echo $MAKE_VERSION | sed -e "s/\..*//g") MAKE_MINOR=$(echo $MAKE_VERSION | sed -e "s/^$MAKE_MAJOR\.//g" -e "s/\..*//g" -e "s/[a-zA-Z].*//g") if [ $MAKE_MAJOR -lt 3 ] || [ $MAKE_MAJOR -eq 3 -a $MAKE_MINOR -lt 81 ] ; then - printf "\nYou have make '$MAKE_VERSION' installed. GNU make >=3.81 is required\n" + echo + echo "You have make '$MAKE_VERSION' installed. GNU make >=3.81 is required" exit 1; fi; @@ -83,20 +92,23 @@ if [ -z "$COMPILER" ] ; then COMPILER=$(which cc 2> /dev/null) fi; if [ -z "$COMPILER" ] ; then - printf "\nYou must install 'gcc' on your build machine\n"; + echo + echo "You must install 'gcc' on your build machine"; exit 1; fi; COMPILER_VERSION=$($COMPILER -v 2>&1 | sed -n '/^gcc version/p' | sed -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q') if [ -z "$COMPILER_VERSION" ] ; then - printf "\nYou must install 'gcc' on your build machine\n"; + echo + echo "You must install 'gcc' on your build machine"; exit 1; fi; COMPILER_MAJOR=$(echo $COMPILER_VERSION | sed -e "s/\..*//g") COMPILER_MINOR=$(echo $COMPILER_VERSION | sed -e "s/^$COMPILER_MAJOR\.//g" -e "s/\..*//g") if [ $COMPILER_MAJOR -lt 3 -o $COMPILER_MAJOR -eq 2 -a $COMPILER_MINOR -lt 95 ] ; then - printf "\nYou have gcc '$COMPILER_VERSION' installed. gcc >= 2.95 is required\n" + echo + echo "You have gcc '$COMPILER_VERSION' installed. gcc >= 2.95 is required" exit 1; fi; @@ -106,27 +118,31 @@ if [ -z "$CXXCOMPILER" ] ; then CXXCOMPILER=$(which c++ 2> /dev/null) fi if [ -z "$CXXCOMPILER" ] ; then - printf "\nYou may have to install 'g++' on your build machine\n" + echo + echo "You may have to install 'g++' on your build machine" #exit 1 fi if [ ! -z "$CXXCOMPILER" ] ; then CXXCOMPILER_VERSION=$($CXXCOMPILER -v 2>&1 | sed -n '/^gcc version/p' | sed -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q') if [ -z "$CXXCOMPILER_VERSION" ] ; then - printf "\nYou may have to install 'g++' on your build machine\n" + echo + echo "You may have to install 'g++' on your build machine" fi CXXCOMPILER_MAJOR=$(echo $CXXCOMPILER_VERSION | sed -e "s/\..*//g") CXXCOMPILER_MINOR=$(echo $CXXCOMPILER_VERSION | sed -e "s/^$CXXCOMPILER_MAJOR\.//g" -e "s/\..*//g") if [ $CXXCOMPILER_MAJOR -lt 3 -o $CXXCOMPILER_MAJOR -eq 2 -a $CXXCOMPILER_MINOR -lt 95 ] ; then - printf "\nYou have g++ '$CXXCOMPILER_VERSION' installed. g++ >= 2.95 is required\n" + echo + echo "You have g++ '$CXXCOMPILER_VERSION' installed. g++ >= 2.95 is required" exit 1 fi fi # Check bash if ! $SHELL --version 2>&1 | grep -q '^GNU bash'; then - printf "\nYou must install 'bash' on your build machine\n"; + echo + echo "You must install 'bash' on your build machine"; exit 1; fi; @@ -155,11 +171,13 @@ fi if grep ^BR2_TOOLCHAIN_BUILDROOT=y $BUILDROOT_CONFIG > /dev/null && \ grep ^BR2_ENABLE_LOCALE=y $BUILDROOT_CONFIG > /dev/null ; then if ! which locale > /dev/null ; then - printf "\nYou need locale support on your build machine to build a toolchain supporting locales\n" + echo + echo "You need locale support on your build machine to build a toolchain supporting locales" exit 1 ; fi if ! locale -a | grep -q -i utf8$ ; then - printf "\nYou need at least one UTF8 locale to build a toolchain supporting locales\n" + echo + echo "You need at least one UTF8 locale to build a toolchain supporting locales" exit 1 ; fi fi @@ -167,7 +185,8 @@ fi if grep -q ^BR2_PACKAGE_CLASSPATH=y $BUILDROOT_CONFIG ; then for prog in javac jar; do if ! which $prog > /dev/null ; then - printf "\nYou must install '$prog' on your build machine\n" >&2 + echo >&2 + echo "You must install '$prog' on your build machine" >&2 exit 1 fi done @@ -175,7 +194,8 @@ fi if grep -q ^BR2_HOSTARCH_NEEDS_IA32_LIBS=y $BUILDROOT_CONFIG ; then if test ! -f /lib/ld-linux.so.2 ; then - printf "\nYour Buildroot configuration uses pre-built tools for the x86 architecture," + echo + echo "Your Buildroot configuration uses pre-built tools for the x86 architecture," echo "but your build machine uses the x86-64 architecture without the 32 bits compatibility" echo "library." echo "If you're running a Debian/Ubuntu distribution, install the libc6:i386," @@ -188,7 +208,8 @@ fi if grep -q ^BR2_HOSTARCH_NEEDS_IA32_COMPILER=y $BUILDROOT_CONFIG ; then if ! echo "int main(void) {}" | gcc -m32 -x c - ; then - printf "\nYour Buildroot configuration needs a compiler capable of building 32 bits binaries." + echo + echo "Your Buildroot configuration needs a compiler capable of building 32 bits binaries." echo "If you're running a Debian/Ubuntu distribution, install the gcc-multilib package." echo "For other distributions, refer to their documentation." exit 1