summaryrefslogtreecommitdiffstats
path: root/bin/emerge
blob: 1ef575e1304be6243f4530b53a13759dc5fc48db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/python
# Copyright Gentoo Foundation 2006
# Portage Emerge bits
# $Id$

try:
	import _emerge
except ImportError:
	from os import path as osp
	import sys
	sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
	import _emerge

if __name__ == "__main__":
	import sys
	from portage.exception import ParseError, PermissionDenied
	try:
		retval = _emerge.emerge_main()
	except PermissionDenied, e:
		sys.stderr.write("Permission denied: '%s'\n" % str(e))
		sys.exit(e.errno)
	except ParseError, e:
		sys.stderr.write("%s\n" % str(e))
		sys.exit(1)
	sys.exit(retval)