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

Bug 685854

Summary: `emerge --info` does not display information about memory and swap with non-English locales
Product: Portage Development Reporter: Arfrever Frehtes Taifersar Arahesis <arfrever.fta>
Component: Core - Interface (emerge)Assignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: normal Keywords: InVCS
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 686768    
Attachments: Patch

Description Arfrever Frehtes Taifersar Arahesis 2019-05-13 15:14:18 UTC
`emerge --info` does not display information about memory and swap with non-English locales:

KiB Mem:    XXXXXXXX total,  XXXXXXXX free
KiB Swap:   XXXXXXXX total,  XXXXXXXX free


This information is retrieved by portage.util._get_vm_info.get_vm_info() function which parses output of:
- On Linux:
    free
- Else:
    sysctl -a


I do not know if output of `sysctl -a` would be localized ("Free Memory Pages" string), but better to also force C locale for that command.
Comment 1 Arfrever Frehtes Taifersar Arahesis 2019-05-13 15:21:02 UTC
Created attachment 576468 [details, diff]
Patch
Comment 2 Larry the Git Cow gentoo-dev 2019-05-20 04:46:38 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=f69c2596ff6f483bec55c17918e4e17df6236b89

commit f69c2596ff6f483bec55c17918e4e17df6236b89
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>
AuthorDate: 2019-05-13 15:15:03 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2019-05-20 04:44:54 +0000

    get_vm_info: Set C locale for subprocesses.
    
    Parsing of localized output of subprocesses would fail, making
    `emerge --info` not display information about memory and swap.
    
    Bug: https://bugs.gentoo.org/685854
    Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 lib/portage/util/_get_vm_info.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)