Handle including git subdir like "ubuntu.noble/languages"
Previously, to check out seeds in Bazaar repos, we use
notations like "ubuntu.noble/languages" to indicate checking
out "languages" subdirectory inside "noble" branch.
This workaround is to ensure the backward compatibility with
bzr repos. However, this implies we cannot include "/" in
git branch name, otherwise it will be recognized as a
subdirectory name in germinate.
Git itself does not provide a convenient function to check
out a subdirectory of a repo, therefore we remove the path
and attempt to check out the entire repo, which it might be
previously checked out.
With virtualenv being in the deps, it will install virtualenv
from/matching the host into the tox directory, rather than the
latest virtualenv, which then makes CI work again.
Allow seeds to declare alternative dependencies as fallbacks
These are not resolved further, but only added to the generated meta
package dependencies.
The design decision here is to impact as little as possible, so instead
of modifying the seed entries to track the alternatives there, we track
the alternatives in a separate per-seed dictionary.
When writing out the dependency files with germinate-update-metapackage,
we reconstruct the alternatives when generating the package list. An
alternative approach would be to reconstruct the alternatives during the
write out only, or record them in separate files, but doing it at the
list levels allows the delta to be calculated, for example, changing
`systemd-timesyncd` seed entry to `systemd-timesyncd | time-daemon`
yield:
* Refreshed dependencies
* Added systemd-timesyncd | time-daemon to cloud-minimal
* Removed systemd-timesyncd from cloud-minimal
Arguably it would be nice to resolve alternatives further, but doing
so would require significantly more effort.
The change to the `systemd-timesyncd` seed entry above that this enables
allows us to:
- apt install chrony after installing the task
- apt install ubuntu-cloud-minimal chrony in one go
But it still prevents us from `apt install cloud-minimal^ chrony` using
the `cloud-minimal^` task expansion as that still resolves to
systemd-timesyncd.