Britney, the debian testing updater script This is the script that updates the testing_ distribution. It is executed each day after the installation of the updated packages. It generates the `Packages' files for the testing distribution, but it does so in an intelligent manner; it try to avoid any inconsistency and to use only non-buggy packages. For more documentation on this script, please read the Developers Reference.
Definition at line 212 of file britney.py.
def britney.Britney.__init__ | ( | self | ) |
Class constructor This method initializes and populates the data lists, which contain all the information needed by the other methods of the class.
Definition at line 218 of file britney.py.
def britney.Britney.auto_hinter | ( | self | ) |
Auto hint circular dependencies This method tries to auto hint circular dependencies analyzing the update excuses relationships. If they build a circular dependency, which we already know as not-working with the standard do_all algorithm, try to `easy` them.
Definition at line 2536 of file britney.py.
def britney.Britney.check_conflicts | ( | self, | ||
pkg, | ||||
arch, | ||||
broken, | ||||
system, | ||||
conflicts | ||||
) |
Check if a package can be installed satisfying the conflicts This method checks if the `pkg` package from the `arch` architecture can be installed (excluding `broken` packages) within the system `system` along with all its dependencies. This means that all the conflicts relationships are checked in order to achieve the test co-installability of the package. The method returns a boolean which is True if the given package is co-installable in the given system.
Definition at line 1661 of file britney.py.
def britney.Britney.check_installable | ( | self, | ||
pkg, | ||||
arch, | ||||
suite, | ||||
excluded = [] , |
||||
conflicts = False | ||||
) |
Check if a package is installable This method analyzes the dependencies of the binary package specified by the parameter `pkg' for the architecture `arch' within the suite `suite'. If the dependency can be satisfied in the given `suite` and `conflicts` parameter is True, then the co-installability with conflicts handling is checked. The dependency fields checked are Pre-Depends and Depends. The method returns a boolean which is True if the given package is installable.
Definition at line 1620 of file britney.py.
def britney.Britney.do_all | ( | self, | ||
maxdepth = 0 , |
||||
init = None , |
||||
actions = None | ||||
) |
Testing update runner This method tries to update testing checking the uninstallability counters before and after the actions to decide if the update was successful or not.
Definition at line 2258 of file britney.py.
def britney.Britney.do_hint | ( | self, | ||
type, | ||||
who, | ||||
pkgvers | ||||
) |
Process hints This method process `easy`, `hint` and `force-hint` hints. If the requested version is not in unstable, than the hint is skipped.
Definition at line 2460 of file britney.py.
def britney.Britney.doop_source | ( | self, | ||
pkg | ||||
) |
Apply a change to the testing distribution as requested by `pkg` This method apply the changes required by the action `pkg` tracking them so it will be possible to revert them. The method returns a list of the package name, the suite where the package comes from, the list of packages affected by the change and the dictionary undo which can be used to rollback the changes.
Definition at line 1880 of file britney.py.
def britney.Britney.eval_nuninst | ( | self, | ||
nuninst, | ||||
original = None | ||||
) |
Return a string which represents the uninstallability counters This method returns a string which represents the uninstallability counters reading the uninstallability statistics `nuninst` and, if present, merging the results with the `original` one. An example of the output string is: 1+2: i-0:a-0:a-0:h-0:i-1:m-0:m-0:p-0:a-0:m-0:s-2:s-0 where the first part is the number of broken packages in non-break architectures + the total number of broken packages for all the architectures.
Definition at line 1568 of file britney.py.
def britney.Britney.eval_uninst | ( | self, | ||
nuninst | ||||
) |
Return a string which represents the uninstallable packages This method returns a string which represents the uninstallable packages reading the uninstallability statistics `nuninst`. An example of the output string is: * i386: broken-pkg1, broken-pkg2
Definition at line 1598 of file britney.py.
def britney.Britney.excuse_unsat_deps | ( | self, | ||
pkg, | ||||
src, | ||||
arch, | ||||
suite, | ||||
excuse, | ||||
excluded = [] , |
||||
conflicts = False | ||||
) |
Find unsatisfied dependencies for a binary package This method analyzes the dependencies of the binary package specified by the parameter `pkg', built from the source package `src', for the architecture `arch' within the suite `suite'. If the dependency can't be satisfied in testing and/or unstable, it updates the excuse passed as parameter. The dependency fields checked are Pre-Depends and Depends.
Definition at line 930 of file britney.py.
def britney.Britney.get_dependency_solvers | ( | self, | ||
block, | ||||
arch, | ||||
distribution, | ||||
excluded = [] , |
||||
strict = False | ||||
) |
Find the packages which satisfy a dependency block This method returns the list of packages which satisfy a dependency block (as returned by apt_pkg.ParseDepends) for the given architecture and distribution. It returns a tuple with two items: the first is a boolean which is True if the dependency is satisfied, the second is the list of the solving packages.
Definition at line 889 of file britney.py.
def britney.Britney.get_full_tree | ( | self, | ||
pkg, | ||||
arch, | ||||
suite | ||||
) |
Calculate the full dependency tree for the given package This method returns the full dependency tree for the package `pkg`, inside the `arch` architecture for the suite `suite`.
Definition at line 2022 of file britney.py.
def britney.Britney.get_nuninst | ( | self, | ||
requested_arch = None , |
||||
build = False | ||||
) |
Return the uninstallability statistic for all the architectures To calculate the uninstallability counters, the method checks the installability of all the packages for all the architectures, and tracking dependencies in a recursive way. The architecture indipendent packages are checked only for the `nobreakall` architectures. It returns a dictionary with the architectures as keys and the list of uninstallable packages as values.
Definition at line 1508 of file britney.py.
def britney.Britney.invalidate_excuses | ( | self, | ||
valid, | ||||
invalid | ||||
) |
Invalidate impossible excuses This method invalidates the impossible excuses, which depend on invalid excuses. The two parameters contains the list of `valid' and `invalid' excuses.
Definition at line 1344 of file britney.py.
def britney.Britney.iter_packages | ( | self, | ||
packages, | ||||
selected, | ||||
hint = False , |
||||
nuninst = None | ||||
) |
Iter on the list of actions and apply them one-by-one This method apply the changes from `packages` to testing, checking the uninstallability counters for every action performed. If the action do not improve the it, it is reverted. The method returns the new uninstallability counters and the remaining actions if the final result is successful, otherwise (None, None).
Definition at line 2038 of file britney.py.
def britney.Britney.main | ( | self | ) |
Main method This is the entry point for the class: it includes the list of calls for the member methods which will produce the output files.
Definition at line 2612 of file britney.py.
def britney.Britney.newlyuninst | ( | self, | ||
nuold, | ||||
nunew | ||||
) |
Return a nuninst statstic with only new uninstallable packages This method subtract the uninstallabla packages of the statistic `nunew` from the statistic `nuold`. It returns a dictionary with the architectures as keys and the list of uninstallable packages as values.
Definition at line 1493 of file britney.py.
def britney.Britney.normalize_bugs | ( | self | ) |
Normalize the release critical bug summaries for testing and unstable The method doesn't return any value: it directly modifies the object attribute `bugs'.
Definition at line 549 of file britney.py.
def britney.Britney.old_libraries | ( | self | ) |
Detect old libraries left in testing for smooth transitions This method detect old libraries which are in testing but no longer built from the source package: they are still there because other packages still depend on them, but they should be removed as soon as possible.
Definition at line 2576 of file britney.py.
def britney.Britney.old_libraries_format | ( | self, | ||
libs | ||||
) |
def britney.Britney.output_write | ( | self, | ||
msg | ||||
) |
def britney.Britney.read_approvals | ( | self, | ||
basedir | ||||
) |
Read the approval commands from the specified directory The approval commands are read from the files contained by the `Approved' directory within the directory specified as `basedir' parameter. The name of the files has to be the same of the authorized users for the approvals. The file contains rows with the format: <package-name> <version> The method returns a dictionary where the key is the binary package name followed by an underscore and the version number, and the value is the user who submitted the command.
Definition at line 669 of file britney.py.
def britney.Britney.read_binaries | ( | self, | ||
basedir, | ||||
distribution, | ||||
arch | ||||
) |
Read the list of binary packages from the specified directory The binary packages are read from the `Packages_${arch}' files within the directory specified as `basedir' parameter, replacing ${arch} with the value of the arch parameter. Considering the large amount of memory needed, not all the fields are loaded in memory. The available fields are Version, Source, Pre-Depends, Depends, Conflicts, Provides and Architecture. After reading the packages, reverse dependencies are computed and saved in the `rdepends' keys, and the `Provides' field is used to populate the virtual packages list. The dependencies are parsed with the apt.pkg.ParseDepends method, and they are stored both as the format of its return value and text. The method returns a tuple. The first element is a list where every item represents a binary package as a dictionary; the second element is a dictionary which maps virtual packages to real packages that provide it.
Definition at line 367 of file britney.py.
def britney.Britney.read_bugs | ( | self, | ||
basedir | ||||
) |
Read the release critial bug summary from the specified directory The RC bug summaries are read from the `Bugs' file within the directory specified as `basedir' parameter. The file contains rows with the format: <package-name> <count-of-rc-bugs> The method returns a dictionary where the key is the binary package name and the value is the number of open RC bugs for it.
Definition at line 493 of file britney.py.
def britney.Britney.read_dates | ( | self, | ||
basedir | ||||
) |
Read the upload date for the packages from the specified directory The upload dates are read from the `Date' file within the directory specified as `basedir' parameter. The file contains rows with the format: <package-name> <version> <date-of-upload> The dates are expressed as days starting from the 1970-01-01. The method returns a dictionary where the key is the binary package name and the value is tuple with two items, the version and the date.
Definition at line 584 of file britney.py.
def britney.Britney.read_hints | ( | self, | ||
basedir | ||||
) |
Read the hint commands from the specified directory The hint commands are read from the files contained by the `Hints' directory within the directory specified as `basedir' parameter. The name of the files has to be the same of the authorized users for the hints. The file contains rows with the format: <command> <package-name>[/<version>] The method returns a dictionary where the key is the command, and the value is the list of affected packages.
Definition at line 695 of file britney.py.
def britney.Britney.read_nuninst | ( | self | ) |
def britney.Britney.read_sources | ( | self, | ||
basedir | ||||
) |
Read the list of source packages from the specified directory The source packages are read from the `Sources' file within the directory specified as `basedir' parameter. Considering the large amount of memory needed, not all the fields are loaded in memory. The available fields are Version, Maintainer and Section. The method returns a list where every item represents a source package as a dictionary.
Definition at line 340 of file britney.py.
def britney.Britney.read_urgencies | ( | self, | ||
basedir | ||||
) |
Read the upload urgency of the packages from the specified directory The upload urgencies are read from the `Urgency' file within the directory specified as `basedir' parameter. The file contains rows with the format: <package-name> <version> <urgency> The method returns a dictionary where the key is the binary package name and the value is the greatest urgency from the versions of the package that are higher then the testing one.
Definition at line 624 of file britney.py.
def britney.Britney.register_reverses | ( | self, | ||
pkg, | ||||
packages, | ||||
provides, | ||||
check_doubles = True , |
||||
parse_depends = apt_pkg.ParseDepends | ||||
) |
Register reverse dependencies and conflicts for the specified package This method register the reverse dependencies and conflicts for a give package using `packages` as list of packages and `provides` as list of virtual packages. The method has an optional parameter parse_depends which is there just for performance reasons and is not meant to be overwritten.
Definition at line 451 of file britney.py.
def britney.Britney.reversed_exc_deps | ( | self | ) |
Reverse the excuses dependencies This method returns a dictionary where the keys are the package names and the values are the excuse names which depend on it.
Definition at line 1331 of file britney.py.
def britney.Britney.same_source | ( | self, | ||
sv1, | ||||
sv2 | ||||
) |
Check if two version numbers are built from the same source This method returns a boolean value which is true if the two version numbers specified as parameters are built from the same source. The main use of this code is to detect binary-NMU.
Definition at line 850 of file britney.py.
def britney.Britney.should_remove_source | ( | self, | ||
pkg | ||||
) |
Check if a source package should be removed from testing This method checks if a source package should be removed from the testing distribution; this happen if the source package is not present in the unstable distribution anymore. It returns True if the package can be removed, False otherwise. In the former case, a new excuse is appended to the the object attribute excuses.
Definition at line 990 of file britney.py.
def britney.Britney.should_upgrade_src | ( | self, | ||
src, | ||||
suite | ||||
) |
Check if source package should be upgraded This method checks if a source package should be upgraded. The analysis is performed for the source package specified by the `src' parameter, checking the architecture `arch' for the distribution `suite'. It returns False if the given package doesn't need to be upgraded, True otherwise. In the former case, a new excuse is appended to the the object attribute excuses.
Definition at line 1134 of file britney.py.
def britney.Britney.should_upgrade_srcarch | ( | self, | ||
src, | ||||
arch, | ||||
suite | ||||
) |
Check if binary package should be upgraded This method checks if a binary package should be upgraded; this can happen also if the binary package is a binary-NMU for the given arch. The analysis is performed for the source package specified by the `src' parameter, checking the architecture `arch' for the distribution `suite'. It returns False if the given package doesn't need to be upgraded, True otherwise. In the former case, a new excuse is appended to the the object attribute excuses.
Definition at line 1020 of file britney.py.
def britney.Britney.sort_actions | ( | self | ) |
Sort actions in a smart way This method sorts the list of actions in a smart way. In details, it uses as base sort the number of days the excuse is old, then reordering packages so the ones with most reverse dependencies are at the end of the loop. If an action depends on another one, it is put after it.
Definition at line 2504 of file britney.py.
def britney.Britney.upgrade_testing | ( | self | ) |
Upgrade testing using the unstable packages This method tries to upgrade testing using the packages from unstable. Before running the do_all method, it tries the easy and force-hint commands.
Definition at line 2365 of file britney.py.
def britney.Britney.write_bugs | ( | self, | ||
basedir, | ||||
bugs | ||||
) |
Write the release critical bug summary to the specified directory For a more detailed explanation of the format, please check the method read_bugs.
Definition at line 517 of file britney.py.
def britney.Britney.write_controlfiles | ( | self, | ||
basedir, | ||||
suite | ||||
) |
Write the control files This method write the control files for the binary packages of all the architectures and for the source packages.
Definition at line 777 of file britney.py.
def britney.Britney.write_dates | ( | self, | ||
basedir, | ||||
dates | ||||
) |
Write the upload date for the packages to the specified directory For a more detailed explanation of the format, please check the method read_dates.
Definition at line 610 of file britney.py.
def britney.Britney.write_excuses | ( | self | ) |
Produce and write the update excuses This method handles the update excuses generation: the packages are looked to determine whether they are valid candidates. For the details of this procedure, please refer to the module docstring.
Definition at line 1386 of file britney.py.
def britney.Britney.write_heidi | ( | self, | ||
basedir, | ||||
filename | ||||
) |
Write the output HeidiResult This method write the output for Heidi, which contains all the binary packages and the source packages in the form: <pkg-name> <pkg-version> <pkg-architecture> <pkg-section> <src-name> <src-version> <src-section>
Definition at line 742 of file britney.py.
def britney.Britney.write_nuninst | ( | self, | ||
nuninst | ||||
) |