All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] tools/Makefile: suppress "which swig" error output
@ 2016-11-19 12:04 Andre Przywara
  2016-11-19 23:56 ` Simon Glass
  2016-11-29  1:03 ` [U-Boot] " Tom Rini
  0 siblings, 2 replies; 3+ messages in thread
From: Andre Przywara @ 2016-11-19 12:04 UTC (permalink / raw)
  To: u-boot

The Makefile in tools/ tries to find the "swig" utility by calling "which".
If nothing is found in the path, some versions of which will print an error
message:
$ make clean
which: no swig in (/usr/local/bin:/usr/bin:/bin)

This does not apply to all version of "which", though:
$ echo $0
bash
$ type which
which is aliased to `type -path'
$ which foo				<== this version is OK
$ /usr/bin/which foo			<== this one is chatty
/usr/bin/which: no foo in (/usr/local/bin:/usr/bin:/bin)
$ sh					<== make uses /bin/sh
sh-4.3$ which foo			<== no alias here
which: no foo in (/usr/local/bin:/usr/bin:/bin)

This error message is rather pointless in our case, since we just have
this very check to care for this. So add stderr redirection to suppress
the message.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 tools/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/Makefile b/tools/Makefile
index 9edb504..5b81dde 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -112,7 +112,7 @@ fit_check_sign-objs   := $(dumpimage-mkimage-objs) fit_check_sign.o
 # Build a libfdt Python module if swig is available
 # Use 'sudo apt-get install swig libpython-dev' to enable this
 hostprogs-$(CONFIG_SPL_OF_PLATDATA) += \
-	$(if $(shell which swig),_libfdt.so)
+	$(if $(shell which swig 2> /dev/null),_libfdt.so)
 _libfdt.so-sharedobjs += $(LIBFDT_OBJS)
 libfdt:
 
-- 
2.8.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] tools/Makefile: suppress "which swig" error output
  2016-11-19 12:04 [U-Boot] [PATCH] tools/Makefile: suppress "which swig" error output Andre Przywara
@ 2016-11-19 23:56 ` Simon Glass
  2016-11-29  1:03 ` [U-Boot] " Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Glass @ 2016-11-19 23:56 UTC (permalink / raw)
  To: u-boot

On 19 November 2016 at 05:04, Andre Przywara <andre.przywara@arm.com> wrote:
> The Makefile in tools/ tries to find the "swig" utility by calling "which".
> If nothing is found in the path, some versions of which will print an error
> message:
> $ make clean
> which: no swig in (/usr/local/bin:/usr/bin:/bin)
>
> This does not apply to all version of "which", though:
> $ echo $0
> bash
> $ type which
> which is aliased to `type -path'
> $ which foo                             <== this version is OK
> $ /usr/bin/which foo                    <== this one is chatty
> /usr/bin/which: no foo in (/usr/local/bin:/usr/bin:/bin)
> $ sh                                    <== make uses /bin/sh
> sh-4.3$ which foo                       <== no alias here
> which: no foo in (/usr/local/bin:/usr/bin:/bin)
>
> This error message is rather pointless in our case, since we just have
> this very check to care for this. So add stderr redirection to suppress
> the message.
>
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> ---
>  tools/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] tools/Makefile: suppress "which swig" error output
  2016-11-19 12:04 [U-Boot] [PATCH] tools/Makefile: suppress "which swig" error output Andre Przywara
  2016-11-19 23:56 ` Simon Glass
@ 2016-11-29  1:03 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2016-11-29  1:03 UTC (permalink / raw)
  To: u-boot

On Sat, Nov 19, 2016 at 12:04:59PM +0000, Andre Przywara wrote:

> The Makefile in tools/ tries to find the "swig" utility by calling "which".
> If nothing is found in the path, some versions of which will print an error
> message:
> $ make clean
> which: no swig in (/usr/local/bin:/usr/bin:/bin)
> 
> This does not apply to all version of "which", though:
> $ echo $0
> bash
> $ type which
> which is aliased to `type -path'
> $ which foo				<== this version is OK
> $ /usr/bin/which foo			<== this one is chatty
> /usr/bin/which: no foo in (/usr/local/bin:/usr/bin:/bin)
> $ sh					<== make uses /bin/sh
> sh-4.3$ which foo			<== no alias here
> which: no foo in (/usr/local/bin:/usr/bin:/bin)
> 
> This error message is rather pointless in our case, since we just have
> this very check to care for this. So add stderr redirection to suppress
> the message.
> 
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161128/d9e50515/attachment.sig>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-11-29  1:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-19 12:04 [U-Boot] [PATCH] tools/Makefile: suppress "which swig" error output Andre Przywara
2016-11-19 23:56 ` Simon Glass
2016-11-29  1:03 ` [U-Boot] " Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.