Support a `-f|--file` or `-C|--directory` flag
What needs to get done
Add a flag to the snapcraft <pull|build|stage|prime|pack> subcommands which enables a user to specify the precise snapcraft.yaml file to use for a build or the directory in which one could be found.
Why it needs to get done
This does two things:
-
Aligns snapcraft with many other build system tools, such as
make,cmake, ormeson -
enable a single source-tree to potentially provide multiple variant builds of that source as slightly different snaps, without requiring entirely different snap packaging trees.
The second point is especially useful in the context of a monolithic snap project repository such as this, and in fact would be exceptionally useful for things like building Canonical kernel snaps (which already have a predilection for using things like a debian.<flavour> directory for these kinds of things). In short, it makes things like derivative kernels (or derivative "snaps", if there is such a concept) far easier to maintain and build.