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

#132: untar preserves unix file permissios #185

Conversation

MattesMrzik
Copy link
Contributor

@MattesMrzik MattesMrzik commented Jan 17, 2024

Partly fixes #132.
The untar bug of #132 is fixed. Unzipping while preserving file permissions is still missing.
Also wrote a test for untar.

also wrote a test for untar.
Unzip still does not preserve file permissions
@MattesMrzik MattesMrzik self-assigned this Jan 17, 2024
@coveralls
Copy link
Collaborator

coveralls commented Jan 17, 2024

Pull Request Test Coverage Report for Build 7667343336

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 91 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.1%) to 55.661%

Files with Coverage Reduction New Missed Lines %
com/devonfw/tools/ide/io/FileAccessImpl.java 91 54.81%
Totals Coverage Status
Change from base Build 7626444199: 0.1%
Covered Lines: 3533
Relevant Lines: 6099

💛 - Coveralls

@MattesMrzik
Copy link
Contributor Author

Currently, zip archives are unpacked using ZipArchiveInputStream. To preserve file permissions on Unix systems, the method ZipArchiveEntry.getExternalAttributes() must be used, but ZipArchiveInputStream is unable to fill this field, you must use ZipFile if you want to read entries using this attribute.

So either we refactor the unpack() method to use ZipFile instead of ZipArchiveInputStream. Or check if the file system uses posix file permissions and call a method that uses ZipFile to extract the permissions.

- removed the code I experimented with regarding the Zip extraction, which will probably get addressed in a different PR.
- the tar extraction tests now test NONE, GZ, and BZIP2 compression
@MattesMrzik MattesMrzik marked this pull request as ready for review January 18, 2024 14:21
@MattesMrzik MattesMrzik removed their assignment Jan 18, 2024
Copy link
Member

@hohwille hohwille left a comment

Choose a reason for hiding this comment

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

@MattesMrzik Thanks for this PR. Great work. You nailed it from the start. 👍
Ready for merge.

@hohwille hohwille merged commit e180912 into devonfw:main Jan 26, 2024
4 checks passed
@hohwille
Copy link
Member

@MattesMrzik now the workaround (was it in AwsCommandlet) could be removed, correct?

@hohwille hohwille added this to the release:2024.02.001 milestone Jan 26, 2024
@MattesMrzik
Copy link
Contributor Author

@MattesMrzik now the workaround (was it in AwsCommandlet) could be removed, correct?

Not yet. Aws uses zip instead of tar and permissions are not yet conserved when extracting zip on unix.

@hohwille hohwille added the story-review marks PRs that will be presented in the sprint-review label May 3, 2024
@hohwille hohwille added the reviewed Marks PRs that have been presented in the sprint-review meeting or that do not need to be presented. label Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
reviewed Marks PRs that have been presented in the sprint-review meeting or that do not need to be presented. story-review marks PRs that will be presented in the sprint-review
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

Extracting files on Linux doesn't preserve file permissions
3 participants