Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 247922 - dev-util/git-1.6.* installs multiple copies of the same binaries
Summary: dev-util/git-1.6.* installs multiple copies of the same binaries
Status: RESOLVED DUPLICATE of bug 235642
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-21 12:03 UTC by Matt Whitlock
Modified: 2008-11-26 20:35 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 Matt Whitlock 2008-11-21 12:03:28 UTC
dev-util/git installs 90 copies of the same binary.  Each copy is 963080 bytes large on my system, so that adds up to a rather large waste of space.  There are a few other duplicated files as well.

$ du -hc $(qlist git) | tail -n1
92M     total

All of the files within each set of duplicates SHOULD be references to a single copy, either by symbolic links or by hard links.

Here is a list of the duplicates and the number of copies of each:

$ md5sum $(qlist git) | sort | uniq -cdw32
      2 19209bb2b00f0ecd80a9def73bb79234  /usr/bin/git-upload-pack
      2 361a793e135d6eff90554adee5a50cfa  /usr/bin/git-cvsserver
      2 50ec9ae7baf52cc67b59c427a2b3bf1d  /usr/libexec/git-core/git-citool
      2 7e3e2e61c9ed19493b39c6880e9f5121  /usr/bin/git-receive-pack
     90 85b73389471132a81c7c58ff6b3be8a1  /usr/bin/git
      2 86ac80e08cf53a0ae53a6bbd18b284c7  /usr/bin/git-shell
      2 8ca7559918c9d9cb56cd0916478ba5a5  /usr/bin/import-tars
      2 cbfc5bfa44f96c691599bc2d0a86918a  /usr/bin/git-p4

And here are the sets of duplicates, along with their inode numbers on my system, so you can see they are indeed independent copies:

$ all=$(md5sum $(qlist git)) ; echo "${all}" | cut -c-32 | sort | uniq -d | while read md5 ; do echo ; echo ${md5}: ; /bin/ls -1di $(echo "${all}" | fgrep ${md5} | cut -c35-) ; done

19209bb2b00f0ecd80a9def73bb79234:
2415920939 /usr/bin/git-upload-pack
1610668637 /usr/libexec/git-core/git-upload-pack

361a793e135d6eff90554adee5a50cfa:
2441671452 /usr/bin/git-cvsserver
1610668754 /usr/libexec/git-core/git-cvsserver

50ec9ae7baf52cc67b59c427a2b3bf1d:
1610668731 /usr/libexec/git-core/git-citool
1610673205 /usr/libexec/git-core/git-gui

7e3e2e61c9ed19493b39c6880e9f5121:
2415920940 /usr/bin/git-receive-pack
1610668619 /usr/libexec/git-core/git-receive-pack

85b73389471132a81c7c58ff6b3be8a1:
2420660035 /usr/bin/git
2416066614 /usr/bin/git-upload-archive
1610668730 /usr/libexec/git-core/git-add
1610668729 /usr/libexec/git-core/git-annotate
1610668728 /usr/libexec/git-core/git-apply
1610668727 /usr/libexec/git-core/git-archive
1610668726 /usr/libexec/git-core/git-blame
1610668725 /usr/libexec/git-core/git-branch
1610668724 /usr/libexec/git-core/git-bundle
1610668723 /usr/libexec/git-core/git-cat-file
1610668722 /usr/libexec/git-core/git-check-attr
1610668719 /usr/libexec/git-core/git-checkout
1610668720 /usr/libexec/git-core/git-checkout-index
1610668721 /usr/libexec/git-core/git-check-ref-format
1610668653 /usr/libexec/git-core/git-cherry
1610668654 /usr/libexec/git-core/git-cherry-pick
1610668718 /usr/libexec/git-core/git-clean
1610668717 /usr/libexec/git-core/git-clone
1610668715 /usr/libexec/git-core/git-commit
1610668716 /usr/libexec/git-core/git-commit-tree
1610668714 /usr/libexec/git-core/git-config
1610668713 /usr/libexec/git-core/git-count-objects
1610668712 /usr/libexec/git-core/git-describe
1610668708 /usr/libexec/git-core/git-diff
1610668711 /usr/libexec/git-core/git-diff-files
1610668710 /usr/libexec/git-core/git-diff-index
1610668709 /usr/libexec/git-core/git-diff-tree
1610668707 /usr/libexec/git-core/git-fast-export
1610668704 /usr/libexec/git-core/git-fetch
1610668705 /usr/libexec/git-core/git-fetch-pack
1610668706 /usr/libexec/git-core/git-fetch--tool
1610668703 /usr/libexec/git-core/git-fmt-merge-msg
1610668702 /usr/libexec/git-core/git-for-each-ref
1610668652 /usr/libexec/git-core/git-format-patch
1610668701 /usr/libexec/git-core/git-fsck
1610668651 /usr/libexec/git-core/git-fsck-objects
1610668700 /usr/libexec/git-core/git-gc
1610668650 /usr/libexec/git-core/git-get-tar-commit-id
1610668699 /usr/libexec/git-core/git-grep
1610668655 /usr/libexec/git-core/git-http-fetch
1610668649 /usr/libexec/git-core/git-init
1610668698 /usr/libexec/git-core/git-init-db
1610668697 /usr/libexec/git-core/git-log
1610668696 /usr/libexec/git-core/git-ls-files
1610668695 /usr/libexec/git-core/git-ls-remote
1610668694 /usr/libexec/git-core/git-ls-tree
1610668693 /usr/libexec/git-core/git-mailinfo
1610668692 /usr/libexec/git-core/git-mailsplit
1610668691 /usr/libexec/git-core/git-merge
1610668690 /usr/libexec/git-core/git-merge-base
1610668689 /usr/libexec/git-core/git-merge-file
1610668688 /usr/libexec/git-core/git-merge-ours
1610668687 /usr/libexec/git-core/git-merge-recursive
1610668648 /usr/libexec/git-core/git-merge-subtree
1610668686 /usr/libexec/git-core/git-mv
1610668685 /usr/libexec/git-core/git-name-rev
1610668684 /usr/libexec/git-core/git-pack-objects
1610668683 /usr/libexec/git-core/git-pack-refs
1610668647 /usr/libexec/git-core/git-peek-remote
1610668681 /usr/libexec/git-core/git-prune
1610668682 /usr/libexec/git-core/git-prune-packed
1610668680 /usr/libexec/git-core/git-push
1610668679 /usr/libexec/git-core/git-read-tree
1610668678 /usr/libexec/git-core/git-reflog
1610668677 /usr/libexec/git-core/git-remote
1610668646 /usr/libexec/git-core/git-repo-config
1610668676 /usr/libexec/git-core/git-rerere
1610668675 /usr/libexec/git-core/git-reset
1610668672 /usr/libexec/git-core/git-revert
1610668674 /usr/libexec/git-core/git-rev-list
1610668673 /usr/libexec/git-core/git-rev-parse
1610668671 /usr/libexec/git-core/git-rm
1610668670 /usr/libexec/git-core/git-send-pack
1610668669 /usr/libexec/git-core/git-shortlog
1610668645 /usr/libexec/git-core/git-show
1610668668 /usr/libexec/git-core/git-show-branch
1610668667 /usr/libexec/git-core/git-show-ref
1610668644 /usr/libexec/git-core/git-status
1610668666 /usr/libexec/git-core/git-stripspace
1610668665 /usr/libexec/git-core/git-symbolic-ref
1610668664 /usr/libexec/git-core/git-tag
1610668663 /usr/libexec/git-core/git-tar-tree
1610668662 /usr/libexec/git-core/git-unpack-objects
1610668661 /usr/libexec/git-core/git-update-index
1610668660 /usr/libexec/git-core/git-update-ref
1610668659 /usr/libexec/git-core/git-upload-archive
1610668658 /usr/libexec/git-core/git-verify-pack
1610668657 /usr/libexec/git-core/git-verify-tag
1610668643 /usr/libexec/git-core/git-whatchanged
1610668656 /usr/libexec/git-core/git-write-tree

86ac80e08cf53a0ae53a6bbd18b284c7:
2416069146 /usr/bin/git-shell
1610668642 /usr/libexec/git-core/git-shell

8ca7559918c9d9cb56cd0916478ba5a5:
2416069148 /usr/bin/import-tars
3221469955 /usr/share/git/contrib/fast-import/import-tars.perl

cbfc5bfa44f96c691599bc2d0a86918a:
2415920675 /usr/bin/git-p4
3221469965 /usr/share/git/contrib/fast-import/git-p4
Comment 1 Rafał Mużyło 2008-11-21 12:24:54 UTC
I had that problem too - and I was wrong.
Those are not copies of the same binary - those are hardlinks (at least most of
those are).
What's more those are planned to go away in one of the future releases of git
(though it's not told exactly when).

Check this with 'du' and 'du -l' on 'duplicates' lists.
Comment 2 Matt Whitlock 2008-11-21 12:40:00 UTC
(In reply to comment #1)
> I had that problem too - and I was wrong.
> Those are not copies of the same binary - those are hardlinks (at least most of
> those are).
> What's more those are planned to go away in one of the future releases of git
> (though it's not told exactly when).
> 
> Check this with 'du' and 'du -l' on 'duplicates' lists.
> 

$ du -bc $(qlist git) | tail -n1
94778663        total

$ du -lbc $(qlist git) | tail -n1
94778663        total

They are not hard links in the live file system.  However, they *are* hard links in the "image" staging area beneath /var/tmp/portage prior to being merged.

Methinks Portage is not preserving the hardlinkedness when merging onto the live file system.  So this might not be a git-specific problem but rather a Portage problem.

# ebuild /usr/portage/dev-util/git/git-1.6.0.4.ebuild install > /dev/null

Comment 3 Matt Whitlock 2008-11-21 12:57:13 UTC
The following function could be called in the git ebuild to convert the hard links into symbolic links that Portage would preserve when merging:

make_symlinks() {
  md5sum $(find "${D}"/usr/libexec/git-core -type f) |
    fgrep $(md5sum "${D}"/usr/bin/git | cut -c-32) |
    cut -c35- | fgrep -v '/usr/bin/git' |
    while read dup ; do
      ln -sfv ../../bin/git "${dup}"
    done
}
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2008-11-21 13:30:51 UTC

*** This bug has been marked as a duplicate of bug 170066 ***
Comment 5 Matt Whitlock 2008-11-21 13:38:01 UTC
Begging your pardon, but the fix mentioned in bug #170066 is not included in the ebuild for git-1.6.0.4.  Thus, the problem persists.
Comment 6 Jeroen Roovers (RETIRED) gentoo-dev 2008-11-21 13:51:20 UTC
Hey, that's odd...
Comment 7 Fernando J. Pereda (RETIRED) gentoo-dev 2008-11-21 22:07:47 UTC
This is a Portage "feature". Feel free to reassign the bug to them though.

- ferdy

Comment 8 Jeroen Roovers (RETIRED) gentoo-dev 2008-11-26 20:07:17 UTC
.
Comment 9 Zac Medico gentoo-dev 2008-11-26 20:35:47 UTC

*** This bug has been marked as a duplicate of bug 235642 ***