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 1SES7C-000259-VX for garchives@archives.gentoo.org; Sun, 01 Apr 2012 21:15:11 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D4214E0B1F; Sun, 1 Apr 2012 21:14:52 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 88512E0B1F for ; Sun, 1 Apr 2012 21:14:52 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 7DA571B4013 for ; Sun, 1 Apr 2012 21:14:49 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 2FA62E5403 for ; Sun, 1 Apr 2012 21:14:48 +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: <1333314831.74d3c3fe11a25f7413bd4f734a6fa5c839040178.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: 74d3c3fe11a25f7413bd4f734a6fa5c839040178 X-VCS-Branch: master Date: Sun, 1 Apr 2012 21:14:48 +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: 9b477458-0a90-4bb2-82e9-a29b12b15d0b X-Archives-Hash: 6897c374a603e284f732eef7a9646a03 commit: 74d3c3fe11a25f7413bd4f734a6fa5c839040178 Author: Nirbheek Chauhan gentoo org> AuthorDate: Sun Apr 1 21:13:49 2012 +0000 Commit: Nirbheek Chauhan gentoo org> CommitDate: Sun Apr 1 21:13:51 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/gnome.git;a=3D= commit;h=3D74d3c3fe scripts/gen_archlist.py: implement what pacho actually wanted * If the input has no SLOT information, use the latest cpv in *all* slots --- scripts/gen_archlist.py | 58 +++++++++++++++++++++++++++++------------= ----- 1 files changed, 36 insertions(+), 22 deletions(-) diff --git a/scripts/gen_archlist.py b/scripts/gen_archlist.py index 8f0e9a8..fa26b90 100755 --- a/scripts/gen_archlist.py +++ b/scripts/gen_archlist.py @@ -388,6 +388,16 @@ def consolidate_dupes(cpv_kws): =20 return deduped_cpv_kws =20 +def get_per_slot_cpvs(cpvs): + "Classify the given cpvs into slots, and yield the best atom for eac= h slot" + slots =3D set() + for cpv in cpvs: + slot =3D portage.portage.portdb.aux_get(cpv, ['SLOT'])[0] + if slot in slots: + continue + slots.add(slot) + yield cpv + def append_slots(cpv_kws): "Append slots at the end of cpv atoms" slotifyed_cpv_kws =3D [] @@ -453,32 +463,36 @@ if __name__ =3D=3D "__main__": array =3D [] =20 for i in open(CP_FILE).readlines(): - cpv =3D i[:-1] - if cpv.startswith('#') or cpv.isspace() or not cpv: - ALL_CPV_KWS.append(cpv) + cp =3D i[:-1] + if cp.startswith('#') or cp.isspace() or not cp: + ALL_CPV_KWS.append(cp) continue - if cpv.find('#') is not -1: + if cp.find('#') is not -1: raise Exception('Inline comments are not supported') - if not portage.catpkgsplit(cpv): - # It's actually a cp - cpv =3D match_wanted_atoms(cpv, release=3DNEW_REL) - if not cpv or not cpv[0]: + if portage.catpkgsplit(cp): + # categ/pkg is already a categ/pkg-ver + atoms =3D [cp] + else: + # Get all the atoms matching the given cp + cpvs =3D match_wanted_atoms(cp, release=3DNEW_REL) + + for cpv in get_per_slot_cpvs(cpvs): + if not cpv: debug('%s: Invalid cpv' % cpv) continue - cpv =3D cpv[0] - kws_missing =3D max_kws(cpv, release=3DOLD_REL) - if kws_missing =3D=3D []: - # Current cpv has the max keywords =3D> nothing to do - nothing_to_be_done(cpv) - continue - elif kws_missing =3D=3D None: - debug ('No versions with stable keywords for %s' % cpv) - # No cpv with stable keywords =3D> select latest - arches =3D make_unstable(ARCHES) - kws_missing =3D [kw[1:] for kw in get_kws(cpv, arches)] - ALL_CPV_KWS +=3D fix_nesting(gen_cpv_kws(cpv, kws_missing, set()= )) - if CHECK_DEPS: - ALL_CPV_KWS.append(LINE_SEP) + kws_missing =3D max_kws(cpv, release=3DOLD_REL) + if kws_missing =3D=3D []: + # Current cpv has the max keywords =3D> nothing to do + nothing_to_be_done(cpv) + continue + elif kws_missing =3D=3D None: + debug ('No versions with stable keywords for %s' % cpv) + # No cpv with stable keywords =3D> select latest + arches =3D make_unstable(ARCHES) + kws_missing =3D [kw[1:] for kw in get_kws(cpv, arches)] + ALL_CPV_KWS +=3D fix_nesting(gen_cpv_kws(cpv, kws_missing, s= et())) + if CHECK_DEPS: + ALL_CPV_KWS.append(LINE_SEP) =20 ALL_CPV_KWS =3D consolidate_dupes(ALL_CPV_KWS) if APPEND_SLOTS: