Skip to content

Absolute Paths Support for Archives Creation#291

Merged
kaladron merged 4 commits into
uutils:mainfrom
zxvfc:support_absolute_paths_when_creating_archive
Jun 1, 2026
Merged

Absolute Paths Support for Archives Creation#291
kaladron merged 4 commits into
uutils:mainfrom
zxvfc:support_absolute_paths_when_creating_archive

Conversation

@zxvfc
Copy link
Copy Markdown
Contributor

@zxvfc zxvfc commented May 27, 2026

Added support of -P, --absolute-names for the creation of archive. Seems, that add support of absolute path for the extracting is requires changes in tar-rs library and can be done later.

Related to #213

@codecov
Copy link
Copy Markdown

codecov Bot commented May 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.80%. Comparing base (b4865da) to head (3fab307).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #291      +/-   ##
==========================================
+ Coverage   96.59%   96.80%   +0.21%     
==========================================
  Files           9        9              
  Lines         941     1003      +62     
  Branches       24       24              
==========================================
+ Hits          909      971      +62     
  Misses         31       31              
  Partials        1        1              
Flag Coverage Δ
macos_latest 96.80% <100.00%> (+0.21%) ⬆️
ubuntu_latest 96.80% <100.00%> (+0.21%) ⬆️
windows_latest 0.00% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Collaborator

@kaladron kaladron left a comment

Choose a reason for hiding this comment

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

One minor change within, and otherwise the patch looks good to me.

Comment thread src/uu/tar/src/operations/create.rs Outdated
if allow_absolute {
return Some(path.to_path_buf());
}
if path.is_absolute() {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think if you do:

    if path.is_absolute() && !allow_absolute {

The current else clause will just handle this correct as it falls back to:

        } else {
            path.to_path_buf()
        };

And then doesn't double the work.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ah yes, good point!
Fixed!

@kaladron kaladron merged commit 4986a84 into uutils:main Jun 1, 2026
17 checks passed
@kaladron
Copy link
Copy Markdown
Collaborator

kaladron commented Jun 1, 2026

Thanks for this! I've merged it. I did a last quick update of the git commit message to include more detail in case people need to find this commit later!

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.

2 participants