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/3...@github.com>
_______________________________________________
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
https://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to