Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 685854 - `emerge --info` does not display information about memory and swap with non-English locales
Summary: `emerge --info` does not display information about memory and swap with non-E...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Interface (emerge) (show other bugs)
Hardware: All All
: Normal normal
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 686768
  Show dependency tree
 
Reported: 2019-05-13 15:14 UTC by Arfrever Frehtes Taifersar Arahesis
Modified: 2019-08-01 19:20 UTC (History)
0 users

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


Attachments
Patch (portage.patch,1.53 KB, patch)
2019-05-13 15:21 UTC, Arfrever Frehtes Taifersar Arahesis
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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(-)