Skip to content
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

sort: support percent arguments to -S option #7181

Merged
merged 3 commits into from
Jan 23, 2025

Conversation

jfinkels
Copy link
Collaborator

Add support for parsing percent arguments to the -S option. The given
percentage specifies a percentage of the total physical memory. For
Linux, the total physical memory is read from /proc/meminfo. The
feature is not yet implemented for other systems.

In order to implement the feature, the uucore::parser::parse_size
function was updated to recognize strings of the form NNN%.

Fixes #3500

Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)

Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)
Congrats! The gnu test tests/misc/usage_vs_getopt is no longer failing!

Copy link

GNU testsuite comparison:

GNU test failed: tests/misc/stdbuf. tests/misc/stdbuf is passing on 'main'. Maybe you have to rebase?
Congrats! The gnu test tests/misc/usage_vs_getopt is no longer failing!

Add support for parsing percent arguments to the `-S` option. The given
percentage specifies a percentage of the total physical memory. For
Linux, the total physical memory is read from `/proc/meminfo`. The
feature is not yet implemented for other systems.

In order to implement the feature, the `uucore::parser::parse_size`
function was updated to recognize strings of the form `NNN%`.

Fixes uutils#3500
@jfinkels jfinkels marked this pull request as ready for review January 20, 2025 21:25
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)


/// Get the total number of bytes of physical memory.
///
/// TODO Implement this for non-Linux systems.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you please open a new issue for this?

Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/misc/stdbuf (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)

@sylvestre sylvestre merged commit ceb0785 into uutils:main Jan 23, 2025
65 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sort: -S/--buffer-size does not support memory percentages %
2 participants