Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 23305 - Code that shows the size of each package, aswell as the total size
Summary: Code that shows the size of each package, aswell as the total size
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
: 11118 19596 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-06-22 18:20 UTC by mathias stearn
Modified: 2011-10-30 22:37 UTC (History)
2 users (show)

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


Attachments
modified emerge file (emerge,66.17 KB, text/plain)
2003-06-22 18:26 UTC, mathias stearn
Details
Updated file (emerge,66.18 KB, application/octet-stream)
2003-06-23 21:07 UTC, mathias stearn
Details
The correct file (emerge,66.16 KB, application/octet-stream)
2003-06-23 21:22 UTC, mathias stearn
Details
The correct file (emerge,66.16 KB, application/octet-stream)
2003-06-23 21:22 UTC, mathias stearn
Details
diff -u -w file (size.patch,2.49 KB, patch)
2003-06-30 06:06 UTC, mathias stearn
Details | Diff
updated patch (size.patch,2.50 KB, patch)
2003-08-17 16:10 UTC, mathias stearn
Details | Diff
re-diffed patch to pre18 (size.patch,2.44 KB, patch)
2003-08-17 16:34 UTC, mathias stearn
Details | Diff
my own version of the patch (download-size-display.patch,2.64 KB, patch)
2003-10-09 15:27 UTC, Marius Mauch (RETIRED)
Details | Diff
new patch with functions (dl-size.diff,3.76 KB, patch)
2003-11-28 21:11 UTC, Marius Mauch (RETIRED)
Details | Diff
improved patch (dl-size.diff,3.82 KB, patch)
2003-11-29 09:48 UTC, Marius Mauch (RETIRED)
Details | Diff
new patch using digestParseFile() (download-size-display.patch,3.68 KB, patch)
2003-12-08 14:30 UTC, Marius Mauch (RETIRED)
Details | Diff
display-size-fix.patch (display-size-fix.patch,1.79 KB, patch)
2003-12-16 02:45 UTC, TGL
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description mathias stearn 2003-06-22 18:20:30 UTC
example: 
 
bash-2.05b# /usr/local/bin/emerge -puv  gcc 
 
These are the packages that I would merge, in order: 
 
Calculating dependencies ...done! 
[ebuild    UD] sys-libs/glibc-2.3.2-r1 [2.3.2-r2] -nls +pic -build +nptl  13,417 kB 
[ebuild    U ] sys-devel/patch-2.5.9 [2.5.4-r4] -build -static  197 kB 
[ebuild    U ] sys-apps/groff-1.18.1-r2 [1.18.1-r1] +X -cjk  2,310 kB 
[ebuild    U ] sys-apps/sed-4.0.7 [4.0.6] -nls -static -build  677 kB 
[ebuild    U ] sys-apps/man-1.5l-r6 [1.5l-r2] -nls  213 kB 
[ebuild    U ] sys-libs/db-3.2.9-r5 [3.2.9-r1]  2,036 kB 
[ebuild    U ] dev-lang/perl-5.8.0-r11 [5.8.0-r10] +berkdb +doc +gdbm -threads  10,854 
kB 
[ebuild    U ] sys-devel/binutils-2.14.90.0.2 [2.14.90.0.1-r1] -nls -bootstrap -build  
10,103 kB 
[ebuild    U ] sys-libs/ncurses-5.3-r2 [5.3-r1]  2,019 kB 
[ebuild    UD] sys-devel/gcc-3.2.3-r1 [3.3] -static -nls -bootstrap +java -build  20,715 
kB 
 
Total size of  downloads: 62,544 kb 
 
 
I surrounded all of my code with lines of solid #'s. My changes go from line 1000 to 
1104. Please consider adding this to the next version of portage. 
 
PS- I saw another topic with this, but it was abandoned, and used a differant aproch. 
Sorry if it was wrong to post this dup. 

Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 mathias stearn 2003-06-22 18:26:17 UTC
Created attachment 13705 [details]
modified emerge file
Comment 2 mathias stearn 2003-06-23 21:07:10 UTC
Created attachment 13747 [details]
Updated file

Fixes A bug where emerge -p wouldn't work without -v.
Comment 3 mathias stearn 2003-06-23 21:22:27 UTC
Created attachment 13748 [details]
The correct file
Comment 4 mathias stearn 2003-06-23 21:22:39 UTC
Created attachment 13749 [details]
The correct file
Comment 5 mathias stearn 2003-06-23 21:24:15 UTC
Comment on attachment 13747 [details]
Updated file

oops! wrong file
Comment 6 Nicholas Jones (RETIRED) gentoo-dev 2003-06-29 16:59:33 UTC
Please post 'diff -u' patches. I'm a bit busy to diff myself.
Comment 7 mathias stearn 2003-06-30 06:06:52 UTC
Created attachment 14034 [details, diff]
diff -u -w  file
Comment 8 mathias stearn 2003-08-17 16:10:14 UTC
Created attachment 16234 [details, diff]
updated patch

changed the filenames at the top of the patch.
Apllies to 2.0.47 - 2.0.49-pre18

to carpaski: please include this in .49 as it is a visible improvement. btw,
pre18 is worken for me so far ;)
Comment 9 mathias stearn 2003-08-17 16:34:31 UTC
Created attachment 16236 [details, diff]
re-diffed patch to pre18
Comment 10 Marius Mauch (RETIRED) gentoo-dev 2003-09-30 12:15:27 UTC
*** Bug 19596 has been marked as a duplicate of this bug. ***
Comment 11 Nicholas Jones (RETIRED) gentoo-dev 2003-10-05 16:00:01 UTC
diff -w
diff -b
diff -B

are all unacceptable options for diffs.

Python is very anal about kinds and counts of whitespace.
Do not ignore it.

diff -u only please.
Comment 12 Marius Mauch (RETIRED) gentoo-dev 2003-10-09 15:24:49 UTC
*** Bug 11118 has been marked as a duplicate of this bug. ***
Comment 13 Marius Mauch (RETIRED) gentoo-dev 2003-10-09 15:27:58 UTC
Created attachment 19035 [details, diff]
my own version of the patch

this is a mix of different patches, works fine with -r12
Comment 14 Nicholas Jones (RETIRED) gentoo-dev 2003-11-09 23:20:42 UTC
Can you break that out into a seperate function?
Comment 15 Marius Mauch (RETIRED) gentoo-dev 2003-11-28 21:11:04 UTC
Created attachment 21441 [details, diff]
new patch with functions

seperated it into functions and improved a few bits
Comment 16 Marius Mauch (RETIRED) gentoo-dev 2003-11-28 21:16:08 UTC
forgot to say, that patch is against cvs
Comment 17 Marius Mauch (RETIRED) gentoo-dev 2003-11-29 09:48:56 UTC
Created attachment 21474 [details, diff]
improved patch

forgot a Integer check in format_size()
Comment 18 Marius Mauch (RETIRED) gentoo-dev 2003-12-08 14:30:16 UTC
Created attachment 21894 [details, diff]
new patch using digestParseFile()

this patch uses digestParseFile() to get the filesizes.
Comment 19 TGL 2003-12-12 09:33:47 UTC
I don't know if you've noticed it already, but the output is wrong when there are conditional SRC_URI. Example:
% emerge -fuD world
<snip, no errors>
% emerge -puvD world
<snip>
[ebuild     U ] net-www/dillo-0.7.3-r4 [0.7.3-r3] -cjk +gnome +ipv6 -kde +mozilla +nls +ssl +truetype  243 kB
<snip>
Total size of downloads: 243 kB

This is because dillo has a "cjk? (http://...)" SRC_URI, which is 243k according to the digest. It's only a cosmetic issue, but it prevents me from using this output to decide whether yes or no I still have files to fetch before taking my laptop back home for an offline weekend :)

I can't think of any easy fix so far.
Comment 20 TGL 2003-12-16 02:45:22 UTC
Created attachment 22286 [details, diff]
display-size-fix.patch

Here is a patch that adds some SRC_URI parsing to "getsize", so that irrelevant
files are not added to the total size. It is mainly some code stolen from
doebuild, and solves the issue described in my above comment. 

Patch is against 2.0.50_pre1.
Comment 21 Marius Mauch (RETIRED) gentoo-dev 2004-02-08 17:55:21 UTC
supposed to be fixed in 2.0.50 which is stable now. If this bug is not fixed please reopen.