Gentoo Archives: gentoo-commits

From: Brian Dolbec <dolsen@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:master commit in: pym/_emerge/
Date: Mon, 05 Dec 2016 05:14:37
Message-Id: 1480914794.40e3bbe96c522eb02870550b0f976efdbdd0c033.dolsen@gentoo
1 commit: 40e3bbe96c522eb02870550b0f976efdbdd0c033
2 Author: hackers.terabit <terabit.funtoo <AT> Yandex <DOT> com>
3 AuthorDate: Thu Oct 27 03:29:16 2016 +0000
4 Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
5 CommitDate: Mon Dec 5 05:13:14 2016 +0000
6 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=40e3bbe9
7
8 _emerge/depgraph.py: Autounmask-write fails when there isn't a file in package.*/ bug 598116
9
10 Instead of outputting "!!! No file to write for ..." error message,
11 Use a sane default filename.
12 Add zz- prefix to ensure it remains the last file in sorted order.
13
14 X-Gentoo-bug: 598116
15 X-Gentoo-bug-url: https://bugs.gentoo.org/598116
16
17 pym/_emerge/depgraph.py | 6 ++++++
18 1 file changed, 6 insertions(+)
19
20 diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
21 index ee6cf68..cb12b05 100644
22 --- a/pym/_emerge/depgraph.py
23 +++ b/pym/_emerge/depgraph.py
24 @@ -8247,6 +8247,12 @@ class depgraph(object):
25 child.endswith("~"):
26 continue
27 stack.append(os.path.join(p, child))
28 + # If the directory is empty add a file with name
29 + # pattern file_name.default
30 + if last_file_path is None:
31 + last_file_path = os.path.join(file_path, file_path, "zz-autounmask")
32 + with open(last_file_path, "a+") as default:
33 + default.write("# " + file_name)
34
35 return last_file_path