diff options
author | Necoro <> | 2007-09-30 21:10:52 +0000 |
---|---|---|
committer | Necoro <> | 2007-09-30 21:10:52 +0000 |
commit | acf288dcc9c0b6ecfe18784ddadfdbdd5a255e7b (patch) | |
tree | aeb6929260446ea2559f86708b33d5f3f9ecf885 /portato/backend/portage/system.py | |
parent | 1566b3f4ff730c7e3c261751202ea5593e0705d9 (diff) | |
download | portato-acf288dcc9c0b6ecfe18784ddadfdbdd5a255e7b.tar.gz portato-acf288dcc9c0b6ecfe18784ddadfdbdd5a255e7b.tar.bz2 portato-acf288dcc9c0b6ecfe18784ddadfdbdd5a255e7b.zip |
add support for "--with-bdeps"
Diffstat (limited to '')
-rw-r--r-- | portato/backend/portage/system.py | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/portato/backend/portage/system.py b/portato/backend/portage/system.py index 035425b..8d8e6da 100644 --- a/portato/backend/portage/system.py +++ b/portato/backend/portage/system.py @@ -13,20 +13,20 @@ from __future__ import absolute_import import re, os -import types from gettext import lgettext as _ import portage from .package import PortagePackage from .settings import PortageSettings from ..system_interface import SystemInterface -from ...helper import debug, unique_array +from ...helper import debug, info, unique_array class PortageSystem (SystemInterface): """This class provides access to the portage-system.""" # pre-compile the RE removing the ".svn" and "CVS" entries unwantedPkgsRE = re.compile(r".*(\.svn|CVS)$") + withBdepsRE = re.compile(r"--with-bdeps\s*( |=)\s*y") def __init__ (self): """Constructor.""" @@ -91,6 +91,20 @@ class PortageSystem (SystemInterface): else: return True + def with_bdeps(self): + """Returns whether the "--with-bdeps" option is set to true. + + @returns: the value of --with-bdeps + @rtype: boolean + """ + + settings = self.get_global_settings("EMERGE_DEFAULT_OPTS").split() + for s in settings: + if self.withBdepsRE.match(s): + return True + + return False + def find_lambda (self, name): """Returns the function needed by all the find_all_*-functions. Returns None if no name is given. @@ -147,7 +161,7 @@ class PortageSystem (SystemInterface): t += self.settings.vartree.dbapi.match(search_key) # catch the "ambigous package" Exception except ValueError, e: - if type(e[0]) == types.ListType: + if isinstance(e[0], list): t = [] for cp in e[0]: if masked: @@ -168,7 +182,7 @@ class PortageSystem (SystemInterface): t = self.settings.vartree.dbapi.match(search_key) # catch the "ambigous package" Exception except ValueError, e: - if type(e[0]) == types.ListType: + if isinstance(e[0], list): t = [] for cp in e[0]: t += self.settings.vartree.dbapi.match(cp) @@ -277,7 +291,8 @@ class PortageSystem (SystemInterface): @param packages: the list of packages @type packages: string[] @returns: the list of packages - @rtype: backend.Package[]""" + @rtype: backend.Package[] + """ new_packages = [] for p in packages: @@ -323,6 +338,10 @@ class PortageSystem (SystemInterface): # append system packages packages.extend(unique_array([p.get_cp() for p in self.find_all_system_packages()])) + states = [(["RDEPEND","PDEPEND"],True), (["DEPEND"], False)] + if self.with_bdeps(): + states[1] = (["DEPEND"], True) + checked = [] updating = [] raw_checked = {} @@ -377,8 +396,6 @@ class PortageSystem (SystemInterface): appended = True if deep or tempDeep: - states = [(["RDEPEND","PDEPEND"],True), (["DEPEND"], False)] - for state in states: for i in p.get_matched_dep_packages(state[0]): if i not in raw_checked or raw_checked[i] == False: @@ -396,7 +413,7 @@ class PortageSystem (SystemInterface): check(p, True) return updating - + use_descs = {} local_use_descs = {} def get_use_desc (self, flag, package = None): |