Fix missing quotation mark
[gentoolkit.git] / bin / equery
1 #!/usr/bin/python
2 #
3 # Copyright 2002-2010 Gentoo Technologies, Inc.
4 # Distributed under the terms of the GNU General Public License v2 or later
5 #
6 # $Header$
7
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.
11 """
12
13 import sys
14 # This block ensures that ^C interrupts are handled quietly.
15 try:
16         import signal
17
18         def exithandler(signum,frame):
19                 signal.signal(signal.SIGINT, signal.SIG_IGN)
20                 signal.signal(signal.SIGTERM, signal.SIG_IGN)
21                 print
22                 sys.exit(1)
23
24         signal.signal(signal.SIGINT, exithandler)
25         signal.signal(signal.SIGTERM, exithandler)
26         signal.signal(signal.SIGPIPE, signal.SIG_DFL)
27
28 except KeyboardInterrupt:
29         print
30         sys.exit(1)
31
32 from gentoolkit import equery, errors
33
34 try:
35         equery.main()
36 except errors.GentoolkitException, err:
37         if '--debug' in sys.argv:
38                 raise
39         else:
40                 from gentoolkit import pprinter as pp
41                 sys.stderr.write(pp.error(str(err)))
42                 print
43                 print "Add '--debug' to global options for traceback."
44                 sys.exit(1)