repo: only install build packages marked for installation (#3411)
Ubuntu usage of apt_cache.get_marked_packages() assumes any
marked package is marked for installation. However, it may
contain packages marked for deletion.
Modify get_marked_packages() to get_packages_marked_for_installation()
to accurately capture the required build packages to install. Apt
will handle deletion as necessary.
Signed-off-by: Chris Patterson <email address hidden>
project loader: advanced grammar support for lists (#3360)
The grammar expects that it always works with a list of strings,
and treats those string primitives as a set.
This works for all of the current grammar usage which acts on
lists that are intended to work as sets. But it will fail when
expanded to work on other cases where ordering matters (e.g.
build-environment), or when primtives are not a string (e.g.
build-environment objects).
This is addressed by:
- Converting all grammars' set usage into lists.
- Updating GrammarProcessor to allow it to parse dictionaries
and treat unhandled section dictionaries as primitives.
- Update the part grammar to convert the returned lists into
sets for the currently used properties.
- Immediately process finalized statements to ensure ordering
is consistent (rather than processing all statements at the
end). Remove StatementCollection.process_all() now that it
is unused.
pluginhandler: do not walk symlinks for include filesets (#3406)
When generating the include file set, snapcraft will walk through
symlinks. This effectively results in being unable to filter out
anything that itself, or parent is pointed to by an external symlink.
e.g. bin -> usr/bin will prevent filtering anything under usr/bin.
This is because snapcraft will include 'bin/foo' even though 'bin'
is a symlink. Subsequently, it will then preserve 'usr/bin/foo'.
Avoid this by simply checking if target is a link before walking
it.
Signed-off-by: Chris Patterson <email address hidden>