From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QgkJ5-0006qU-Ab for garchives@archives.gentoo.org; Tue, 12 Jul 2011 21:15:51 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1B99721C12B; Tue, 12 Jul 2011 21:15:44 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id E3F1821C12B for ; Tue, 12 Jul 2011 21:15:43 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 83A5C2AC229 for ; Tue, 12 Jul 2011 21:15:43 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id CC2588003D for ; Tue, 12 Jul 2011 21:15:42 +0000 (UTC) From: "Nirbheek Chauhan" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Nirbheek Chauhan" Message-ID: <65233c901564bdc33d220bd5210d6701bc18c61c.nirbheek@gentoo> Subject: [gentoo-commits] proj/gnome:master commit in: scripts/ X-VCS-Repository: proj/gnome X-VCS-Files: scripts/gen_archlist.py X-VCS-Directories: scripts/ X-VCS-Committer: nirbheek X-VCS-Committer-Name: Nirbheek Chauhan X-VCS-Revision: 65233c901564bdc33d220bd5210d6701bc18c61c Date: Tue, 12 Jul 2011 21:15:42 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 8a69ac610f8c2b75b30ee9e50c824c8f commit: 65233c901564bdc33d220bd5210d6701bc18c61c Author: Nirbheek Chauhan gentoo org> AuthorDate: Tue Jul 12 19:14:41 2011 +0000 Commit: Nirbheek Chauhan gentoo org> CommitDate: Tue Jul 12 19:14:43 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/gnome.git;a=3D= commit;h=3D65233c90 scripts/gen_archlist.py: don't insert useless newlines when CHECK_DEPS * If blocks of cpv-kw lists have just one item in them, don't separate th= em with newline. This avoids tons of useless space in the output. * This code is surprisingly fragile... --- scripts/gen_archlist.py | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-) diff --git a/scripts/gen_archlist.py b/scripts/gen_archlist.py index e53f9cc..ffef7eb 100755 --- a/scripts/gen_archlist.py +++ b/scripts/gen_archlist.py @@ -390,6 +390,7 @@ def prettify(cpv_kws): max_len =3D 0 kws_all =3D [] pretty_list =3D [] + cpv_block_size =3D 0 =20 for each in cpv_kws: # Ignore comments/whitespace carried over from original list @@ -405,10 +406,18 @@ def prettify(cpv_kws): kws_all.sort() =20 for each in cpv_kws: - # Ignore comments/whitespace carried over from original list + # Handle comments/whitespace carried over from original list if type(each) is not list: + # If the prev cpv block has just one line, don't print an ex= tra \n + # XXX: This code relies on blocks of dep-cpvs being separate= d by \n + if CHECK_DEPS and cpv_block_size is 1: + cpv_block_size =3D 0 + continue pretty_list.append([each, []]) + cpv_block_size =3D 0 continue + # The size of the current cpv list block + cpv_block_size +=3D 1 # Pad the cpvs with space each[0] +=3D n_sep(max_len - len(each[0])) for i in range(0, len(kws_all)):