The dependencies registry key will return all installed versions of
ports that a port depends on, and of course at most one can be active.
Only deactivate if there is no active version of the dep.
Doing this in response to low disk space had a higher chance of freeing
space by uninstalling something that was just built as a dependency of
the next build, meaning it would be immediately reinstalled.
This can happen for ports with huge numbers of variants. A failure of
failcache_success after a successful build would previously appear to
be a failure to build the port.
Ensure that archivefetch is not attempted at all in install_dep_source,
since we only get there if it already failed. This should prevent
failure from archivefetch getting a 503 for a signature again.
This is at best a poor and partial workaround, since archivefetch
failing for ports that have an archive available in the first place
means that those ports are unnecessarily built from source, and
furthermore, fetching the distfiles might fail the same way.
See: https://trac.macports.org/ticket/68563
The use of a global variable by mportexec means multiple invocations
can interfere if this is not done. Having to build deps at this stage
should be rare, so performance should not be impacted too much.
Doing this instead of using registry::run_target saves running another
mportopen for each dependency, so should perform better. This wasn't
originally possible due to the workaround for
https://trac.macports.org/ticket/24857.
The _archive_available check only looks at the public packages server.
There may still be an archive in a private location.
Fixes: https://trac.macports.org/ticket/67700