Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 250157

Summary: portage 2.1.4.5 little funny problem
Product: Gentoo Linux Reporter: Vytautas <vytautas1987>
Component: [OLD] Core systemAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: trivial    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Vytautas 2008-12-07 11:40:33 UTC
>>> Updating portage cache: 1324546570%

Reproducible: Always

Steps to Reproduce:
1.Press space one or few times while "Updating portage cache"

Actual Results:  
Ultra update > 100%

Expected Results:  
<100% update
Comment 1 Andrew Gaffney (RETIRED) gentoo-dev 2008-12-07 22:43:02 UTC
It's not actually counting wrong. You're just screwing up the output by injecting arbitrary characters into it. It's assumed that you're not going to do something like that, or that if you do, you wouldn't file a bug on it...
Comment 2 Zac Medico gentoo-dev 2008-12-08 01:05:37 UTC
The current code uses \b and makes assumptions about you not pressing any keys. This can solved by using \r and redrawing the whole line. 
Comment 3 Zac Medico gentoo-dev 2009-04-11 19:14:01 UTC
(In reply to comment #2)
> The current code uses \b and makes assumptions about you not pressing any keys.
> This can solved by using \r and redrawing the whole line. 

Note that this approach is vunerable to presses of the "Enter" key though, since that will bump it to a new line. To handle cases like that, I guess we'd have use ncurses.