Replies: 6 comments
-
I can patch each spec file and do this in |
Beta Was this translation helpful? Give feedback.
-
Did you actually try it?
Yes, it's very common. Just drop the %dir because that specifically tells rpm that this entry is ONLY about the directory node itself, and not the contents. Whether it actually works in combination with %ghost I have no idea. As for your use-case for wanting to avoid bloating packages with redundant .pyc files: you might want to research the background as to why they are included in packages. There are multiple reasons for it, and none of them is "for fun". |
Beta Was this translation helpful? Give feedback.
-
Sorry for the confusion.
I am aware that regex works while packaging files. But I want to use regex with ghost files.
Both
This. I am trying it out and it doesn't work.
I understand your point, it's just a standard we are following in our distro. Thanks for the inputs. |
Beta Was this translation helpful? Give feedback.
-
It's not clear to me what exactly you're trying and how it's not working (like, what happens?), because there are two different things getting conflated: regex on %ghost, and a whole directory with its contents (as ghost), and these are mutually exclusive. |
Beta Was this translation helpful? Give feedback.
-
Here is the link to spec which I'm trying this with. https://github.com/vmware/photon/blob/master/SPECS/selinux-python/selinux-python.spec#L52 I added below lines after line 52.
And after building and installing package, I did
But if the ghost directives I used were effective, this should not have happened. Right? |
Beta Was this translation helpful? Give feedback.
-
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:
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:
All the .pyc files get generated at runtime when used and if package gets removed,
__pycache__
dir should be gone entirely.Beta Was this translation helpful? Give feedback.
All reactions