On Wed, Jan 26, 2011 at 08:58:24PM +0800, Jesse Zhang wrote: > For example on the x86_64 system, glibc accounts for 12% of the whole > system. And from big to small, mono>faenza-icon-theme>sun-jdk>kernel. ... > See it for yourself. On the second sheet, the size of :locale troves are > shown.
Compare installed size to the "size" troveinfo for individual packages by installing them into a chroot with --no-deps -- IIRC the "size" troveinfo that you see with --info is an attempt at a max size, and might count hardlinks multiply. Additionally, the size for a package includes all its components, including ones that are byDefault=False, and debuginfo can get really, really big. $ conary q glibc[is:x86_64] --info Name : glibc Build time: Mon Dec 27 10:15:19 2010 Version : 2.12-12-1 Label : foresight.rpath.org@fl:2-qa Size : 422388439 ... $ conary q glibc[is:x86_64] --labels --flavors glibc=foresight.rpath.org@fl:2-qa/2.12-12-1[~!bootstrap,~!cross is: x86_64] $ conary rq --info 'glibc:debuginfo=foresight.rpath.org@fl:2-qa/2.12-12-1[~!bootstrap,~!cross is: x86_64]' Name : glibc:debuginfo Build time: Mon Dec 27 10:15:19 2010 Version : 2.12-12-1 Label : foresight.rpath.org@fl:2-qa Size : 62542939 ... $ echo '62542939 / (1024*1024)' | bc 59 That's 59M of :debuginfo Let's look at :locale: $ conary rq --info 'glibc:locale=foresight.rpath.org@fl:2-qa/2.12-12-1[~!bootstrap,~!cross is: x86_64]' Name : glibc:locale Build time: Mon Dec 27 10:15:19 2010 Version : 2.12-12-1 Label : foresight.rpath.org@fl:2-qa Size : 393830950 $ echo '393830950 / (1024*1024)' | bc 375 $ conary install --no-deps 'glibc=foresight.rpath.org@fl:2-qa/2.12-12-1[~!bootstrap,~!cross is: x86_64]' --root /tmp/asdf $ du -s /tmp/asdf 150180 /tmp/asdf $ du -sh /tmp/asdf 147M /tmp/asdf $ echo '422388439 / (1024*1024)' | bc 402 In other words, due to hardlinks, what is reported as a maximum size of 402 MiB shows up as 147MiB on the filesystem. Now, let's remove glibc:locale -- it can't possibly be 375MiB if everything together takes up 147MiB... $ conary erase glibc:locale --no-deps --root /tmp/asdf $ du -sh /tmp/asdf 32M /tmp/asdf So locale is still the majority of glibc, but it's really 147 - 32 = 115 MiB, not 375 MiB, due to hardlink preservation. (Note that this includes the few MB taken by the Conary database, but you might want to include that size in the amount of space the package takes anyway... :) Of course, how much space packages *really* take depends on filesystem block size, filesystem directory entry size, whether filesystems use extents, whether filesystems use tail packing, and so forth. So to get the real size of the installed packages on a particular filesystem, you need to get the troves, with files (but without file contents), only single-count hardlink groups, and then use an algorithm that takes into account particular filesystem features. (Then, depending on your goals, you might want to add some room for the Conary database, and then some more fudge for conary rollbacks.) This is rather expensive processing compared to looking up a value that is just the sum of the sizes of the files. It also requires python programming, or installing individual components into a temporary chroot... I hope this is useful! _______________________________________________ Foresight-devel mailing list Foresight-devel@lists.rpath.org http://lists.rpath.org/mailman/listinfo/foresight-devel
