mini_buildd.changes module

class mini_buildd.changes.Changes(file_path)

Bases: debian.deb822.Changes

class Options(upload_changes)

Bases: object

Uploader options in changes.

>>> "{}".format(Changes("test-data/changes.options").options)
"auto-ports=['jessie-test-unstable', 'squeeze-test-snasphot'], ignore-lintian=True, ignore-lintian[i386]=False, internal-apt-priority=543, run-lintian=True, run-lintian[i386]=False"
>>> "{}".format(Changes("test-data/changes.magic").options)
"auto-ports=['jessie-test-unstable', 'squeeze-test-snasphot'], ignore-lintian=True"
class Bool(raw_value)

Bases: object

class Int(raw_value)

Bases: object

class CSV(raw_value)

Bases: object

KEYWORD = 'MINI_BUILDD_OPTION'
get(key, alt=None, default=None)

Get first existing option value in this order: key[a], key, default.

TYPE_DEFAULT = 0
TYPE_BREQ = 1
TYPE_BRES = 2
TYPE2FILENAME_ID = {0: '', 1: '_mini-buildd-buildrequest', 2: '_mini-buildd-buildresult'}
TYPE2NAME = {0: 'upload', 1: 'buildrequest', 2: 'buildresult'}
BUILDREQUEST_RE = re.compile('^.+_mini-buildd-buildrequest_[^_]+.changes$')
BUILDRESULT_RE = re.compile('^.+_mini-buildd-buildresult_[^_]+.changes$')
options

Note

We can’t parse this in constructor currently: Upload option error handling won’t work properly, exceptions triggered too early in packager.py.

type
classmethod gen_changes_file_name(package, version, arch, mbd_type=0)

Gen any changes file name.

Always strip epoch from version, and handle special mini-buildd types.

>>> Changes.gen_changes_file_name("mypkg", "1.2.3-1", "mips")
'mypkg_1.2.3-1_mips.changes'
>>> Changes.gen_changes_file_name("mypkg", "7:1.2.3-1", "mips")
'mypkg_1.2.3-1_mips.changes'
>>> Changes.gen_changes_file_name("mypkg", "7:1.2.3-1", "mips", mbd_type=Changes.TYPE_BREQ)
'mypkg_1.2.3-1_mini-buildd-buildrequest_mips.changes'
>>> Changes.gen_changes_file_name("mypkg", "7:1.2.3-1", "mips", mbd_type=Changes.TYPE_BRES)
'mypkg_1.2.3-1_mini-buildd-buildresult_mips.changes'
gen_file_name(arch, mbd_type)
classmethod gen_dsc_file_name(package, version)
dsc_name
dsc_file_name
bres_stat
file_name
file_path
buildlog_name
live_buildlog_name
get_live_buildlog_loc()
get_live_buildlog_url(base_url)
get_pkglog_dir(installed, relative=True)

Package log path for this changes file: REPOID/[_failed]/PACKAGE/VERSION/ARCH

In case the changes is bogus (i.e, cannot produce a valid path for us, like a wrong distribution), None is returned.

is_new()
get_spool_id()
get_spool_dir()
get_pkg_id(with_arch=False, arch_separator=':')
get_files(key=None)
add_file(file_name)
save(gnupg=None)

Write to file (optionally signed).

>>> import tempfile
>>> t = tempfile.NamedTemporaryFile()
>>> c = Changes(t.name)
>>> c["key"] = "ASCII value"
>>> c.save(None)
>>> c["key"] = "Ünicöde «value»"
>>> c.save(None)
upload(hopo)
upload_buildrequest(local_hopo)
tar(tar_path, add_files=None, exclude_globs=None)
untar(path)
move_to_pkglog(installed, rejected=False)
remove()
gen_buildrequests(daemon, repository, dist, suite_option)

Build buildrequest files for all architectures.

Todo

IDEA: gen_buildrequests(): Instead of tar’ing ourselves (uploaded changes) with exceptions (.deb, .buildinfo, .changes), add the .dsc and its files only!

gen_buildresult(path=None)
upload_failed_buildresult(gnupg, hopo, retval, status, exception)