3 # Copyright 2002-2010 Gentoo Technologies, Inc.
4 # Distributed under the terms of the GNU General Public License v2 or later
8 """equery is a flexible utility for Gentoo linux which can display various
9 information about packages, such as the files they own, their USE flags,
10 the MD5 sum of each file owned by a given package, and many other things.
14 # This block ensures that ^C interrupts are handled quietly.
18 def exithandler(signum,frame):
19 signal.signal(signal.SIGINT, signal.SIG_IGN)
20 signal.signal(signal.SIGTERM, signal.SIG_IGN)
24 signal.signal(signal.SIGINT, exithandler)
25 signal.signal(signal.SIGTERM, exithandler)
26 signal.signal(signal.SIGPIPE, signal.SIG_DFL)
28 except KeyboardInterrupt:
32 from gentoolkit import equery, errors
36 except errors.GentoolkitException, err:
37 if '--debug' in sys.argv:
40 from gentoolkit import pprinter as pp
41 sys.stderr.write(pp.error(str(err)))
43 print "Add '--debug' to global options for traceback."