britney.Britney Class Reference

List of all members.

Public Member Functions

def __init__
def __parse_arguments
def __log
def read_sources
def read_binaries
def read_bugs
def __maxver
def normalize_bugs
def read_dates
def read_urgencies
def read_approvals
def read_hints
def same_source
def get_dependency_solvers
def excuse_unsat_deps
def should_remove_source
def should_upgrade_srcarch
def should_upgrade_src
def reversed_exc_deps
def invalidate_excuses
def write_excuses
def main

Static Public Attributes

tuple HINTS_STANDARD = ("easy", "hint", "remove", "block", "unblock", "urgent", "approve")
tuple HINTS_ALL = ("force", "force-hint", "block-all")

Detailed Description

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 33 of file britney.py.


Member Function Documentation

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 39 of file britney.py.

def britney.Britney.__log   self,
  msg,
  type = "I"
 

Print info messages according to verbosity level

An easy-and-simple log method which prints messages to the standard
output. The type parameter controls the urgency of the message, and
can be equal to `I' for `Information', `W' for `Warning' and `E' for
`Error'. Warnings and errors are always printed, and information are
printed only if the verbose logging is enabled.

Definition at line 115 of file britney.py.

def britney.Britney.__maxver   self,
  pkg,
  dist
 

Return the maximum version for a given package name

This method returns None if the specified source package
is not available in the `dist' distribution. If the package
exists, then it returns the maximum version between the
source package and its binary packages.

Definition at line 276 of file britney.py.

def britney.Britney.__parse_arguments   self  ) 
 

Parse the command line arguments

This method parses and initializes the command line arguments.
While doing so, it preprocesses some of the options to be converted
in a suitable form for the other methods of the class.

Definition at line 75 of file britney.py.

def britney.Britney.excuse_unsat_deps   self,
  pkg,
  src,
  arch,
  suite,
  excuse
 

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 553 of file britney.py.

def britney.Britney.get_dependency_solvers   self,
  block,
  arch,
  distribution
 

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 515 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 951 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 1079 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 294 of file britney.py.

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 400 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 155 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 252 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 329 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 426 of file britney.py.

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 130 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 355 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 938 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 476 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 604 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 analisys
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 742 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 only if the binary package is a binary-NMU for the given arch.
The analisys 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 628 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 993 of file britney.py.


The documentation for this class was generated from the following file:
Generated on Sat Jun 24 18:50:20 2006 for briteny by  doxygen 1.4.6