I’ve a problem with wanting to exclude content from packages that are pulled in transitively (because I need to get them from a content snap instead). I’m wondering if snapcraft has any tooling to assist in this?
Ideally, something like an option to “don’t stage any files from this package or dependencies”. But there’s no such thing as (by analogy with stage:):
In theory, that too can break. If a new file is added to the .deb and the consumer snap rebuilds before the supplier update is published to stable then that file won’t be cleaned. OTOH that is going to be rare and,even if it happens, the spurious file unlikely to a problem.
Do you have an example of a “cleanup part”? How does it run at the right time relative to other parts and how does it detect their content?
You could also use named YAML anchors or aliases, define the set of files you want removed in one part and then have all the stage: stanzas dereference that named anchor/alias and it will expand with the contents of the named one originally.