Gentoo Archives: gentoo-portage-dev

From: Brian Dolbec <dolsen@g.o>
To: gentoo-portage-dev@l.g.o
Subject: [gentoo-portage-dev] [PATCH] _emerge/depgraph.py: Autounmask-write fails when there isn't a file in package.*/ bug 598116
Date: Sat, 03 Dec 2016 21:48:54
Message-Id: 20161203134851.077f6c06.dolsen@gentoo.org
1 From c4a61bebca1cfeb0833cefb2c64be6156bdb8e8d Mon Sep 17 00:00:00 2001
2 From: "hackers.terabit" <terabit.funtoo@××××××.com>
3 Date: Thu, 27 Oct 2016 03:29:16 +0000
4 Subject: [PATCH] _emerge/depgraph.py: Autounmask-write fails when there isn't
5 a file in package.*/ bug 598116
6
7 Instead of outputting "!!! No file to write for ..." error message,
8 Use a sane default filename.
9 Add zz- prefix to ensure it remains the last file in sorted order.
10
11 X-Gentoo-bug: 598116
12 X-Gentoo-bug-url: https://bugs.gentoo.org/598116
13 ---
14 pym/_emerge/depgraph.py | 6 ++++++
15 1 file changed, 6 insertions(+)
16
17 diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
18 index 9161914..7dc1f55 100644
19 --- a/pym/_emerge/depgraph.py
20 +++ b/pym/_emerge/depgraph.py
21 @@ -8240,6 +8240,12 @@ class depgraph(object):
22 child.endswith("~"):
23 continue
24 stack.append(os.path.join(p, child))
25 + # If the directory is empty add a file with name
26 + # pattern file_name.default
27 + if last_file_path == None:
28 + last_file_path=os.path.join(file_path, file_path, "zz-autounmask")
29 + with open(last_file_path,"a+") as default:
30 + default.write("# " + file_name)
31
32 return last_file_path
33
34 --
35 2.9.3
36
37
38 --
39 Brian Dolbec <dolsen>

Replies