mini_buildd.dist module

Distribution setups && support

Dist-like variable naming convention

  • diststr: Instance of str: “buster-test-unstable”

  • dist: Instance of mini_buildd.dist.Dist: diststr parsed && support

  • distribution: Instance of mini_buildd.model.distribution.Distribution: Configured distribution

class mini_buildd.dist.Archs

Bases: object

Deliver lists of Debian architectures the current system can handle

classmethod native()
classmethod available()
class mini_buildd.dist.DistroInfo(distro: str)

Bases: DistroInfo

mbd_origin()
mbd_release(codename)
abstract mbd_lts()
class mini_buildd.dist.DebianDistroInfo

Bases: DistroInfo, DebianDistroInfo

mbd_lts()

Tip

What does LTS (mini-buildd speak) include for Debian?

For mini-buildd, LTS means Debian Long Term Support (LTS) including Debian Extended Long Term Support (ELTS).

See: https://www.debian.org/lts/, https://wiki.debian.org/LTS/Extended

class mini_buildd.dist.UbuntuDistroInfo

Bases: DistroInfo, UbuntuDistroInfo

mbd_lts()

Tip

What does LTS (mini-buildd speak) include for Ubuntu?

For mini-buildd, LTS means Ubuntu Long Term Support (LTS) including Ubuntu Extended Security Maintenance (ESM).

See: https://ubuntu.com/about/release-cycle

mini_buildd.dist.DISTRO_INFO = {'Debian': <mini_buildd.dist.DebianDistroInfo object>, 'Ubuntu': <mini_buildd.dist.UbuntuDistroInfo object>}

Available distro infos

mini_buildd.dist.setup_origins()
mini_buildd.dist.setup_codenames()
mini_buildd.dist.setup_codenames_from_origin(origin, modifier='')
mini_buildd.dist.di_codenames()
mini_buildd.dist.guess_origin(codename)

Guess Origin from codename

>>> guess_origin("rex")  # only via distro info
'Debian'
>>> guess_origin("warty")  # only via distro info
'Ubuntu'
>>> guess_origin("bullseye")  # via setup
'Debian'
mini_buildd.dist.is_base_source(origin, codename)

Heuristics (for setup) whether this is a base source

mini_buildd.dist.DEBIAN_MAJOR_MINOR_CODENAMES = ['buzz', 'rex', 'bo', 'hamm', 'slink', 'potato', 'woody', 'sarge', 'etch', 'lenny', 'squeeze']

List of Debian codenames using something 3.1 as main version (all <= squeeze)

mini_buildd.dist.guess_codeversion(origin, codename, version)

Get recommended codeversion from origin/codename/version triple

codename is essentially one number representing the release version, which can later be used as in mandatory version part, or for sorting codenames.

version may be from a Release file (like ‘11.3’ for bullseye), or from distro-info-data (just ‘11’). If empty, ~CODENAME is returned.

Some heuristics (tailored for Debian and Ubuntu, but may work fine for other origins) are applied to produce a reasonable codeversion.

In Debian,
  • point release <= sarge had the ‘M.PrN’ syntax (with 3.1 being a major release).

  • point release in squeeze used ‘M.0.N’ syntax.

  • point releases for >= wheezy have the ‘M.N’ syntax (with 7.1 being a point release).

  • testing and unstable do not gave a version in Release and fall back to uppercase codename

Ubuntu just uses YY.MM which we can use as-is.

>>> guess_codeversion("Debian", "sarge", "3.1r8")
'31'
>>> guess_codeversion("Debian", "etch", "4.0r9")
'40'
>>> guess_codeversion("Debian", "squeeze", "6.0.6")
'60'
>>> guess_codeversion("Debian", "wheezy", "7.0")
'7'
>>> guess_codeversion("Debian", "wheezy", "7.1")
'7'
>>> guess_codeversion("Ubuntu", "quantal", "12.10")
'1210'
class mini_buildd.dist.Codename(codename, origin='', version='')

Bases: object

setup_extra_sources()
setup_distribution_options()
setup_chroot_options()
setup_arch_optional()
setup_components()
class mini_buildd.dist.SbuildCheck(checker, mode)

Bases: object

Generic support for sbuild checks (lintian, piuparts, autopkgtest)

>>> SbuildCheck("lindian", "disabled")  
Traceback (most recent call last):
...
util.HTTPBadRequest: Unknown sbuild checker: lindian (valid options: lintian,piuparts,autopkgtest) (HTTP 400 Bad request syntax or unsupported method)
>>> SbuildCheck("lintian", "warnfall")  
Traceback (most recent call last):
...
util.HTTPBadRequest: Unknown sbuild check mode: warnfall (valid options: DISABLED,IGNORE,ERRFAIL,WARNFAIL) (HTTP 400 Bad request syntax or unsupported method)
>>> sc = SbuildCheck("lintian", "warnfail")
>>> sc.checker
'lintian'
>>> sc.mode
<Mode.WARNFAIL: 3>
class Mode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

DISABLED = 0
IGNORE = 1
ERRFAIL = 2
WARNFAIL = 3
CHECKERS = ['lintian', 'piuparts', 'autopkgtest']
CHOICES = [(0, 'DISABLED'), (1, 'IGNORE'), (2, 'ERRFAIL'), (3, 'WARNFAIL')]
STATUSES_PASS = ['pass', 'info']

From sbuild source code: We may expect these textual statuses:

STATUSES_WARN = ['warn', 'no tests']
STATUSES_FAIL = ['error', 'fail']
classmethod desc()
classmethod usage()
check(status, ignore=False)

Check if status is ok in this mode

class mini_buildd.dist.Dist(diststr)

Bases: object

A mini-buildd distribution string

Normal distribution:

>>> d = Dist("squeeze-test-stable")
>>> d.codename, d.repository, d.suite
('squeeze', 'test', 'stable')
>>> d.get()
'squeeze-test-stable'

Rollback distribution:

>>> d = Dist("squeeze-test-stable-rollback5")
>>> d.is_rollback
True
>>> d.get(rollback=False)
'squeeze-test-stable'
>>> d.codename, d.repository, d.suite, d.rollback
('squeeze', 'test', 'stable', 'rollback5')
>>> d.get()
'squeeze-test-stable-rollback5'
>>> d.rollback_no
5

Malformed distributions:

>>> Dist("-squeeze-stable")  
Traceback (most recent call last):
...
util.HTTPBadRequest: Malformed distribution '-squeeze-stable': Must be '<codename>-<repoid>-<suite>[-rollback<n>]' (HTTP 400 Bad request syntax or unsupported method)
>>> Dist("squeeze--stable")  
Traceback (most recent call last):
...
util.HTTPBadRequest: Malformed distribution 'squeeze--stable': Must be '<codename>-<repoid>-<suite>[-rollback<n>]' (HTTP 400 Bad request syntax or unsupported method)
>>> Dist("squeeze-test-stable-")  
Traceback (most recent call last):
...
util.HTTPBadRequest: Malformed distribution 'squeeze-test-stable-': Must be '<codename>-<repoid>-<suite>[-rollback<n>]' (HTTP 400 Bad request syntax or unsupported method)
>>> Dist("squeeze-test-stable-rollback")  
Traceback (most recent call last):
...
util.HTTPBadRequest: Malformed distribution 'squeeze-test-stable-rollback': Must be '<codename>-<repoid>-<suite>[-rollback<n>]' (HTTP 400 Bad request syntax or unsupported method)
>>> Dist("squeeze-test-stable-rolback0")  
Traceback (most recent call last):
...
util.HTTPBadRequest: Malformed distribution 'squeeze-test-stable-rolback0': Must be '<codename>-<repoid>-<suite>[-rollback<n>]' (HTTP 400 Bad request syntax or unsupported method)
get(rollback=True)