2 # Copyright 2005-2013 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
5 """System health checks and maintenance utilities.
8 from __future__ import print_function
12 # This block ensures that ^C interrupts are handled quietly.
16 def exithandler(signum,frame):
17 signal.signal(signal.SIGINT, signal.SIG_IGN)
18 signal.signal(signal.SIGTERM, signal.SIG_IGN)
21 signal.signal(signal.SIGINT, exithandler)
22 signal.signal(signal.SIGTERM, exithandler)
23 signal.signal(signal.SIGPIPE, signal.SIG_DFL)
25 except KeyboardInterrupt:
28 from os import path as osp
29 pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")
30 sys.path.insert(0, pym_path)
32 portage._internal_caller = True
33 from portage.emaint.main import emaint_main
36 emaint_main(sys.argv[1:])
38 if e.errno == errno.EACCES:
39 print("\nemaint: Need superuser access")