mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] common: Makefile: 'cd' command could lead to broken default_env.h
@ 2012-10-22 17:14 Wolfram Sang
  2012-10-23  7:04 ` Sascha Hauer
  0 siblings, 1 reply; 4+ messages in thread
From: Wolfram Sang @ 2012-10-22 17:14 UTC (permalink / raw)
  To: barebox; +Cc: Wolfram Sang

Depending on the user's settings (CDPATH), 'cd' may print out the
directory which was changed to. This causes broken barebox_default_env.h
to be generated. Ignore the cd printout.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
---
 common/Makefile |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/Makefile b/common/Makefile
index 132bd06..f2c8a2e 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -99,7 +99,7 @@ $(obj)/barebox_default_env.lzo: $(obj)/barebox_default_env FORCE
 	$(call if_changed,lzo)
 
 quiet_cmd_env_h = ENVH    $@
-cmd_env_h = cat $< | (cd $(obj) && $(objtree)/scripts/bin2c default_environment) > $@; \
+cmd_env_h = cat $< | (cd $(obj) > /dev/null && $(objtree)/scripts/bin2c default_environment) > $@; \
 	echo "const int default_environment_uncompress_size=`stat -c%s $(obj)/barebox_default_env`;" >> $@
 
 $(obj)/barebox_default_env.h: $(obj)/barebox_default_env$(barebox_default_env_comp) FORCE
-- 
1.7.10.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH] common: Makefile: 'cd' command could lead to broken default_env.h
  2012-10-22 17:14 [PATCH] common: Makefile: 'cd' command could lead to broken default_env.h Wolfram Sang
@ 2012-10-23  7:04 ` Sascha Hauer
  2012-10-23 11:25   ` Wolfram Sang
  0 siblings, 1 reply; 4+ messages in thread
From: Sascha Hauer @ 2012-10-23  7:04 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: barebox

On Mon, Oct 22, 2012 at 07:14:08PM +0200, Wolfram Sang wrote:
> Depending on the user's settings (CDPATH), 'cd' may print out the
> directory which was changed to. This causes broken barebox_default_env.h
> to be generated. Ignore the cd printout.

I didn't know such a thing exists. This can cause unexpected behaviour
of 'cd'. Wouldn't it be better to completely disable it by emptying
CDPATH in scripts?

Sascha


> 
> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
> ---
>  common/Makefile |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/common/Makefile b/common/Makefile
> index 132bd06..f2c8a2e 100644
> --- a/common/Makefile
> +++ b/common/Makefile
> @@ -99,7 +99,7 @@ $(obj)/barebox_default_env.lzo: $(obj)/barebox_default_env FORCE
>  	$(call if_changed,lzo)
>  
>  quiet_cmd_env_h = ENVH    $@
> -cmd_env_h = cat $< | (cd $(obj) && $(objtree)/scripts/bin2c default_environment) > $@; \
> +cmd_env_h = cat $< | (cd $(obj) > /dev/null && $(objtree)/scripts/bin2c default_environment) > $@; \
>  	echo "const int default_environment_uncompress_size=`stat -c%s $(obj)/barebox_default_env`;" >> $@
>  
>  $(obj)/barebox_default_env.h: $(obj)/barebox_default_env$(barebox_default_env_comp) FORCE
> -- 
> 1.7.10.4
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH] common: Makefile: 'cd' command could lead to broken default_env.h
  2012-10-23  7:04 ` Sascha Hauer
@ 2012-10-23 11:25   ` Wolfram Sang
  2012-10-23 12:54     ` Sascha Hauer
  0 siblings, 1 reply; 4+ messages in thread
From: Wolfram Sang @ 2012-10-23 11:25 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox


[-- Attachment #1.1: Type: text/plain, Size: 685 bytes --]

On Tue, Oct 23, 2012 at 09:04:55AM +0200, Sascha Hauer wrote:
> On Mon, Oct 22, 2012 at 07:14:08PM +0200, Wolfram Sang wrote:
> > Depending on the user's settings (CDPATH), 'cd' may print out the
> > directory which was changed to. This causes broken barebox_default_env.h
> > to be generated. Ignore the cd printout.
> 
> I didn't know such a thing exists. This can cause unexpected behaviour
> of 'cd'. Wouldn't it be better to completely disable it by emptying
> CDPATH in scripts?

Yes, probably. You or me? :)

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH] common: Makefile: 'cd' command could lead to broken default_env.h
  2012-10-23 11:25   ` Wolfram Sang
@ 2012-10-23 12:54     ` Sascha Hauer
  0 siblings, 0 replies; 4+ messages in thread
From: Sascha Hauer @ 2012-10-23 12:54 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: barebox

On Tue, Oct 23, 2012 at 01:25:17PM +0200, Wolfram Sang wrote:
> On Tue, Oct 23, 2012 at 09:04:55AM +0200, Sascha Hauer wrote:
> > On Mon, Oct 22, 2012 at 07:14:08PM +0200, Wolfram Sang wrote:
> > > Depending on the user's settings (CDPATH), 'cd' may print out the
> > > directory which was changed to. This causes broken barebox_default_env.h
> > > to be generated. Ignore the cd printout.
> > 
> > I didn't know such a thing exists. This can cause unexpected behaviour
> > of 'cd'. Wouldn't it be better to completely disable it by emptying
> > CDPATH in scripts?
> 
> Yes, probably. You or me? :)

If you ask... you ;)

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2012-10-23 12:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-22 17:14 [PATCH] common: Makefile: 'cd' command could lead to broken default_env.h Wolfram Sang
2012-10-23  7:04 ` Sascha Hauer
2012-10-23 11:25   ` Wolfram Sang
2012-10-23 12:54     ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox