Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 587856
Collapse All | Expand All

(-)a/pym/gentoolkit/eshowkw/__init__.py (-6 / +27 lines)
Lines 1-5 Link Here
1
#	vim:fileencoding=utf-8
1
#	vim:fileencoding=utf-8
2
# Copyright 2010 Gentoo Foundation
2
# Copyright 2010-2016 Gentoo Foundation
3
# Distributed under the terms of the GNU General Public License v2
3
# Distributed under the terms of the GNU General Public License v2
4
4
5
__package__ = 'gentoolkit.eshowkw'
5
__package__ = 'gentoolkit.eshowkw'
Lines 122-131 def main(argv, indirect = False): Link Here
122
			msg_err = 'No ebuilds at "%s"' % currdir
122
			msg_err = 'No ebuilds at "%s"' % currdir
123
			raise SystemExit(msg_err)
123
			raise SystemExit(msg_err)
124
		package= '%s/%s' % (os.path.basename(os.path.abspath('../')), os.path.basename(currdir))
124
		package= '%s/%s' % (os.path.basename(os.path.abspath('../')), os.path.basename(currdir))
125
		ourtree = os.path.abspath('../../')
125
		ourtree = os.path.realpath('../..')
126
		overlays = '%s %s' % (ports['PORTDIR_OVERLAY'], ourtree)
126
		ourstat = os.stat(ourtree)
127
		mysettings = portc(local_config=False, env={'PORTDIR_OVERLAY': overlays})
127
		ourstat = (ourstat.st_ino, ourstat.st_dev)
128
		dbapi = portdbapi(mysettings=mysettings)
128
		for repo in ports.repositories:
129
			try:
130
				repostat = os.stat(repo.location)
131
			except OSError:
132
				continue
133
			if ourstat == (repostat.st_ino, repostat.st_dev):
134
				dbapi = portdbapi(mysettings=portc(local_config=False))
135
				break
136
		else:
137
			repos = {}
138
			for repo in ports.repositories:
139
				repos[repo.name] = repo.location
140
141
			with open(os.path.join(ourtree, 'profiles', 'repo_name'),
142
				'rt') as f:
143
				repo_name = f.readline().strip()
144
145
			repos[repo_name] = ourtree
146
			repos = ''.join('[{}]\nlocation={}\n'.format(k, v)
147
				for k, v in repos.items())
148
			mysettings = portc(local_config=False,
149
				env={'PORTAGE_REPOSITORIES': repos})
150
			dbapi = portdbapi(mysettings=mysettings)
129
		# specify that we want just our nice tree we are in cwd
151
		# specify that we want just our nice tree we are in cwd
130
		dbapi.porttrees = [ourtree]
152
		dbapi.porttrees = [ourtree]
131
		process_display(package, keywords, dbapi)
153
		process_display(package, keywords, dbapi)
132
- 

Return to bug 587856