repo: account for arch & version when filtering stage packages (#3461)
The filter should only contain package names, not including the
optional [:arch] or [=version] fields.
(1) Move the filter/no-filter logic out of apt_cache and introduce
a _get_filtered_stage_packages() helper in _deb to handle the
processing. Use newly introduced DebPackage to ensure consistency,
and do the same for get_packages_in_base().
(2) Update cross-compile spread test to incorporate the various
grammars.
Signed-off-by: Chris Patterson <email address hidden>
Many handlers of command errors are doing their own variant of
the same thing. This provides a standardized helper to use
details to provide command failure details.
Signed-off-by: Chris Patterson <email address hidden>
extensions: suppress realpath noise on headless systems (#3446)
When using extensions on systems where a desktop session has never run,
desktop-launch will create noise complaining that paths cannot be found.
Simply redirect the error messages to /dev/null.
E.G, running over SSH in Multipass, using snaps in a CLI environment.
Additionally, prevent behaviour where `rmdir $HOME` would be called
by ensuring the variable is not empty.
This is unlikely to have caused problems as rmdir would not delete directories
that have content, but it's probably better to not rely on semantics here.