dak.auto_decruft

Check for obsolete binary packages

@contact: Debian FTP Master <ftpmaster@debian.org> @copyright: 2000-2006 James Troup <james@nocrew.org> @copyright: 2009 Torsten Werner <twerner@debian.org> @copyright: 2015 Niels Thykier <niels@thykier.net> @license: GNU General Public License version 2 or later

Functions

auto_decruft_suite(suite_name, suite_id, ...)

Run the auto-decrufter on a given suite

compute_nbs_groups(suite_id, suite_name, session)

Find binaries no longer built

compute_sourceless_groups(suite_id, session)

Find binaries without a source

decruft_newer_version_in(othersuite, ...)

Compute removals items given a list of names of source packages

dedup(*args)

main()

merge_group(groupA, groupB)

Merges two removal groups into one

remove_groups(groups, suite_id, suite_name, ...)

sources2removals(source_list, suite_id, session)

Compute removals items given a list of names of source packages

usage([exit_code])

dak.auto_decruft.auto_decruft_suite(suite_name: str, suite_id: int, session, dryrun: bool, debug: bool)[source]

Run the auto-decrufter on a given suite

Parameters:
  • suite_name – The name of the suite to remove from

  • suite_id – The id of the suite denoted by suite_name

  • session – The database session in use

  • dryrun – If True, just print the actions rather than actually doing them

  • debug – If True, print some extra information

dak.auto_decruft.compute_nbs_groups(suite_id: int, suite_name: str, session)[source]

Find binaries no longer built

Parameters:
  • suite_id – The id of the suite denoted by suite_name

  • suite_name – The name of the suite to remove from

  • session – The database session in use

dak.auto_decruft.compute_sourceless_groups(suite_id: int, session)[source]

Find binaries without a source

Parameters:
  • suite_id – The id of the suite denoted by suite_name

  • session – The database session in use

dak.auto_decruft.decruft_newer_version_in(othersuite: str, suite_name: str, suite_id: int, rm_msg: str, session, dryrun: bool, decruft_equal_versions: bool) None[source]

Compute removals items given a list of names of source packages

Parameters:
  • othersuite – The name of the suite to compare with (e.g. “unstable” for “NVIU”)

  • suite – The name of the suite from which to do removals (e.g. “experimental” for “NVIU”)

  • suite_id – The id of the suite from which these sources should be removed

  • rm_msg – The removal message (or tag, e.g. “NVIU”)

  • session – The database session in use

  • dryrun – If True, just print the actions rather than actually doing them

  • decruft_equal_versions – If True, use >= instead of > for finding decruftable packages.

dak.auto_decruft.dedup(*args)[source]
dak.auto_decruft.main()[source]
dak.auto_decruft.merge_group(groupA: dict, groupB: dict) dict[source]

Merges two removal groups into one

Note that some values are taken entirely from groupA (e.g. name and message)

Parameters:
  • groupA – A removal group

  • groupB – Another removal group

Returns:

A merged group

dak.auto_decruft.remove_groups(groups, suite_id, suite_name, session)[source]
dak.auto_decruft.sources2removals(source_list: Iterable[str], suite_id: int, session) list[source]

Compute removals items given a list of names of source packages

Parameters:
  • source_list – A list of names of source packages

  • suite_id – The id of the suite from which these sources should be removed

  • session – The database session in use

Returns:

A list of items to be removed to remove all sources and their binaries from the given suite

dak.auto_decruft.usage(exit_code=0)[source]