This week I've installed Git on two different machines and one of
them mysteriously failed making the "install" target in the
"templates/Makefile". Specifically, the problem was occuring here:
(cd blt && $(TAR) cf - .) | \
(cd '$(DESTDIR_SQ)$(template_dir_SQ)' && $(TAR) xf -)
And the error message was:
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Error exit delayed from previous errors
Upon investigation, I discovered that the cause was that on the
failing machine, the CDPATH environment variable was set and included
"." (the current directory). This meant that upon executing:
(cd blt && $(TAR) cf - .)
The data from tar was getting prepended with garbage because "cd blt"
was echoing the path to the directory.
The workaround is to "unset CDPATH" or change the value of CDPATH so
that it doesn't include the "." (although the latter is not very
feasible because without "." at the front of CDPATH changing into a
directory relative to the current directory can be quite painful).
What do you think about altering the templates/Makefile to make it
more robust against this kind of environment?
Here's a possible patch:
From 057630bdcfeee63b90468d1a69153171b15780c0 Mon Sep 17 00:00:00 2001
From: Wincent Colaiuta <win@wincent.com>
Date: Wed, 11 Jul 2007 18:43:59 +0200
[PATCH] Proof Makefile against possible problems with CDPATH environment
If the CDPATH environment variable is set and contains a period
Bash may echo the current directory name while performing a cd,
and when this extra output is piped to tar as part of template
installation it can cause tar to abort with an error. This patch
avoids this problem by invoking cd as a separate step prior to
invoking tar.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
---
templates/Makefile | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/templates/Makefile b/templates/Makefile
index aaa39d3..3457ccb 100644
--- a/templates/Makefile
+++ b/templates/Makefile
@@ -46,5 +46,6 @@ clean:
install: all
$(INSTALL) -d -m755 '$(DESTDIR_SQ)$(template_dir_SQ)'
- (cd blt && $(TAR) cf - .) | \
+ cd blt && $(TAR) cf - . | \
(cd '$(DESTDIR_SQ)$(template_dir_SQ)' && $(TAR) xf -)
+ cd -
--
1.5.2.3
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
| Ingo Molnar | Re: [PATCH 00 of 36] x86/paravirt: groundwork for 64-bit Xen support |
| Linus Torvalds | Linux 2.6.27-rc8 |
| Alan Cox | [PATCH 02/27] drivers/char/hvc_console.c: adjust call to put_tty_driver |
| James Bottomley | Re: Integration of SCST in the mainstream Linux kernel |
git: | |
| Johannes Schindelin | RE: Switching from CVS to GIT |
| Florian v. Savigny | Can git be tweaked to work cross-platform, on FAT32? |
| Shawn Bohrer | [PATCH] Fix off by one error in prep_exclude. |
| Johannes Sixt | [PATCH 03/40] Add target architecture MinGW. |
| Marcos Laufer | dmesg IBM x3650 OpenBSD 4.3 |
| Nick Guenther | Re: Real men don't attack straw men |
| Steve B | Intel Atom and D945GCLF2 |
| Michael | QEMU /dev/tun issue with tun device number > 3 (more than 4 guests) |
| David Miller | [GIT]: Networking |
| Chuck Lever | Re: [bug?] tg3: Failed to load firmware "tigon/tg3_tso.bin" |
| Patrick McHardy | gre: minor cleanups in netlink interface |
| Jarek Poplawski | Re: [PATCH] net_sched: Add qdisc __NET_XMIT_STOLEN flag |
