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 1RwI1O-0005t7-LH for garchives@archives.gentoo.org; Sat, 11 Feb 2012 18:50:07 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id DE0CCE059B; Sat, 11 Feb 2012 18:49:59 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 9A9CFE059B for ; Sat, 11 Feb 2012 18:49:59 +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 DA2FA1B4018 for ; Sat, 11 Feb 2012 18:49:58 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id A0A24E53FF for ; Sat, 11 Feb 2012 18:49:57 +0000 (UTC) From: "Krzysztof Pawlik" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Krzysztof Pawlik" Message-ID: <1e16974c4a868f0871c82f7fe8b9359c13aac56e.nelchael@gentoo> Subject: [gentoo-commits] dev/nelchael:master commit in: scripts/ X-VCS-Repository: dev/nelchael X-VCS-Files: scripts/eshowkw.py X-VCS-Directories: scripts/ X-VCS-Committer: nelchael X-VCS-Committer-Name: Krzysztof Pawlik X-VCS-Revision: 1e16974c4a868f0871c82f7fe8b9359c13aac56e Date: Sat, 11 Feb 2012 18:49:57 +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: ae85b3d6-4920-448a-a666-0fee03456e2d X-Archives-Hash: a6ba46b9b2f5e1ac315c85d5ded24d29 commit: 1e16974c4a868f0871c82f7fe8b9359c13aac56e Author: Krzysztof Pawlik none> AuthorDate: Sat Feb 11 18:49:20 2012 +0000 Commit: Krzysztof Pawlik gentoo org> CommitDate: Sat Feb 11 18:49:20 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Ddev/nelchael.git;a= =3Dcommit;h=3D1e16974c Remove eshowkw.py, obsoleted by eshowkw from gentoolkit. --- scripts/eshowkw.py | 174 ----------------------------------------------= ------ 1 files changed, 0 insertions(+), 174 deletions(-) diff --git a/scripts/eshowkw.py b/scripts/eshowkw.py deleted file mode 100755 index 00f5632..0000000 --- a/scripts/eshowkw.py +++ /dev/null @@ -1,174 +0,0 @@ -#!/usr/bin/python - -import sys -import os - -search_path =3D os.getcwd() -while search_path !=3D '/': - if os.path.exists(os.path.join(search_path, 'profiles/repo_name')): - print 'Appending %s to PORTDIR_OVERLAY...' % search_path - if 'PORTDIR_OVERLAY' not in os.environ: - os.environ['PORTDIR_OVERLAY'] =3D search_path - else: - os.environ['PORTDIR_OVERLAY'] +=3D ' ' + search_path - search_path =3D os.path.dirname(search_path) - -import portage -import portage.versions as portage_versions -import portage.output as output - -def resolvePackage(db, item): - cpvs =3D [] - try: - cpvs =3D db.xmatch('match-all', item) - except (Exception), e: - print output.red('"%s" matches to more than one package:' % item) - for x in e.args[0]: - print ' ' + output.green('*') + ' ' + x - sys.exit(0) - if len(cpvs) =3D=3D 0: - print output.red('Package "%s" not found' % item) - if item.find('/') !=3D -1: - item =3D item[item.find('/') + 1:] - try: - cpvs =3D db.xmatch('match-all', item) - except (Exception), e: - print 'Try:' - for x in e.args[0]: - print ' ' + output.green('*') + ' ' + x - sys.exit(0) - if len(cpvs) !=3D 0: - print 'Try:\n %s' % output.green('*') + ' ' + output.bold(portage= _versions.pkgsplit(cpvs[0])[0]) - sys.exit(0) - pkg =3D portage_versions.pkgsplit(cpvs[0])[0] - vers =3D [] - for i in cpvs: - vers.append(i[len(pkg) + 1:]) - # Sort versions: - verRv =3D [] - for i in sorted(vers): - skip =3D False - for x in range(len(verRv)): - if portage_versions.vercmp(i, verRv[x]) > 0: - verRv.insert(x, i) - skip =3D True - break - if not skip: - verRv.append(i) - vers =3D [] - for i in reversed(verRv): - vers.append(i) - return ( pkg, vers ) - -def flagFor(arch, keywords, myArch): - maskAll =3D False - for x in keywords: - tilde =3D False - maskMe =3D False - if x =3D=3D '-*': - maskAll =3D True - continue - if x[0] =3D=3D '~': - x =3D x[1:] - tilde =3D True - if x[0] =3D=3D '-': - x =3D x[1:] - maskMe =3D True - if x =3D=3D arch: - if tilde: - if arch =3D=3D myArch: - return output.yellow('~') - return output.darkyellow('~') - if maskMe: - if arch =3D=3D myArch: - return output.red('-') - return output.darkred('-') - if arch =3D=3D myArch: - return output.green('+') - return output.darkgreen('+') - if maskAll: - if arch =3D=3D myArch: - return output.red('*') - return output.darkred('*') - return ' ' - -def showMe(myArch, db, pkg): - pkg, versions =3D resolvePackage(db, pkg) - print '>>> Keywords for', pkg - archs =3D [] - for i in open(portage.settings['PORTDIR'] + '/profiles/arch.list').read= lines(): - if i =3D=3D '': - break - i =3D i.strip() - if i =3D=3D '' or i[0] =3D=3D '#': - continue - if not 'ESHOWKW_ALL_ARCHS' in os.environ and i.find('-') !=3D -1: - continue - archs.append(i) - longestVerLen =3D 0 - for i in versions: - if len(i) > longestVerLen: - longestVerLen =3D len(i) - longestVerLen +=3D 1 - longestSlot =3D 0 - for i in versions: - slot =3D db.aux_get(pkg + '-' + i, [ 'SLOT' ])[0] - if len(slot) > longestSlot: - longestSlot =3D len(slot) - lines =3D 0 - for i in archs: - if len(i) > lines: - lines =3D len(i) - for i in range(lines): - print longestVerLen * ' ' + '|', - for x in archs: - if x =3D=3D myArch: - if len(x) > i: - print output.green(x[i]), - else: - print ' ', - else: - if len(x) > i: - print x[i], - else: - print ' ', - print '|', - print - print longestVerLen * '-' + '+-' + len(archs) * '--' + '+-' + (longestS= lot + 3) * '-' - sys.stdout.flush() - prevSlot =3D None - for x in versions: - keywords, slot =3D db.aux_get(pkg + '-' + x, [ 'KEYWORDS', 'SLOT' ]) - keywords =3D keywords.split() - slot =3D ' (' + slot + ')' - if slot !=3D prevSlot: - print output.bold(x + (longestVerLen - len(x)) * ' ') + '|', - else: - print x + (longestVerLen - len(x)) * ' ' + '|', - for a in archs: - print flagFor(a, keywords, myArch), - if slot !=3D prevSlot: - print '|' + output.blue(slot) - else: - print '|' - #print '|' + output.darkblue(slot) - prevSlot =3D slot - sys.stdout.flush() - -pkg =3D None -if len(sys.argv) =3D=3D 1: - if os.getcwd() !=3D '/': - pkg =3D os.path.basename(os.path.dirname(os.getcwd())) + '/' + os.path= .basename(os.getcwd()) - else: - print output.red('Can not get package name') - sys.exit(1) -else: - pkg =3D sys.argv[1] - -myArch =3D None -for i in portage.settings['ACCEPT_KEYWORDS'].split(): - myArch =3D i - if i[0] =3D=3D '~': - myArch =3D i[1:] - -showMe(myArch, portage.portdbapi(mysettings=3Dportage.settings), pkg)