daklib.rm

General purpose package removal code for ftpmaster

@contact: Debian FTP Master <ftpmaster@debian.org> @copyright: 2000, 2001, 2002, 2003, 2004, 2006 James Troup <james@nocrew.org> @copyright: 2010 Alexander Reichle-Schmehl <tolimar@debian.org> @copyright: 2015 Niels Thykier <niels@thykier.net> @license: GNU General Public License version 2 or later

Functions

remove(session, reason, suites, removals[, ...])

Batch remove a number of packages Verify that the files listed in the Files field of the .dsc are those expected given the announced Format.

Classes

ReverseDependencyChecker(session, suite)

A bulk tester for reverse dependency checks

class daklib.rm.ReverseDependencyChecker(session, suite: str)[source]

A bulk tester for reverse dependency checks

This class is similar to the check_reverse_depends method from “utils”. However, it is primarily focused on facilitating bulk testing of reverse dependencies. It caches the state of the suite and then uses that as basis for answering queries. This saves a significant amount of time if multiple reverse dependency checks are required.

static _load_package_information(session, suite_id, suite_archs2id)[source]
check_reverse_depends(removal_requests: Union[dict, list[tuple]]) dict[source]

Bulk check reverse dependencies

Example:
removal_request = {

“eclipse-rcp”: None, # means ALL architectures (incl. source) “eclipse”: None, # means ALL architectures (incl. source) “lintian”: [“source”, “all”], # Only these two “architectures”.

} obj.check_reverse_depends(removal_request)

Parameters:

removal_requests – A dictionary mapping a package name to a list of architectures. The list of architectures decides from which the package will be removed - if the list is empty the package will be removed on ALL architectures in the suite (including “source”).

Returns:

A mapping of “removed package” (as a “(pkg, arch)”-tuple) to a set of broken broken packages (also as “(pkg, arch)”-tuple). Note that the architecture values in these tuples /can/ be “source” to reflect a breakage in build-dependencies.

daklib.rm.remove(session, reason: str, suites: list, removals: list, whoami: Optional[str] = None, partial: bool = False, components: Optional[list] = None, done_bugs: Optional[list] = None, date: Optional[str] = None, carbon_copy: Optional[list[str]] = None, close_related_bugs: bool = False) None[source]

Batch remove a number of packages Verify that the files listed in the Files field of the .dsc are those expected given the announced Format.

Parameters:
  • session – The database session in use

  • reason – The reason for the removal (e.g. “[auto-cruft] NBS (no longer built by <source>)”)

  • suites – A list of the suite names in which the removal should occur

  • removals – A list of the removals. Each element should be a tuple (or list) of at least the following for 4 items from the database (in order): package, version, architecture, (database) id. For source packages, the “architecture” should be set to “source”.

  • whoami – The person (or entity) doing the removal. Defaults to utils.whoami()

  • partial – Whether the removal is “partial” (e.g. architecture specific).

  • components – List of components involved in a partial removal. Can be an empty list to not restrict the removal to any components.

  • done_bugs – A list of bugs to be closed when doing this removal.

  • date – The date of the removal. Defaults to date -R

  • carbon_copy – A list of mail addresses to CC when doing removals. NB: all items are taken “as-is” unlike “dak rm”.

  • close_related_bugs – Whether bugs related to the package being removed should be closed as well. NB: Not implemented for more than one suite.