[Rpm-maint] [rpm-software-management/rpm] Regex support while packaging files with %ghost (Discussion #3480)
Shreenidhi Shedi
notifications at github.com
Sat Nov 30 10:29:54 UTC 2024
Is it possible to ghost a regex pattern while packaging files?
A good use case of of this I can think of is, while packaging python modules we can ghost all byte compiled `.pyc` files and upon package removal, these `.pyc` files will get auto removed.
For instance, I want to do:
```
%files
...
%{python3_sitelib}/cloudinit/__pycache__/*.pyc
...
```
Fedora currently packages all `.pyc` files along with rpm which makes package size bigger and many byte compiled files might just be present in the system without ever getting used.
Second question in the same context is:
Is it possible to own a directory fully in rpm, upon removal; the directory should get removed without bothering about the content within.
For the same use case as above:
```
%files
...
%ghost %dir %{python3_sitelib}/cloudinit/__pycache__/
...
```
All the .pyc files get generated at runtime when used and if package gets removed, `__pycache__` dir should be gone entirely.
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/discussions/3480
You are receiving this because you are subscribed to this thread.
Message ID: <rpm-software-management/rpm/repo-discussions/3480 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20241130/ff33f675/attachment.htm>
More information about the Rpm-maint
mailing list