Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 207550 Details for
Bug 289724
[PATCH-provided] much faster --pretend processing for app-portage/genlop
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch to improve the speed of genlop -p
fast-genlop.patch (text/plain), 3.95 KB, created by
Jean-Philippe Robichaud
on 2009-10-19 14:01:45 UTC
(
hide
)
Description:
patch to improve the speed of genlop -p
Filename:
MIME Type:
Creator:
Jean-Philippe Robichaud
Created:
2009-10-19 14:01:45 UTC
Size:
3.95 KB
patch
obsolete
>--- genlop 2009-10-19 09:50:12.000000000 -0400 >+++ genlop.fast 2009-10-19 09:49:59.000000000 -0400 >@@ -567,36 +567,72 @@ > print; > } > } >- my $last_ebuild; >- foreach my $ebuild_arg (@targets) >- { >+ my $last_ebuild; > >- # we track the last ebuild processed with $last_ebuild variable >- $last_ebuild = $ebuild_arg; >- $ebuild_arg =~ s/(\+)/\\$1/g; >- foreach my $logfile (@logfiles) >+ my %pkg_times; >+ my %local_pkg_times; >+ foreach my $logfile (@logfiles) >+ { >+ my $handle; >+ my $pkg_name; >+ open_file($logfile, \$handle); >+ foreach (<$handle>) > { >- my $handle; >- open_file($logfile, \$handle); >- foreach (<$handle>) >+ if (m/^(\d+):\s+>>>\s+emerge \(\d+ of \d+\) ([^ ]+) to/) > { >- if (m/^(.*?)\: \>\>\> emerge.*?\/$ebuild_arg-[0-9].*/) >- { >- $e_start = $1; >- } >- if (m/^(.*?)\: ::: completed .*?\) .*\/$ebuild_arg-[0-9].* to \//) >- { >- $e_end = $1; >- $tm_secondi += ($e_end - $e_start); >- $e_count++; >+ my $e_start = $1; >+ my $pkg_name = $2; >+ $local_pkg_times{$pkg_name}{e_start} = $e_start; >+ #print $_; print "e_start = [$e_start] pkg_name = [$pkg_name]\n"; >+ } >+ if (m/^(\d+):\s+:::\s+completed emerge \(\d+ of \d+\) ([^ ]+) to/) >+ { >+ my $e_end = $1; >+ my $pkg_name = $2; >+ if($local_pkg_times{$pkg_name}{e_start} > 0) { >+ #TODO: also consider stripping the version number out >+ # to allow merging stats across versions... >+ $e_start = $local_pkg_times{$pkg_name}{e_start}; >+ $pkg_times{$pkg_name}{e_count}++; >+ $pkg_times{$pkg_name}{tm_secondi} += ($e_end - $e_start); >+ >+ $pkg_name=~m|^.*/(.*?)-\d|; >+ my $tgt = $1; >+ $pkg_times{$tgt}{e_count}++; >+ $pkg_times{$tgt}{tm_secondi} += ($e_end - $e_start); >+ #print "e_end = [$e_end] e_count[$pkg_times{$pkg_name}{e_count}] pkg_name = [$pkg_name]\n"; > } > } > } >+ } >+ foreach my $pkg_name (keys(%pkg_times)) { >+ my $ec = $pkg_times{$pkg_name}{e_count}; >+ my $tm = $pkg_times{$pkg_name}{tm_secondi}; >+ #if($ec == 0) { print "Strange package: $pkg_name\n"; next; } >+ $pkg_times{$pkg_name}{m_secondi} = ($tm / $ec); >+ } >+ >+ >+ foreach my $ebuild_arg (@targets) >+ { >+ # we track the last ebuild processed with $last_ebuild variable >+ $last_ebuild = $ebuild_arg; >+ $ebuild_arg =~ s/(\+)/\\$1/g; >+ >+ if(defined($pkg_times{$last_ebuild})){ >+ $e_count = $pkg_times{$last_ebuild}{e_count}; >+ $tm_secondi = $pkg_times{$last_ebuild}{tm_secondi}; >+ gtime( ($tm_secondi / $e_count)); >+ my $hstr = (($days * 24) + $hours > 0)?(sprintf("%2dh", ($days * 24) + $hours)):(sprintf("%2s ", "")); >+ my $mstr = ($mins > 0)?(sprintf("%2dm", $mins)):(sprintf("%2s ", ""));; >+ my $sstr = ($secs > 0)?(sprintf("%2ds", $secs)):(sprintf("%2s ", ""));; >+ printf("%30s [%3s %3s %3s]\n", $last_ebuild, $hstr, $mstr, $sstr); >+ } >+ > if ($e_count == 0) > { > if ($online_query) > { >- > #query gentoo.linuxhowtos.org > $tm_secondi += lhtoquery($last_ebuild, \$e_count); > }
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 Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 289724
: 207550 |
253639