From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id DE31A138359 for ; Tue, 13 Oct 2020 14:14:16 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CE09FE0932; Tue, 13 Oct 2020 14:14:10 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B949AE0932 for ; Tue, 13 Oct 2020 14:14:10 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 7E10D3408F0 for ; Tue, 13 Oct 2020 14:14:09 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id E01FB3A1 for ; Tue, 13 Oct 2020 14:14:07 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1602598382.f14b6198d1dd9cb7f4a83f3822e4a1782a5581e8.dolsen@gentoo> Subject: [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/ X-VCS-Repository: proj/gentoolkit X-VCS-Files: pym/gentoolkit/metadata.py X-VCS-Directories: pym/gentoolkit/ X-VCS-Committer: dolsen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: f14b6198d1dd9cb7f4a83f3822e4a1782a5581e8 X-VCS-Branch: master Date: Tue, 13 Oct 2020 14:14:07 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 69212b60-ed5d-4c37-9db6-cf513ebccf0f X-Archives-Hash: 34d33b1330d7b996164564ed53a00ce8 commit: f14b6198d1dd9cb7f4a83f3822e4a1782a5581e8 Author: Brian Dolbec gentoo org> AuthorDate: Tue Oct 13 14:04:07 2020 +0000 Commit: Brian Dolbec gentoo org> CommitDate: Tue Oct 13 14:13:02 2020 +0000 URL: https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=f14b6198 metadata.py: Fix duplicated use flag text bug 748129 Regression from commit: 517581df206766 link: https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=517581df206766fabf10273cde565e0a6dc62829 Gentoo bug: https://bugs.gentoo.org/748129 Signed-off-by: Brian Dolbec gentoo.org> pym/gentoolkit/metadata.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pym/gentoolkit/metadata.py b/pym/gentoolkit/metadata.py index c3dba98..0b58392 100644 --- a/pym/gentoolkit/metadata.py +++ b/pym/gentoolkit/metadata.py @@ -101,8 +101,11 @@ class _Useflag(object): if node.text: _desc = node.text for child in node.iter(): - _desc += child.text if child.text else '' - _desc += child.tail if child.tail else '' + # prevent duplicate text + if child.text and child.text not in _desc: + _desc += child.text + if child.tail and not child.tail in _desc: + _desc += child.tail # This takes care of tabs and newlines left from the file self.description = re.sub(r'\s+', ' ', _desc)