diff mbox

[3/3] scripts/crosstool-NG: use ${grep} instead of 'grep'

Message ID 70a665929fe0568d767f79b8f98b5619493c90c9.1409095485.git.yann.morin.1998@free.fr
State Accepted
Headers show

Commit Message

Yann E. MORIN Aug. 26, 2014, 11:27 p.m. UTC
Helps building on BSD-like systems.

Reported-by: Fabian Freyer <fabian.freyer@physik.tu-berlin.de>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Fabian Freyer <fabian.freyer@physik.tu-berlin.de>
---
 scripts/crosstool-NG.sh.in | 6 +++---
 scripts/functions          | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

Comments

Fabian Freyer Aug. 27, 2014, 12:04 a.m. UTC | #1
On 27/08/14 01:27, Yann E. MORIN wrote:
> Helps building on BSD-like systems.
> 
> Reported-by: Fabian Freyer <fabian.freyer@physik.tu-berlin.de>

Signed-off-by: "Fabian Freyer" <fabian.freyer@physik.tu-berlin.de>

> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Fabian Freyer <fabian.freyer@physik.tu-berlin.de>
> ---
>  scripts/crosstool-NG.sh.in | 6 +++---
>  scripts/functions          | 4 ++--
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/scripts/crosstool-NG.sh.in b/scripts/crosstool-NG.sh.in
> index 3699500..3359bac 100644
> --- a/scripts/crosstool-NG.sh.in
> +++ b/scripts/crosstool-NG.sh.in
> @@ -125,7 +125,7 @@ CT_DoLog INFO "Build started ${CT_STAR_DATE_HUMAN}"
>  # We really need to extract from ,config and not .config.2, as we
>  # do want the kconfig's values, not our mangled config with arrays.
>  CT_DoStep DEBUG "Dumping user-supplied crosstool-NG configuration"
> -CT_DoExecLog DEBUG grep -E '^(# |)CT_' .config
> +CT_DoExecLog DEBUG ${grep} -E '^(# |)CT_' .config
>  CT_EndStep
>  
>  CT_DoLog DEBUG "Unsetting and unexporting MAKEFLAGS"
> @@ -570,9 +570,9 @@ if [ -z "${CT_RESTART}" ]; then
>      CT_DoLog EXTRA "  build  = ${CT_REAL_BUILD}"
>      CT_DoLog EXTRA "  host   = ${CT_REAL_HOST}"
>      CT_DoLog EXTRA "  target = ${CT_TARGET}"
> -    set |grep -E '^CT_.+=' |sort |CT_DoLog DEBUG
> +    set |${grep} -E '^CT_.+=' |sort |CT_DoLog DEBUG
>      CT_DoLog DEBUG "Other environment:"
> -    printenv |grep -v -E '^CT_.+=' |CT_DoLog DEBUG
> +    printenv |${grep} -v -E '^CT_.+=' |CT_DoLog DEBUG
>      CT_EndStep
>  fi
>  
> diff --git a/scripts/functions b/scripts/functions
> index cce629c..a309f2d 100644
> --- a/scripts/functions
> +++ b/scripts/functions
> @@ -995,9 +995,9 @@ CT_ExtractGit() {
>      if [ -z "${ref}" ]; then
>          ref_type=head
>          ref=$(git rev-list -n1 HEAD)
> -    elif git tag |grep -E "^${ref}$" >/dev/null 2>&1; then
> +    elif git tag |${grep} -E "^${ref}$" >/dev/null 2>&1; then
>          ref_type=tag
> -    elif git branch -a --no-color |grep -E "^. ${ref}$" >/dev/null 2>&1; then
> +    elif git branch -a --no-color |${grep} -E "^. ${ref}$" >/dev/null 2>&1; then
>          ref_type=branch
>      elif date -d "${ref}" >/dev/null 2>&1; then
>          ref_type=date
>
Fabian Freyer Aug. 27, 2014, 12:04 a.m. UTC | #2
On 27/08/14 01:27, Yann E. MORIN wrote:
> Helps building on BSD-like systems.
> 
> Reported-by: Fabian Freyer <fabian.freyer@physik.tu-berlin.de>
Signed-off-by: "Fabian Freyer" <fabian.freyer@physik.tu-berlin.de>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Fabian Freyer <fabian.freyer@physik.tu-berlin.de>
> ---
>  scripts/crosstool-NG.sh.in | 6 +++---
>  scripts/functions          | 4 ++--
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/scripts/crosstool-NG.sh.in b/scripts/crosstool-NG.sh.in
> index 3699500..3359bac 100644
> --- a/scripts/crosstool-NG.sh.in
> +++ b/scripts/crosstool-NG.sh.in
> @@ -125,7 +125,7 @@ CT_DoLog INFO "Build started ${CT_STAR_DATE_HUMAN}"
>  # We really need to extract from ,config and not .config.2, as we
>  # do want the kconfig's values, not our mangled config with arrays.
>  CT_DoStep DEBUG "Dumping user-supplied crosstool-NG configuration"
> -CT_DoExecLog DEBUG grep -E '^(# |)CT_' .config
> +CT_DoExecLog DEBUG ${grep} -E '^(# |)CT_' .config
>  CT_EndStep
>  
>  CT_DoLog DEBUG "Unsetting and unexporting MAKEFLAGS"
> @@ -570,9 +570,9 @@ if [ -z "${CT_RESTART}" ]; then
>      CT_DoLog EXTRA "  build  = ${CT_REAL_BUILD}"
>      CT_DoLog EXTRA "  host   = ${CT_REAL_HOST}"
>      CT_DoLog EXTRA "  target = ${CT_TARGET}"
> -    set |grep -E '^CT_.+=' |sort |CT_DoLog DEBUG
> +    set |${grep} -E '^CT_.+=' |sort |CT_DoLog DEBUG
>      CT_DoLog DEBUG "Other environment:"
> -    printenv |grep -v -E '^CT_.+=' |CT_DoLog DEBUG
> +    printenv |${grep} -v -E '^CT_.+=' |CT_DoLog DEBUG
>      CT_EndStep
>  fi
>  
> diff --git a/scripts/functions b/scripts/functions
> index cce629c..a309f2d 100644
> --- a/scripts/functions
> +++ b/scripts/functions
> @@ -995,9 +995,9 @@ CT_ExtractGit() {
>      if [ -z "${ref}" ]; then
>          ref_type=head
>          ref=$(git rev-list -n1 HEAD)
> -    elif git tag |grep -E "^${ref}$" >/dev/null 2>&1; then
> +    elif git tag |${grep} -E "^${ref}$" >/dev/null 2>&1; then
>          ref_type=tag
> -    elif git branch -a --no-color |grep -E "^. ${ref}$" >/dev/null 2>&1; then
> +    elif git branch -a --no-color |${grep} -E "^. ${ref}$" >/dev/null 2>&1; then
>          ref_type=branch
>      elif date -d "${ref}" >/dev/null 2>&1; then
>          ref_type=date
>
diff mbox

Patch

diff --git a/scripts/crosstool-NG.sh.in b/scripts/crosstool-NG.sh.in
index 3699500..3359bac 100644
--- a/scripts/crosstool-NG.sh.in
+++ b/scripts/crosstool-NG.sh.in
@@ -125,7 +125,7 @@  CT_DoLog INFO "Build started ${CT_STAR_DATE_HUMAN}"
 # We really need to extract from ,config and not .config.2, as we
 # do want the kconfig's values, not our mangled config with arrays.
 CT_DoStep DEBUG "Dumping user-supplied crosstool-NG configuration"
-CT_DoExecLog DEBUG grep -E '^(# |)CT_' .config
+CT_DoExecLog DEBUG ${grep} -E '^(# |)CT_' .config
 CT_EndStep
 
 CT_DoLog DEBUG "Unsetting and unexporting MAKEFLAGS"
@@ -570,9 +570,9 @@  if [ -z "${CT_RESTART}" ]; then
     CT_DoLog EXTRA "  build  = ${CT_REAL_BUILD}"
     CT_DoLog EXTRA "  host   = ${CT_REAL_HOST}"
     CT_DoLog EXTRA "  target = ${CT_TARGET}"
-    set |grep -E '^CT_.+=' |sort |CT_DoLog DEBUG
+    set |${grep} -E '^CT_.+=' |sort |CT_DoLog DEBUG
     CT_DoLog DEBUG "Other environment:"
-    printenv |grep -v -E '^CT_.+=' |CT_DoLog DEBUG
+    printenv |${grep} -v -E '^CT_.+=' |CT_DoLog DEBUG
     CT_EndStep
 fi
 
diff --git a/scripts/functions b/scripts/functions
index cce629c..a309f2d 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -995,9 +995,9 @@  CT_ExtractGit() {
     if [ -z "${ref}" ]; then
         ref_type=head
         ref=$(git rev-list -n1 HEAD)
-    elif git tag |grep -E "^${ref}$" >/dev/null 2>&1; then
+    elif git tag |${grep} -E "^${ref}$" >/dev/null 2>&1; then
         ref_type=tag
-    elif git branch -a --no-color |grep -E "^. ${ref}$" >/dev/null 2>&1; then
+    elif git branch -a --no-color |${grep} -E "^. ${ref}$" >/dev/null 2>&1; then
         ref_type=branch
     elif date -d "${ref}" >/dev/null 2>&1; then
         ref_type=date