1 |
On Tue, 3 Nov 2015 13:13:03 -0800 |
2 |
Zac Medico <zmedico@g.o> wrote: |
3 |
|
4 |
> Since commit e6be71af3f67ea274db455e9c24d5f84bd372c39, the release |
5 |
> agent can refer to a temporary file if it was set while portage was |
6 |
> updating itself. Fix it to reset the release agent when necessary. |
7 |
> |
8 |
> Fixes: e6be71af3f67 ("AbstractEbuildProcess: remove cgroup with |
9 |
> release_agent (bug 561264)") --- |
10 |
> pym/_emerge/AbstractEbuildProcess.py | 18 ++++++++++++++++++ |
11 |
> 1 file changed, 18 insertions(+) |
12 |
> |
13 |
> diff --git a/pym/_emerge/AbstractEbuildProcess.py |
14 |
> b/pym/_emerge/AbstractEbuildProcess.py index 2b5d9c7..8bd30a6 100644 |
15 |
> --- a/pym/_emerge/AbstractEbuildProcess.py |
16 |
> +++ b/pym/_emerge/AbstractEbuildProcess.py |
17 |
> @@ -96,6 +96,24 @@ class AbstractEbuildProcess(SpawnProcess): |
18 |
> with open(os.path.join( |
19 |
> cgroup_portage, |
20 |
> 'notify_on_release'), 'w') as f: f.write('1') |
21 |
> + else: |
22 |
> + # Update release_agent if it |
23 |
> no longer exists, because |
24 |
> + # it refers to a temporary |
25 |
> path when portage is updating |
26 |
> + # itself. |
27 |
> + release_agent = os.path.join( |
28 |
> + cgroup_portage, |
29 |
> 'release_agent') |
30 |
> + try: |
31 |
> + with |
32 |
> open(release_agent) as f: |
33 |
> + |
34 |
> release_agent_path = f.readline().rstrip('\n') |
35 |
> + except EnvironmentError: |
36 |
> + release_agent_path = |
37 |
> None + |
38 |
> + if (release_agent_path is |
39 |
> None or |
40 |
> + not |
41 |
> os.path.exists(release_agent_path)): |
42 |
> + with |
43 |
> open(release_agent, 'w') as f: |
44 |
> + |
45 |
> f.write(os.path.join( |
46 |
> + |
47 |
> self.settings['PORTAGE_BIN_PATH'], |
48 |
> + 'cgroup-release-agent')) |
49 |
> |
50 |
> cgroup_path = |
51 |
> tempfile.mkdtemp(dir=cgroup_portage, prefix='%s:%s.' % |
52 |
> (self.settings["CATEGORY"], |
53 |
|
54 |
yeah, looks good :) |
55 |
|
56 |
-- |
57 |
Brian Dolbec <dolsen> |