summaryrefslogtreecommitdiff
path: root/portato/backend
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--portato/backend/portage/system.py12
-rw-r--r--portato/backend/system_interface.py8
2 files changed, 20 insertions, 0 deletions
diff --git a/portato/backend/portage/system.py b/portato/backend/portage/system.py
index c42ca46..2d90c24 100644
--- a/portato/backend/portage/system.py
+++ b/portato/backend/portage/system.py
@@ -60,6 +60,18 @@ class PortageSystem (SystemInterface):
def get_unmerge_option (self):
return ["--unmerge"]
+ def get_environment (self):
+ default_opts = self.get_global_settings("EMERGE_DEFAULT_OPTS")
+ opts = dict(os.environ)
+
+ if default_opts:
+ opt_list = default_opts.split()
+ if "--ask" in opt_list:
+ opt_list.remove("--ask")
+ opts.update(EMERGE_DEFAULT_OPTS = " ".join(opt_list))
+
+ return opts
+
def find_lambda (self, name):
"""Returns the function needed by all the find_all_*-functions. Returns None if no name is given.
diff --git a/portato/backend/system_interface.py b/portato/backend/system_interface.py
index f37d0a0..40834f9 100644
--- a/portato/backend/system_interface.py
+++ b/portato/backend/system_interface.py
@@ -291,3 +291,11 @@ class SystemInterface:
@rtype: string[]"""
raise NotImplementedError
+
+ def get_environment (self):
+ """Returns a dictionary of environment variables to set prior to do an emerge.
+
+ @returns: environment variables
+ @rtype: dict{string : string}"""
+
+ raise NotImplementedError