diff options
author | necoro <> | 2007-05-14 18:52:04 +0000 |
---|---|---|
committer | necoro <> | 2007-05-14 18:52:04 +0000 |
commit | 48a4f88747307ce41a07b4fa55411b44b9269eb7 (patch) | |
tree | b5d978867f74aedb2183d862758075f6ce255f49 /portato | |
parent | be5997284de46af17f1e169dc94beb9e85462dd3 (diff) | |
download | portato-48a4f88747307ce41a07b4fa55411b44b9269eb7.tar.gz portato-48a4f88747307ce41a07b4fa55411b44b9269eb7.tar.bz2 portato-48a4f88747307ce41a07b4fa55411b44b9269eb7.zip |
filtering "--ask" fron EMERGE_DEFAULT_OPTS
Diffstat (limited to '')
-rw-r--r-- | portato/backend/portage/system.py | 12 | ||||
-rw-r--r-- | portato/backend/system_interface.py | 8 | ||||
-rw-r--r-- | portato/gui/gui_helper.py | 2 |
3 files changed, 21 insertions, 1 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 diff --git a/portato/gui/gui_helper.py b/portato/gui/gui_helper.py index df4e1d7..9907a1c 100644 --- a/portato/gui/gui_helper.py +++ b/portato/gui/gui_helper.py @@ -513,7 +513,7 @@ class EmergeQueue: self.console.set_pty(master) # start emerge - self.process = Popen(command+options+packages, stdout = slave, stderr = STDOUT, shell = False) + self.process = Popen(command+options+packages, stdout = slave, stderr = STDOUT, shell = False, env = system.get_environment()) # start thread waiting for the stop of emerge Thread(name="Emerge-Thread", target=self._update_packages, args=(packages+self.deps.keys(),)).start() |