3 # Copyright 2010 Brian Dolbec <brian.dolbec@gmail.com>
4 # Copyright 2002-2010 Gentoo Technologies, Inc.
5 # Distributed under the terms of the GNU General Public License v2 or later
9 """'revdep-rebuild' scans libraries and binaries for missing shared library dependencies and attempts to fix them by re-emerging
10 those broken binaries and shared libraries. It is useful when an upgraded package breaks other software packages that are
11 dependent upon the upgraded package.
14 from __future__ import print_function
17 # This block ensures that ^C interrupts are handled quietly.
21 def exithandler(signum,frame):
22 signal.signal(signal.SIGINT, signal.SIG_IGN)
23 signal.signal(signal.SIGTERM, signal.SIG_IGN)
27 signal.signal(signal.SIGINT, exithandler)
28 signal.signal(signal.SIGTERM, exithandler)
29 signal.signal(signal.SIGPIPE, signal.SIG_DFL)
32 except KeyboardInterrupt:
36 from gentoolkit import errors
37 from gentoolkit.revdep_rebuild import rebuild
40 success = rebuild.main(rebuild.parse_options())
42 except errors.GentoolkitException as err:
43 if '--debug' in sys.argv:
46 from gentoolkit import pprinter as pp
47 sys.stderr.write(pp.error(str(err)))
49 print("Add '--debug' to global options for traceback.")