If dpkg-gencontrol was involved in the creation of a package we will not
usually encounter empty or otherwise useless fields, but apparently not
everyone is using it.
It isn't recommended to have these empty lines, but it isn't too hard to
ignore for Provides as we did for dependencies already and apt-ftparchive
can be convinced to produce empty files (if you feed it such a package)
as well, so lets be nice and provide users with a more accepting parser.
Our autoremoval-advertisment is modified by SUDO_USER as if the current
apt call was made with sudo it seems a good idea to show the ad with
sudo as well. That is annoying for our tests through as normally the
tests are run locally or by autopkgtest without sudo, but in Gitlab CI
we use it (to run our tests as user… as we are already root) and so
individual tests had to deal with this.
That is annoying and really not needed as we can have our autoremove
test check that this ad gets displayed the right way and ignore it the
rest of the time.
We schedule reverse dependencies for an upgrade, but we shouldn't do it
if we have ear-marked this package for removal later on. Usually the
solver will end up doing the right thing like it already did in the
included testcase in the end, but given that before it reaches the right
end it explored a bad path which can lead to more installs and removals
influencing later decisions or are just too hard for the resolver to
undo later on, we can just not explore this path to begin with.
Match version constraints before saving garbage packages
We remove new garbage packages from the solution if we can as installing
a new package which is at the same time considered garbage looks silly,
but it could also be a new dependency of another garbage package, so we
have a second round trying to save such packages. In this round we
weren't considering versioned constraints on dependency relations through
so even an unsatisfied old recommends could save which it shouldn't.