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

[FR]: Add add_package_dirs option to mtree_mutate #902

Open
maxitg opened this issue Aug 14, 2024 · 2 comments
Open

[FR]: Add add_package_dirs option to mtree_mutate #902

maxitg opened this issue Aug 14, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@maxitg
Copy link

maxitg commented Aug 14, 2024

What is the current behavior?

Currently, mtree_mutate wouldn't add new directories specified by package_dir, as it only appends it to existing lines.

However, if, e.g., package_dir is /opt/app, there will be no entries for opt or opt/app. As a result, in some cases, e.g., if the tar archive is used for a DEB package, the package installation would fail with an error like this:

error creating directory 'opt/app/app_data': No such file or directory

This is different from the behavior of pkg_tar from rules_pkg.

Describe the feature

I suggest to add an add_package_dirs option to mtree_mutate, which would add lines such as

opt uid=0 gid=0 time=1672560000 mode=0755 type=dir
opt/app uid=0 gid=0 time=1672560000 mode=0755 type=dir

to the beginning of the mtree, using custom mtree, owner, and ownername if specified.

I can make a PR if there are no objections.

@maxitg maxitg added the enhancement New feature or request label Aug 14, 2024
@thesayyn
Copy link
Collaborator

thesayyn commented Nov 1, 2024

That sounds reasonable, go for it.

@thesayyn
Copy link
Collaborator

thesayyn commented Nov 1, 2024

We don't even need an attribute IMO, it should just create the directory just in case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants