public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/eshowkw/
Date: Sun,  3 Jul 2016 17:53:31 +0000 (UTC)	[thread overview]
Message-ID: <1467568227.84aa6c743581222a3f4a8a855dbcb77a2774c5b6.zmedico@gentoo> (raw)

commit:     84aa6c743581222a3f4a8a855dbcb77a2774c5b6
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jul  3 06:08:13 2016 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jul  3 17:50:27 2016 +0000
URL:        https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=84aa6c74

eshowkw: migrate to PORTAGE_REPOSITORIES (bug 587856)

Since PORTDIR_OVERLAY is deprecated, migrate to PORTAGE_REPOSITORIES.

X-Gentoo-bug: 587856
X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=587856

 pym/gentoolkit/eshowkw/__init__.py | 32 +++++++++++++++++++++++++++-----
 1 file changed, 27 insertions(+), 5 deletions(-)

diff --git a/pym/gentoolkit/eshowkw/__init__.py b/pym/gentoolkit/eshowkw/__init__.py
index ded166d..42a3860 100644
--- a/pym/gentoolkit/eshowkw/__init__.py
+++ b/pym/gentoolkit/eshowkw/__init__.py
@@ -1,5 +1,5 @@
 #	vim:fileencoding=utf-8
-# Copyright 2010 Gentoo Foundation
+# Copyright 2010-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 __package__ = 'gentoolkit.eshowkw'
@@ -122,10 +122,32 @@ def main(argv, indirect = False):
 			msg_err = 'No ebuilds at "%s"' % currdir
 			raise SystemExit(msg_err)
 		package= '%s/%s' % (os.path.basename(os.path.abspath('../')), os.path.basename(currdir))
-		ourtree = os.path.abspath('../../')
-		overlays = '%s %s' % (ports['PORTDIR_OVERLAY'], ourtree)
-		mysettings = portc(local_config=False, env={'PORTDIR_OVERLAY': overlays})
-		dbapi = portdbapi(mysettings=mysettings)
+		ourtree = os.path.realpath('../..')
+		ourstat = os.stat(ourtree)
+		ourstat = (ourstat.st_ino, ourstat.st_dev)
+		for repo in ports.repositories:
+			try:
+				repostat = os.stat(repo.location)
+			except OSError:
+				continue
+			if ourstat == (repostat.st_ino, repostat.st_dev):
+				dbapi = portdbapi(mysettings=portc(local_config=False))
+				break
+		else:
+			repos = {}
+			for repo in ports.repositories:
+				repos[repo.name] = repo.location
+
+			with open(os.path.join(ourtree, 'profiles', 'repo_name'),
+				'rt') as f:
+				repo_name = f.readline().strip()
+
+			repos[repo_name] = ourtree
+			repos = ''.join('[{}]\nlocation={}\n'.format(k, v)
+				for k, v in repos.items())
+			mysettings = portc(local_config=False,
+				env={'PORTAGE_REPOSITORIES': repos})
+			dbapi = portdbapi(mysettings=mysettings)
 		# specify that we want just our nice tree we are in cwd
 		dbapi.porttrees = [ourtree]
 		process_display(package, keywords, dbapi)


             reply	other threads:[~2016-07-03 17:53 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-03 17:53 Zac Medico [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-07-09  1:49 [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/eshowkw/ Mike Gilbert
2022-06-08 20:11 Brian Dolbec
2022-06-08  1:19 Brian Dolbec
2022-06-08  0:12 Brian Dolbec
2020-01-26 15:20 Michał Górny
2019-05-11 20:26 Michał Górny
2018-01-26 23:25 Michał Górny
2018-01-26 23:25 Michał Górny
2018-01-26 23:25 Michał Górny
2018-01-26 23:25 Michał Górny
2018-01-26 23:25 Michał Górny
2018-01-26 23:25 Michał Górny
2018-01-26 23:25 Michał Górny
2018-01-26 23:25 Michał Górny
2016-11-23 23:26 Zac Medico
2016-07-03 17:59 Zac Medico
2016-07-03  4:23 Zac Medico
2016-04-06 17:25 Paul Varner
2016-03-31 22:10 Paul Varner
2016-03-17 21:39 Dirkjan Ochtman
2015-11-19 11:59 Justin Lecher
2015-11-17 10:19 Justin Lecher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1467568227.84aa6c743581222a3f4a8a855dbcb77a2774c5b6.zmedico@gentoo \
    --to=zmedico@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox