summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNecoro <>2007-09-30 21:10:52 +0000
committerNecoro <>2007-09-30 21:10:52 +0000
commitacf288dcc9c0b6ecfe18784ddadfdbdd5a255e7b (patch)
treeaeb6929260446ea2559f86708b33d5f3f9ecf885
parent1566b3f4ff730c7e3c261751202ea5593e0705d9 (diff)
downloadportato-acf288dcc9c0b6ecfe18784ddadfdbdd5a255e7b.tar.gz
portato-acf288dcc9c0b6ecfe18784ddadfdbdd5a255e7b.tar.bz2
portato-acf288dcc9c0b6ecfe18784ddadfdbdd5a255e7b.zip
add support for "--with-bdeps"
-rw-r--r--doc/Changelog4
-rw-r--r--doc/TODO3
-rw-r--r--portato/backend/portage/system.py33
-rw-r--r--portato/constants.py5
4 files changed, 37 insertions, 8 deletions
diff --git a/doc/Changelog b/doc/Changelog
index 2a79415..56ef968 100644
--- a/doc/Changelog
+++ b/doc/Changelog
@@ -1,3 +1,7 @@
+next:
+- "porting" to python-2.5
+- adding support for the "--with-bdeps=y" option in EMERGE_DEFAULT_OPTS
+
0.8.5:
- added an uncaught exception dialog
- i18n
diff --git a/doc/TODO b/doc/TODO
index a890cee..c0967a2 100644
--- a/doc/TODO
+++ b/doc/TODO
@@ -19,6 +19,7 @@ Backend:
- make sure, a package being removed from the queue is not needed as a dependency by another package
- "nach hause telefonieren" :)
+- downgrades do not work in update world
GUI:
====
@@ -37,6 +38,8 @@ GTK:
- make oneshot better
- show installed files
- show dependencies
+- new names for the Emerge and Unmerge button in the package table
+- reload package table when emerge is finished
Qt (stopped):
---
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):
diff --git a/portato/constants.py b/portato/constants.py
index 309b774..4d68ab5 100644
--- a/portato/constants.py
+++ b/portato/constants.py
@@ -43,11 +43,16 @@ These should be set during the installation.
@var SOCKET: path to socket for communication between listener and GUI
@type SOCKET: string
"""
+import os
from os.path import join as pjoin
+HOME = os.environ["HOME"]
+
APP = "portato"
VERSION = "9999"
+SETTINGS_DIR = pjoin(HOME, "."+APP)
+
CONFIG_DIR = "/etc/portato/"
CONFIG_LOCATION = pjoin(CONFIG_DIR, "portato.cfg")