Skip to content

Enhance mode parsing to support comma-separated mode strings in install command#9298

Merged
sylvestre merged 4 commits into
uutils:mainfrom
Vesal-J:vesal/fix-multiple-modes-install
Nov 17, 2025
Merged

Enhance mode parsing to support comma-separated mode strings in install command#9298
sylvestre merged 4 commits into
uutils:mainfrom
Vesal-J:vesal/fix-multiple-modes-install

Conversation

@Vesal-J

@Vesal-J Vesal-J commented Nov 15, 2025

Copy link
Copy Markdown
Contributor

Fixes #9250

…e` function. Add tests for comma-separated mode handling in file and directory creation.

/// Takes a user-supplied string and tries to parse to u16 mode bitmask.
/// Supports comma-separated mode strings like "ug+rwX,o+rX" (same as chmod).
pub fn parse(mode_string: &str, considering_dir: bool, umask: u32) -> Result<u32, String> {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

maybe write a unit test for this function :)

…g numeric, symbolic, and mixed modes, as well as handling of invalid inputs and umask considerations.
@Vesal-J

Vesal-J commented Nov 15, 2025

Copy link
Copy Markdown
Contributor Author

is this error relevant to my changes?

@oech3

oech3 commented Nov 16, 2025

Copy link
Copy Markdown
Contributor

is this error relevant to my changes?

No space left on device?

@codspeed-hq

codspeed-hq Bot commented Nov 16, 2025

Copy link
Copy Markdown

CodSpeed Performance Report

Merging #9298 will improve performances by 8.57%

Comparing Vesal-J:vesal/fix-multiple-modes-install (c4c78ba) with main (58ebeaf)

Summary

⚡ 1 improvement
✅ 123 untouched
⏩ 5 skipped1

Benchmarks breakdown

Benchmark BASE HEAD Change
factor_table 201.4 ms 185.5 ms +8.57%

Footnotes

  1. 5 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

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

@sylvestre

Copy link
Copy Markdown
Contributor

thanks!

It seems that mknod, mkfifo, and mkdir also supports this. I am not sure we support that if you want to have a look :)

@sylvestre sylvestre merged commit 7478749 into uutils:main Nov 17, 2025
126 checks passed
@Vesal-J

Vesal-J commented Nov 17, 2025

Copy link
Copy Markdown
Contributor Author

Sure

hubot pushed a commit to coreutils/coreutils that referenced this pull request Nov 18, 2025
Identified here:
<uutils/coreutils#9298>

* tests/install/basic-1.sh: Add the check.
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.

install accepts only singular mode, not comma separated as for chmod

3 participants