Provide option to filter stage packages
Metadata
Current evaluation
No evaluation has been recorded for this issue yet.
Issue body
### What needs to get done
When migrating from base `core22` to `core24` my snap unexpectedly grew in size by 70%.
While inspecting the resulting manifests, it appears that way more stage packages were pulled in unnecessarily. Be this the result of the deb package dependency change or something else, the runtime requirements of the snap did not change.
Rather than filter excess files individually, an ideal option would be to allow filtering on the stage package level.
For example:
```
stage-packages:
- abootimg
- bash
- bash-completion
- bc
- -adduser
- -llvm
```
Example snap to reproduce the issue:
https://github.com/kubiko/toolbox/tree/22
https://github.com/kubiko/toolbox/tree/24
Resulting manifests:
[base `core22` manifest](https://paste.ubuntu.com/p/vcMKhdwyfP/)
[base `core24` manifest](https://paste.ubuntu.com/p/NS4jYZwwjq/)
### Why it needs to get done
Allow additional syntax in the `stage-packages` definition, allowing filtering on the stage package level.
Evaluation history
No evaluation history available.