1 |
commit: f14b6198d1dd9cb7f4a83f3822e4a1782a5581e8 |
2 |
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Oct 13 14:04:07 2020 +0000 |
4 |
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Oct 13 14:13:02 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=f14b6198 |
7 |
|
8 |
metadata.py: Fix duplicated use flag text bug 748129 |
9 |
|
10 |
Regression from commit: 517581df206766 |
11 |
link: https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=517581df206766fabf10273cde565e0a6dc62829 |
12 |
Gentoo bug: https://bugs.gentoo.org/748129 |
13 |
Signed-off-by: Brian Dolbec <dolsen <AT> gentoo.org> |
14 |
|
15 |
pym/gentoolkit/metadata.py | 7 +++++-- |
16 |
1 file changed, 5 insertions(+), 2 deletions(-) |
17 |
|
18 |
diff --git a/pym/gentoolkit/metadata.py b/pym/gentoolkit/metadata.py |
19 |
index c3dba98..0b58392 100644 |
20 |
--- a/pym/gentoolkit/metadata.py |
21 |
+++ b/pym/gentoolkit/metadata.py |
22 |
@@ -101,8 +101,11 @@ class _Useflag(object): |
23 |
if node.text: |
24 |
_desc = node.text |
25 |
for child in node.iter(): |
26 |
- _desc += child.text if child.text else '' |
27 |
- _desc += child.tail if child.tail else '' |
28 |
+ # prevent duplicate text |
29 |
+ if child.text and child.text not in _desc: |
30 |
+ _desc += child.text |
31 |
+ if child.tail and not child.tail in _desc: |
32 |
+ _desc += child.tail |
33 |
# This takes care of tabs and newlines left from the file |
34 |
self.description = re.sub(r'\s+', ' ', _desc) |