Package dak :: Module auto_decruft
[hide private]
[frames] | no frames]

Module auto_decruft

source code

Check for obsolete binary packages


Contact: Debian FTP Master <ftpmaster@debian.org>

Copyright:

License: GNU General Public License version 2 or later

Functions [hide private]
 
usage(exit_code=0) source code
 
compute_sourceless_groups(suite_id, session) source code
 
compute_nbs_groups(suite_id, suite_name, session) source code
 
remove_groups(groups, suite_id, suite_name, session) source code
 
dedup(*args) source code
dict
merge_group(groupA, groupB)
Merges two removal groups into one
source code
 
auto_decruft_suite(suite_name, suite_id, session, dryrun, debug)
Run the auto-decrufter on a given suite
source code
list
sources2removals(source_list, suite_id, session)
Compute removals items given a list of names of source packages
source code
 
decruft_newer_version_in(othersuite, suite_name, suite_id, rm_msg, session, dryrun, decruft_equal_versions)
Compute removals items given a list of names of source packages
source code
 
main() source code

Imports: sql, sys, apt_pkg, chain, product, defaultdict, Config, utils, remove, ReverseDependencyChecker


Function Details [hide private]

merge_group(groupA, groupB)

source code 

Merges two removal groups into one

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

Parameters:
  • groupA (dict) - A removal group
  • groupB (dict) - Another removal group
Returns: dict
A merged group

auto_decruft_suite(suite_name, suite_id, session, dryrun, debug)

source code 

Run the auto-decrufter on a given suite

Parameters:
  • suite_name (string) - The name of the suite to remove from
  • suite_id (int) - The id of the suite denoted by suite_name
  • session (SQLA Session) - The database session in use
  • dryrun (bool) - If True, just print the actions rather than actually doing them
  • debug (bool) - If True, print some extra information

sources2removals(source_list, suite_id, session)

source code 

Compute removals items given a list of names of source packages

Parameters:
  • source_list (list) - A list of names of source packages
  • suite_id (int) - The id of the suite from which these sources should be removed
  • session (SQLA Session) - The database session in use
Returns: list
A list of items to be removed to remove all sources and their binaries from the given suite

decruft_newer_version_in(othersuite, suite_name, suite_id, rm_msg, session, dryrun, decruft_equal_versions)

source code 

Compute removals items given a list of names of source packages

Parameters:
  • othersuite (str) - The name of the suite to compare with (e.g. "unstable" for "NVIU")
  • suite (str) - The name of the suite from which to do removals (e.g. "experimental" for "NVIU")
  • suite_id (int) - The id of the suite from which these sources should be removed
  • rm_msg (str) - The removal message (or tag, e.g. "NVIU")
  • session (SQLA Session) - The database session in use
  • dryrun (bool) - If True, just print the actions rather than actually doing them
  • decruft_equal_versions (bool) - If True, use >= instead of > for finding decruftable packages.