Django modules package.
All models must provide a an admin meta class as ‘Model.Admin’.
Call this after your django app is configured.
Generic module for models of the django app mini_buildd.
All model class names and all field names must be human readable with no abbrevations (as django, per default, displays the internal names intelligently to the end user).
Model class names must be in CamelCase.
Field names must be all lowercase and seperatedy by underscores.
For example, don’t try to do sort of “grouping” using names like:
email_notify
email_allow_regex
This should rather read:
notify
allow_emails_to
To group fields together for the end user, use AdminModel’s fieldset option.
Methods that represent mini-buildd logic should go into the models directly, but must be prefixed with “mbd_”. This avoids conflicts with method names form the django model’s class, but still keeps the logic where it belongs.
Bases: django.db.models.base.Model
Abstract father model for all mini-buildd models.
This just makes sure no config is changed or deleted while the daemon is running.
Bases: django.contrib.admin.options.ModelAdmin
alias of Subscription
Like get_or_create, but adds a info message.
Bases: mini_buildd.models.base.Model
Abstract model class for all models that carry a status. See Manual: Configuration.
Bases: mini_buildd.models.base.Admin
Try to run action on each object in queryset, emit error message on failure, but don’t fail ourself.
Run prepare, check, and activate for all objects of this model
Field temporarily implemented as extra_option.
Note
Currently using 6 days as default value – as it copes better with the current setup to restart mini-buildd weekly (via cron.weekly) to actually achieve automated checking.
Bases: mini_buildd.models.base.StatusModel
Chroot(id, extra_options, pickled_data, status, last_checked, auto_reactivate, source_id, architecture_id, personality, personality_override)
Bases: mini_buildd.models.base.Admin
Forbid change source/arch on existing chroot (we would loose the path to the associated data).
Bases: django.core.exceptions.ObjectDoesNotExist
Bases: django.core.exceptions.MultipleObjectsReturned
Subclasses may implement this to do extra backend checks.
mini-buildd <= 1.0.4 created chroots with a “sudo workaround” for bug https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=607228.
Suche chroots must be recreated, and no longer used.
Holds all keys from the source to verify the release via debootstrap’s –keyring option.
Subclasses may implement this to do define an extra preliminary sequence.
Bases: mini_buildd.models.chroot.Chroot
Dir chroot backend.
Bases: mini_buildd.models.chroot.Admin
Bases: mini_buildd.models.chroot.DoesNotExist
Bases: mini_buildd.models.chroot.MultipleObjectsReturned
Bases: mini_buildd.models.chroot.Chroot
File chroot backend.
Bases: mini_buildd.models.chroot.Admin
alias of FileChroot
Bases: mini_buildd.models.chroot.DoesNotExist
Bases: mini_buildd.models.chroot.MultipleObjectsReturned
Bases: mini_buildd.models.chroot.Chroot
LVM chroot backend.
Bases: mini_buildd.models.chroot.Admin
Bases: mini_buildd.models.chroot.DoesNotExist
Bases: mini_buildd.models.chroot.MultipleObjectsReturned
Bases: mini_buildd.models.chroot.LVMChroot
Loop LVM chroot backend.
Bases: mini_buildd.models.chroot.Admin
alias of LoopLVMChroot
Bases: mini_buildd.models.chroot.DoesNotExist
Bases: mini_buildd.models.chroot.MultipleObjectsReturned
Bases: mini_buildd.models.base.StatusModel
Daemon(id, extra_options, pickled_data, status, last_checked, auto_reactivate, identity, hostname, email_address, gnupg_template, gnupg_keyserver, ftpd_bind, ftpd_options, build_queue_size, sbuild_jobs, smtp_server, allow_emails_to, custom_hooks_directory, show_last_packages, show_last_builds, wait_for_build_results, keep_build_results)
Bases: mini_buildd.models.base.Admin
Always update date the daemon object to model.
Bases: django.core.exceptions.ObjectDoesNotExist
Bases: django.core.exceptions.MultipleObjectsReturned
Just warn in case there are no repos and no chroots.
All active or to-be active repositories, remotes and chroots.
Bases: mini_buildd.models.gnupg.GnuPGPublicKey
AptKey(id, extra_options, pickled_data, status, last_checked, auto_reactivate, key_id, key, key_long_id, key_created, key_expires, key_name, key_fingerprint)
Bases: django.core.exceptions.ObjectDoesNotExist
Bases: django.core.exceptions.MultipleObjectsReturned
Bases: mini_buildd.models.base.StatusModel
Bases: mini_buildd.models.base.Admin
Bases: mini_buildd.models.base.Meta
Checks that we actually have the key and long_id. This should always be true after “prepare”.
Bases: mini_buildd.models.gnupg.GnuPGPublicKey
Abtract class for GnuPG keys that influence the daemon’s keyring.
This basically means changes to remotes and users may be done on the fly (without stopping the daemon), to make this maintenance practically usable.
Bases: mini_buildd.models.base.Meta
Bases: mini_buildd.models.gnupg.KeyringKey
Remote(extra_options, pickled_data, status, last_checked, auto_reactivate, key_id, key, key_long_id, key_created, key_expires, key_name, key_fingerprint, http, wake_command)
Bases: mini_buildd.models.gnupg.Admin
Bases: django.core.exceptions.ObjectDoesNotExist
Bases: django.core.exceptions.MultipleObjectsReturned
Check whether the remote mini-buildd is up, running and serving for us.
Bases: mini_buildd.models.gnupg.KeyringKey
Uploader(id, extra_options, pickled_data, status, last_checked, auto_reactivate, key_id, key, key_long_id, key_created, key_expires, key_name, key_fingerprint, user_id)
Bases: mini_buildd.models.gnupg.Admin
Bases: django.core.exceptions.ObjectDoesNotExist
Bases: django.core.exceptions.MultipleObjectsReturned
Automatically create a user profile with every user that is created
Message log: Logs that should also go to the end user.
An instance of MsgLog may replace the standard (python) log; logs will also go to the django messaging system, and it also stores the logs so they might used for other (non-django) uses.
Logs done via MsgLog (aka “messages”) are intended for the end user, to be shown in an UI (for us, the django web app or the command line client).
Log coding idioms to be used:
# Optional: Alias for MsgLog class in modules where we need it
from mini_buildd.models.msglog import MsgLog
# Always: Global standard LOG object, directly after imports)
LOG = logging.getLogger(__name__)
# Standard log
LOG.info("blah blah")
# Message log
MsgLog(LOG, request).info("Dear user: blah blah")
Bases: mini_buildd.models.base.Model
ArchitectureOption(id, extra_options, pickled_data, architecture_id, distribution_id, optional, build_architecture_all)
Bases: django.core.exceptions.ObjectDoesNotExist
Bases: django.core.exceptions.MultipleObjectsReturned
Bases: django.contrib.admin.options.TabularInline
alias of ArchitectureOption
Bases: mini_buildd.models.base.Model
Distribution(id, extra_options, pickled_data, base_source_id, build_dep_resolver, apt_allow_unauthenticated, lintian_mode, lintian_extra_options, piuparts_mode, piuparts_extra_options, piuparts_root_arg, chroot_setup_script, sbuildrc_snippet)
Bases: mini_buildd.models.base.Admin
Add default distribution objects for all base sources found.
alias of Distribution
Bases: django.core.exceptions.ObjectDoesNotExist
Bases: django.core.exceptions.MultipleObjectsReturned
When the distribution changes, all repos that use that distribution also change.
Bases: mini_buildd.models.base.Model
EmailAddress(extra_options, pickled_data, address, name)
Bases: mini_buildd.models.base.Admin
alias of EmailAddress
Bases: django.core.exceptions.ObjectDoesNotExist
Bases: django.core.exceptions.MultipleObjectsReturned
Bases: mini_buildd.models.base.Model
Layout(extra_options, pickled_data, name, default_version, mandatory_version_regex, experimental_default_version, experimental_mandatory_version_regex)
Bases: mini_buildd.models.base.Admin
Create default layouts and suites.
Bases: django.core.exceptions.ObjectDoesNotExist
Bases: django.core.exceptions.MultipleObjectsReturned
When the layout changes, all repos that use that layout also change.
Bases: mini_buildd.models.base.StatusModel
Repository(extra_options, pickled_data, status, last_checked, auto_reactivate, identity, layout_id, allow_unauthenticated_uploads, extra_uploader_keyrings, notify_changed_by, notify_maintainer, reprepro_morguedir, external_home_url)
Bases: mini_buildd.models.base.Admin
Forbid change identity on existing repository.
Add developer repository ‘debdev’, only for sid.
Add sandbox repository ‘test’.
alias of Repository
Bases: django.core.exceptions.ObjectDoesNotExist
Bases: django.core.exceptions.MultipleObjectsReturned
Return a list with all full distributions strings, optionally matching a suite options filter (unstable, experimental,...).
Get complete DSC URL of an installed package.
Install a dict arch:bres of successful build results.
Result is of the form:
Idempotent repository preparation. This may be used as-is as mbd_sync.
Bases: mini_buildd.models.base.Model
Suite(id, extra_options, pickled_data, name)
Bases: mini_buildd.models.base.Admin
Bases: django.core.exceptions.ObjectDoesNotExist
Bases: django.core.exceptions.MultipleObjectsReturned
Bases: mini_buildd.models.base.Model
SuiteOption(id, extra_options, pickled_data, layout_id, suite_id, uploadable, experimental, migrates_to_id, build_keyring_package, auto_migrate_after, not_automatic, but_automatic_upgrades)
Bases: django.core.exceptions.ObjectDoesNotExist
Bases: django.core.exceptions.MultipleObjectsReturned
Compute number that may be used to sort suites from ‘stable’ (0) towards ‘experimental’.
Rollback field temporarily implemented as extra_option.
Bases: django.contrib.admin.options.TabularInline
alias of SuiteOption
Get a dict of the meta distributions: meta -> actual.
Bases: mini_buildd.models.base.Model
Architecture(extra_options, pickled_data, name)
Bases: django.core.exceptions.ObjectDoesNotExist
Bases: django.core.exceptions.MultipleObjectsReturned
Some archs also natively support other archs.
Bases: mini_buildd.models.base.Model
Archive(extra_options, pickled_data, url, ping)
Bases: mini_buildd.models.base.Admin
Add internet Debian archive sources.
Scan local sources list and add all archives found there.
Add internet Ubuntu archive sources.
Bases: django.core.exceptions.ObjectDoesNotExist
Bases: django.core.exceptions.MultipleObjectsReturned
Return all sources (and their deps) that use us.
Ping and update the ping value.
Bases: mini_buildd.models.base.Model
Component(extra_options, pickled_data, name)
Bases: django.core.exceptions.ObjectDoesNotExist
Bases: django.core.exceptions.MultipleObjectsReturned
Bases: mini_buildd.models.base.Model
PrioritySource(id, extra_options, pickled_data, source_id, priority)
Bases: mini_buildd.models.base.Admin
Add all backports as prio=1 prio sources
alias of PrioritySource
Bases: django.core.exceptions.ObjectDoesNotExist
Bases: django.core.exceptions.MultipleObjectsReturned
Bases: mini_buildd.models.base.StatusModel
Source(id, extra_options, pickled_data, status, last_checked, auto_reactivate, origin, codename, description, codeversion, codeversion_override)
Bases: mini_buildd.models.base.Admin
Forbid to change identity on existing source (usually a bad idea; repos/chroots that refer to us may break).
Filter active base sources; needed in chroot and distribution wizards.
Add well-known Debian sources
7638D0442B90D010: Debian Archive Automatic Signing Key (8/jessie) <ftpmaster@debian.org> CBF8D6FD518E17E1: Jessie Stable Release Key <debian-release@lists.debian.org>
8B48AD6246925553: Debian Archive Automatic Signing Key (7.0/wheezy) <ftpmaster@debian.org> 6FB2A1C265FFB764: Wheezy Stable Release Key <debian-release@lists.debian.org>
AED4B06F473041FA: Debian Archive Automatic Signing Key (6.0/squeeze) <ftpmaster@debian.org> 64481591B98321F9: Squeeze Stable Release Key <debian-release@lists.debian.org>
9AA38DCD55BE302B: Debian Archive Automatic Signing Key (5.0/lenny) <ftpmaster@debian.org> 4D270D06F42584E6: Lenny Stable Release Key <debian-release@lists.debian.org>
B5D0C804ADB11277: Etch Stable Release Key <debian-release@lists.debian.org> EA8E8B2116BA136C: Backports.org Archive Key <ftp-master@backports.org>
Add well-known Ubuntu sources
Bases: django.core.exceptions.ObjectDoesNotExist
Bases: django.core.exceptions.MultipleObjectsReturned
Rescan all archives, and check that there is at least one working.
Apt ‘pin line’ (for use in a apt ‘preference’ file).
Returns the fastest archive.
Return all chroots and repositories that use us.
Check that this release file matches us.
Compute a dict of values a matching release file must have.
Get Debian components as string in a suitable order – i.e., ‘main’ should be first, the others in alphabetical order.
Basically only needed for reprepro’s (broken?) default component guessing, which uses the first given component in the configuration.
Bases: mini_buildd.models.base.Model
Subscription(id, extra_options, pickled_data, subscriber_id, package, distribution)
Bases: django.core.exceptions.ObjectDoesNotExist
Bases: django.core.exceptions.MultipleObjectsReturned