[oe-commits] Koen Kooi : git 1.7.0.2: fix hardlinking problems as reported by Eric Brombaugh

git version control git at git.openembedded.org
Sat May 15 08:20:18 UTC 2010


Module: openembedded.git
Branch: org.openembedded.dev
Commit: 84de51631e1e7bb76141332807ed2ba9e8df02ae
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=84de51631e1e7bb76141332807ed2ba9e8df02ae

Author: Koen Kooi <koen at openembedded.org>
Date:   Sat May 15 10:16:29 2010 +0200

git 1.7.0.2: fix hardlinking problems as reported by Eric Brombaugh

Using softlinks has the following effects on package size:

git:		54MB -> 3.0MB
git-dbg:	646MB -> 141MB

---

 recipes/git/files/git-less-hardlinks.diff |   49 +++++++++++++++++++++++++++++
 recipes/git/git_1.7.0.2.bb                |   13 +++++++-
 2 files changed, 61 insertions(+), 1 deletions(-)

diff --git a/recipes/git/files/git-less-hardlinks.diff b/recipes/git/files/git-less-hardlinks.diff
new file mode 100644
index 0000000..183fe8f
--- /dev/null
+++ b/recipes/git/files/git-less-hardlinks.diff
@@ -0,0 +1,49 @@
+From: Koen Kooi <k-kooi at ti.com>
+Subject: Git: don't use hardlink, try softlinks and fall back to plain 'cp'
+
+Using hardlinks confuses packaging an ends up giving us a *copy* of the git binary,
+making the resulting package 54MB big. This brings it down a more managable 4.4M.
+
+This patch isn't complete though:
+
+12cb2bfcde40ce7084ae44af7db88f29  git-cvsserver
+2404a2cd2838be3841eac93de40a644e  git
+2404a2cd2838be3841eac93de40a644e  git-receive-pack
+2404a2cd2838be3841eac93de40a644e  git-upload-archive
+61631194968f67e12abd1f80103a2c68  git-upload-pack
+7b8faebe64076d65934a05cd60bbeb29  git-shell
+
+---
+
+--- /tmp/Makefile	2010-05-15 09:39:26.000000000 +0200
++++ git-1.7.0.2/Makefile	2010-05-15 09:44:21.000000000 +0200
+@@ -1453,7 +1453,6 @@
+ 
+ $(BUILT_INS): git$X
+ 	$(QUIET_BUILT_IN)$(RM) $@ && \
+-	ln git$X $@ 2>/dev/null || \
+ 	ln -s git$X $@ 2>/dev/null || \
+ 	cp git$X $@
+ 
+@@ -1626,7 +1625,6 @@
+ 
+ $(REMOTE_CURL_ALIASES): $(REMOTE_CURL_PRIMARY)
+ 	$(QUIET_LNCP)$(RM) $@ && \
+-	ln $< $@ 2>/dev/null || \
+ 	ln -s $< $@ 2>/dev/null || \
+ 	cp $< $@
+ 
+@@ -1830,13 +1828,11 @@
+ 		cp "$$bindir/git$X" "$$execdir/git$X"; } ; } && \
+ 	{ for p in $(BUILT_INS); do \
+ 		$(RM) "$$execdir/$$p" && \
+-		ln "$$execdir/git$X" "$$execdir/$$p" 2>/dev/null || \
+ 		ln -s "git$X" "$$execdir/$$p" 2>/dev/null || \
+ 		cp "$$execdir/git$X" "$$execdir/$$p" || exit; \
+ 	  done; } && \
+ 	{ for p in $(REMOTE_CURL_ALIASES); do \
+ 		$(RM) "$$execdir/$$p" && \
+-		ln "$$execdir/git-remote-http$X" "$$execdir/$$p" 2>/dev/null || \
+ 		ln -s "git-remote-http$X" "$$execdir/$$p" 2>/dev/null || \
+ 		cp "$$execdir/git-remote-http$X" "$$execdir/$$p" || exit; \
+ 	  done; } && \
diff --git a/recipes/git/git_1.7.0.2.bb b/recipes/git/git_1.7.0.2.bb
index e5a2c13..7bf9e89 100644
--- a/recipes/git/git_1.7.0.2.bb
+++ b/recipes/git/git_1.7.0.2.bb
@@ -3,6 +3,8 @@ require git.inc
 SRC_URI[src.md5sum] = "76518fa774b36de81d160b85fa4f19c1"
 SRC_URI[src.sha256sum] = "5601df7fc282fdd66de196b282694eb77dcfc50438f01587de144b3ead1a6b2f"
 
+SRC_URI += "file://git-less-hardlinks.diff;patch=1"
+
 EXTRA_OECONF += "ac_cv_snprintf_returns_bogus=no ac_cv_c_c99_format=yes"
 
 
@@ -12,6 +14,15 @@ RDEPENDS_${PN} = "perl perl-module-file-path cpio findutils sed"
 # Dropbear ssh needs a wrapper script, so install openssh-ssh to make it work out of the box
 RRECOMMENDS_${PN} = "openssh-ssh"
 
-PR = "r5"
+PR = "r6"
+
+do_install_append() {
+	# Fix broken hardlinks
+	for gitprog in git-receive-pack git-upload-archive ; do
+		rm ${D}${bindir}/$gitprog 
+		ln -sf ${bindir}/git ${D}${bindir}/$gitprog
+	done
+	rm ${D}${libexecdir}/git-core/git && ln -sf ${bindir}/git ${D}${libexecdir}/git-core/git
+}
 
 FILES_${PN}-dbg += "${libexecdir}/git-core/.debug"





More information about the Openembedded-commits mailing list