threads / patch / 4232

patchcompress output of `cd' when installing templates

Subject: [PATCH] compress output of `cd' when installing templates

## tl;dr

3 messages between May 21, 2006 and May 21, 2006. Diffs are folded; open one to read it.

replies: 2people: 3as markdown or json

Gang Chen· May 21, 2006, 15:41 UTC · lore

When CDPATH is set in Bash, `cd' writes new working directory to stdout, which corrupts output of `tar cf - .'.

Signed-off-by: Gang Chen <goncha.ml@gmail.com>
---
 Makefile |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)
Show changes to templates/Makefile +1 −1
diff --git a/templates/Makefile b/templates/Makefile
index 8f7f4fe..cb67489 100644
--- a/templates/Makefile
+++ b/templates/Makefile
@@ -44,5 +44,5 @@ clean:
 
 install: all
 	$(INSTALL) -d -m755 $(call shellquote,$(DESTDIR)$(template_dir))
-	(cd blt && $(TAR) cf - .) | \
+	(cd blt > /dev/null && $(TAR) cf - .) | \
 	(cd $(call shellquote,$(DESTDIR)$(template_dir)) && $(TAR) xf -)
-- 
If it makes you happy, it can't be that bad.
Timo Hirvonen· May 21, 2006, 15:54 UTC · re: Gang Chen · lore

Re: [PATCH] compress output of `cd' when installing templates

Gang Chen <goncha.ml@gmail.com> wrote:
> When CDPATH is set in Bash, `cd' writes new working directory to
> stdout, which corrupts output of `tar cf - .'.

Fix bash instead, or just don't export CDPATH. It is used by bash only so exporting it is unnecessary.

-- 
http://onion.dynserv.net/~timo/
Junio C Hamano· May 21, 2006, 18:23 UTC · re: Timo Hirvonen · lore

Re: [PATCH] compress output of `cd' when installing templates

Timo Hirvonen <tihirvon@gmail.com> writes:
Show 7 quoted lines
> Gang Chen <goncha.ml@gmail.com> wrote:
>
>> When CDPATH is set in Bash, `cd' writes new working directory to
>> stdout, which corrupts output of `tar cf - .'.
>
> Fix bash instead, or just don't export CDPATH.  It is used by bash only
> so exporting it is unnecessary.
Thanks.

It is not just unnecessary, but "export CDPATH" anywhere in your rc scripts is actively *WRONG*.

← back to recent threads