From 6f065d4911cd72a33e01fa8100d53ed16c6e7e4e Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 21 Sep 2012 14:19:18 -0700 Subject: Add preserve-libs for stable branch (not default) EAPI 5 supports automatic rebuilds via the slot-operator and sub-slots, which makes preserve-libs much more user-friendly, since it makes @preserved-rebuild unnecessary (also see bug #364425 for explanation of @preserved-rebuild shortcomings). Therefore, enable preserve-libs for the stable branch, but not by default. After EAPI 5 is widely adopted, we can consider enabling preserve-libs by default. --- pym/_emerge/actions.py | 5 +++-- pym/_emerge/main.py | 23 +++++++++-------------- 2 files changed, 12 insertions(+), 16 deletions(-) (limited to 'pym/_emerge') diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py index 8e75dad46..4b16dc9dc 100644 --- a/pym/_emerge/actions.py +++ b/pym/_emerge/actions.py @@ -31,7 +31,7 @@ from portage import shutil from portage import eapi_is_supported, _unicode_decode from portage.cache.cache_errors import CacheError from portage.const import GLOBAL_CONFIG_PATH -from portage.const import _ENABLE_DYN_LINK_MAP, _DEPCLEAN_LIB_CHECK_DEFAULT +from portage.const import _DEPCLEAN_LIB_CHECK_DEFAULT from portage.dbapi.dep_expand import dep_expand from portage.dbapi._expand_new_virt import expand_new_virt from portage.dep import Atom @@ -544,7 +544,8 @@ def action_depclean(settings, trees, ldpath_mtimes, # specific packages. msg = [] - if not _ENABLE_DYN_LINK_MAP: + if "preserve-libs" not in settings.features and \ + not myopts.get("--depclean-lib-check", _DEPCLEAN_LIB_CHECK_DEFAULT) != "n": msg.append("Depclean may break link level dependencies. Thus, it is\n") msg.append("recommended to use a tool such as " + good("`revdep-rebuild`") + " (from\n") msg.append("app-portage/gentoolkit) in order to detect such breakage.\n") diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py index aff1d3733..d19b7950f 100644 --- a/pym/_emerge/main.py +++ b/pym/_emerge/main.py @@ -25,7 +25,6 @@ from portage.output import create_color_func good = create_color_func("GOOD") bad = create_color_func("BAD") -from portage.const import _ENABLE_DYN_LINK_MAP import portage.elog import portage.util import portage.locks @@ -468,6 +467,7 @@ def insert_optional_args(args): '--buildpkg' : y_or_n, '--complete-graph' : y_or_n, '--deep' : valid_integers, + '--depclean-lib-check' : y_or_n, '--deselect' : y_or_n, '--binpkg-respect-use' : y_or_n, '--fail-clean' : y_or_n, @@ -491,9 +491,6 @@ def insert_optional_args(args): '--usepkgonly' : y_or_n, } - if _ENABLE_DYN_LINK_MAP: - default_arg_opts['--depclean-lib-check'] = y_or_n - short_arg_opts = { 'D' : valid_integers, 'j' : valid_integers, @@ -728,6 +725,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_y_or_n + }, + "--deselect": { "help" : "remove atoms/sets from the world file", "type" : "choice", @@ -977,13 +980,6 @@ def parse_opts(tmpcmdline, silent=False): } - if _ENABLE_DYN_LINK_MAP: - argument_options["--depclean-lib-check"] = { - "help" : "check for consumers of libraries before removing them", - "type" : "choice", - "choices" : true_y_or_n - } - from optparse import OptionParser parser = OptionParser() if parser.has_option("--help"): @@ -1058,9 +1054,8 @@ def parse_opts(tmpcmdline, silent=False): else: myoptions.complete_graph = None - if _ENABLE_DYN_LINK_MAP: - if myoptions.depclean_lib_check in true_y: - myoptions.depclean_lib_check = True + if myoptions.depclean_lib_check in true_y: + myoptions.depclean_lib_check = True if myoptions.exclude: bad_atoms = _find_bad_atoms(myoptions.exclude) -- cgit v1.2.3-1-g7c22