Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 2707 Details for
Bug 5566
Show total download size before starting
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Slightly better script (it works now too)
pkg-dlsize.pl (text/plain), 2.02 KB, created by
Alex Walker
on 2002-07-31 09:20:51 UTC
(
hide
)
Description:
Slightly better script (it works now too)
Filename:
MIME Type:
Creator:
Alex Walker
Created:
2002-07-31 09:20:51 UTC
Size:
2.02 KB
patch
obsolete
>#!/usr/bin/perl -w ># Gentoo package download size ># (C) Alex Walker 2002 ># alex@x3ja.co.uk ># ># This program is free software; you can redistribute it and/or modify it ># under the terms of the GNU General Public License as published by the Free ># Software Foundation; either version 2 of the License, or (at your option) ># any later version. ># ># This program is distributed in the hope that it will be useful, but ># WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ># or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ># for more details. ># ># You should have received a copy of the GNU General Public License along ># with this program; if not, write to the Free Software Foundation, Inc., 59 ># Temple Place, Suite 330, Boston, MA 02111-1307 USA ># ># Major problems: ># - Uses digest file to predict sizes - not all these files are used in the ># relative ebuild. ># - Can only put in one package at a time. > >use strict; >use Digest::MD5; > >my $debug; > >if ($ARGV[0] && $ARGV[0] eq "-d") { > $debug = 1; > shift @ARGV; >} > >unless ($ARGV[0] && $ARGV[1]) { > print "Need at least two arguments!\n"; > exit >} > >my ($category, $package) = split('/',"$ARGV[0]",2); >my $version = "$ARGV[1]"; >my $digestfile = "/usr/portage/$category/$package/files/digest-$package-$version"; >my $distfilepath = "/usr/portage/distfiles/"; >print "Category: $category\nPackage: $package\nVersion: $version\n" if $debug; > >open(DIGEST,'<',$digestfile) > or die "Can't open digest file file!"; > >my $togo = 0; >my $got = 0; >my $total = 0; > >while (<DIGEST>) { > chomp $_; > > my (undef,$md5,$file,$size) = split (' ',$_,4); > > print "File: $file\nSize: $size\nMD5 digest: $md5\n" if $debug; > $total = $total + $size; > > if (open(FILE, "$distfilepath/$file")) { > binmode(FILE); > my $filemd5 = Digest::MD5->new->addfile(*FILE)->hexdigest; > print "MD5 file: $filemd5\n" if $debug; > if ( $filemd5 eq $md5) { > $got = $got + $size; > next; > } > } > $togo = $togo + $size; >} > > > >print "Got: $got\nTo get: $togo\nTotal: $total\n" if $debug; > >print "$togo\n" >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 5566
:
2576
|
2577
| 2707