From 0faca588d881865be6eafc9b6401124bb927bee5 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 26 Jul 2010 02:26:58 -0700 Subject: [PATCH] Allow the --depclean library consumer check to be disabled by --depclean-lib-check=n. --- pym/_emerge/actions.py | 5 +++-- pym/_emerge/main.py | 10 ++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py index a379af8c4..07b3a6630 100644 --- a/pym/_emerge/actions.py +++ b/pym/_emerge/actions.py @@ -871,9 +871,9 @@ def calc_depclean(settings, trees, ldpath_mtimes, return pkgs_to_remove cleanlist = create_cleanlist() + clean_set = set(cleanlist) - if len(cleanlist): - clean_set = set(cleanlist) + if cleanlist and myopts.get('--depclean-lib-check') != 'n': # Check if any of these package are the sole providers of libraries # with consumers that have not been selected for removal. If so, these @@ -1058,6 +1058,7 @@ def calc_depclean(settings, trees, ldpath_mtimes, return 0, [], False, required_pkgs_total clean_set = set(cleanlist) + if True: # Use a topological sort to create an unmerge order such that # each package is unmerged before it's dependencies. This is # necessary to avoid breaking things that may need to run diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py index 4e621d21e..b553e15e3 100644 --- a/pym/_emerge/main.py +++ b/pym/_emerge/main.py @@ -390,6 +390,7 @@ def insert_optional_args(args): default_arg_opts = { '--complete-graph' : ('n',), '--deep' : valid_integers, + '--depclean-lib-check' : ('n',), '--deselect' : ('n',), '--binpkg-respect-use' : ('n', 'y',), '--fail-clean' : ('n',), @@ -554,6 +555,12 @@ def parse_opts(tmpcmdline, silent=False): "action" : "store" }, + "--depclean-lib-check": { + "help" : "check for consumers of libraries before removing them", + "type" : "choice", + "choices" : ("True", "n") + }, + "--deselect": { "help" : "remove atoms/sets from the world file", "type" : "choice", @@ -738,6 +745,9 @@ def parse_opts(tmpcmdline, silent=False): else: myoptions.complete_graph = None + if myoptions.depclean_lib_check in ("True",): + myoptions.depclean_lib_check = True + if myoptions.exclude: exclude = [] bad_atoms = [] -- 2.26.2