-
Notifications
You must be signed in to change notification settings - Fork 461
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(MODULES-1231) Fix apt::force locale issues #394
(MODULES-1231) Fix apt::force locale issues #394
Conversation
6776d8e
to
2447a5c
Compare
@greg0ire More code comments added. |
👍 great work |
As this changes a few things this also needs documentation updates about the fact that we now rely on GNU sed and GNU awk. |
Perhaps the better way to solve this though, instead of trying to support all different locales, is to simply set |
@daenney : I disagree, that would be really not clean. I think dpkg / apt must provide a clean way to do this in their API… maybe ask stack overflow ? |
Actually, this is exactly what
Apt/dpkg respects the |
Thank you for the explanation, it makes a lot of sense, and the solution seems quite acceptable with that in mind. |
|
Since this is an exec what I would do is leave the
That's exactly what the |
@juniorsysadmin : what do you think ? I think the former solution involves less unix pipes, and has been used for a long time, so it must be better to tweak than to change it radically… |
Uhm, why did this get added to |
Fixing it now. I thought I left a comment, but obviously not. Will put a comment when it's ready to be reviewed again. |
Perfect! |
The current $install_check variable greps for 'Installed' or 'Candidate', which means that it will give the wrong result when a non-English locale is used. This patch ensures that the check will work properly for non-English locales by setting the environment parameters for the exec to LC_ALL=C LANG=C
9a7f570
to
b737557
Compare
Rebased and retested with locales fr_FR.UTF-8 and en_US.utf8. The Debian-osfamily acceptance tests seem to have run successfully as well. Ready for a review again. |
👍. @mhaskel Could you be so kind to posit an opinion before I hit 'merge'? |
@daenney 👍 |
(MODULES-1231) Fix apt::force locale issues
Thanks @juniorsysadmin for your contribution! |
The current $install_check variable greps for 'Installed' or 'Candidate', which means that it will give the wrong results when a non-English locale is used. This patch ensures that the check will work properly for non-English locales.
I have done basic testing with locales fr_FR.UTF-8 and en_US.utf8.
I'm not sure how to create an acceptance test for this since it might require a re-login for locale changes to take effect.