We don't use os.makedirs(dir, exist_ok=True) as that is too strict: it fails if
the directory already exists with different permissions (e. g. with 775). Thus
introduce a helper function ensuredir().
Strip of Multi-Arch qualifiers ":any" and ":native" when building the
dependency fields, as they are not part of the package name.
This will fix cases like
Package: ipython3
Depends: python3:any (>= 3)
and include ipython3 in python3's reverse dependencies.
Closes: #794194
Doing this means that you can't use the hint tester for packages with
uppercase characters in the version, e.g.
Version mismatch, dreamchess 0.2.1-rc2-2build1 != 0.2.1-RC2-2build1
This fixes commit 497edc to really allow policies to see if the excuse has
already been invalidated by previous policies.
Signed-off-by: Niels Thykier <niels@thykier.net>
Cleanly split doop_source into a (small) part about source packages
and a (longer) part about binary packages.
Signed-off-by: Niels Thykier <niels@thykier.net>
Coverage suggests that the conditions are always true. If so, we can
replace the "elif" with a regular "if" - but for now, lets keep an
assert.
Signed-off-by: Niels Thykier <niels@thykier.net>
Add a check to ensure we do not create broken test data (as happened
recently, where the architecture values were swapped for a single
binary). A cold hard failure like this is easier to debug
compared to Britney playing "garbage in, garbage out".
Signed-off-by: Niels Thykier <niels@thykier.net>
Add some "no cover" to some unrecoverable exceptions
(e.g. misconfiguration) or base-class methods that are not intended to
be invoked.
Signed-off-by: Niels Thykier <niels@thykier.net>
doop_source never (no longer?) creates an element in "virtual" where
the package name is prefixed with "-", so we can drop that branch.
Signed-off-by: Niels Thykier <niels@thykier.net>
This gives Policies the opportunity to see if a previous check
(build/installability) or earlier policies already invalidated the update. This
allows writing policies that work on groups of packages, or skipping expensive
checks (such as triggering autopkgtests while the package is not built or
installable yet).
Signed-off-by: Niels Thykier <niels@thykier.net>