Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 170066 - dev-util/git installation wasting many megabytes of space by not using symlinks for dupes
Summary: dev-util/git installation wasting many megabytes of space by not using symlin...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Fernando J. Pereda (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-09 07:53 UTC by Guenther Brunthaler
Modified: 2008-11-21 13:30 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Guenther Brunthaler 2007-03-09 07:53:54 UTC
The git distribution contains a file /usr/bin/git which should actually be symlinked to many different names in /usr/bin/git, such as /usr/bin/git-add. The current ebuild does not use symlinks (or hardlinks) for that purpose however, but instead actually duplicates /usr/bin/git a several dozens of times.

As /usr/bin/git has a size of about half a megabyte, the ebuild wastes a lot of disk space, leading to a total installation size of about 32 megabytes, which is really just crazy.

Reproducible: Always

Steps to Reproduce:
1. for A in git*; do md5sum -b $A; done | sort | less
2. equery size dev-util/git
3. # wonder why so much space is wasted... ;-)
Comment 1 Guenther Brunthaler 2007-03-09 07:57:26 UTC
Ooops - forgot to add the path within step 1 how to reproduce.
Please use

for A in /usr/bin/git*; do md5sum -b $A;done | sort | less

instead!

Comment 2 Guenther Brunthaler 2007-03-09 08:04:41 UTC
Here is even a better one which shows content checksum, inode and name:

for A in /usr/bin/git*; do echo -n "$(md5sum -b $A | cut -c-32 ) "; ls -i $A ; done | sort |less
Comment 3 Guenther Brunthaler 2007-03-09 08:10:58 UTC
Regarding the size: I installed with USE=doc, so without USE=doc the package will certainly be a bit shorter then 32 megabytes, but not by too much.
Comment 4 Fernando J. Pereda (RETIRED) gentoo-dev 2007-03-09 10:11:53 UTC
The problem is waaaaaaaaaay more subtle than that.

The ebuild uses the upstream provided Makefile and it efectively installs hardlinks instead of copies. However, your package manager of choice has to break those hardlinks while merging the package.

Using symlinks instead of hardlinks should work for that. I'll look into this bug later.

Thanks.

- ferdy
Comment 5 Fernando J. Pereda (RETIRED) gentoo-dev 2007-03-09 18:43:07 UTC
I added the following 'fix' to git-1.5.0.3.ebuild:

----8<----
--- git-1.5.0.2.ebuild	2007-03-09 19:27:27.000000000 +0100
+++ git-1.5.0.3.ebuild	2007-03-09 19:19:53.000000000 +0100
@@ -74,6 +74,7 @@
 		-e "s:^\(LDFLAGS = \).*$:\1${LDFLAGS}:" \
 		-e "s:^\(CC = \).*$:\1$(tc-getCC):" \
 		-e "s:^\(AR = \).*$:\1$(tc-getAR):" \
+		-e 's:ln :ln -s :g' \
 		Makefile || die "sed failed"
 
 	exportmakeopts
----8<----

- ferdy
Comment 6 Guenther Brunthaler 2007-03-09 23:45:57 UTC
*Much* better now: Total size  : 9254.92 KiB

Saving 2/3rds of the previous space requirements.

Thanks for the fix!
Comment 7 Jeroen Roovers (RETIRED) gentoo-dev 2008-11-21 13:30:51 UTC
*** Bug 247922 has been marked as a duplicate of this bug. ***