From adbeea396641962f8a9ee347caa5750777d2fc0f Mon Sep 17 00:00:00 2001 From: Will Woods Date: Fri, 20 Feb 2009 17:43:23 -0500 Subject: Handle KeyboardInterrupt better --- TODO | 1 - debuginfofs-mirror | 11 +++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/TODO b/TODO index cdcadf9..524ef07 100644 --- a/TODO +++ b/TODO @@ -4,7 +4,6 @@ For 1.0: - Fix half-assed i18n - Clean up methods (move stuff from __main__ to the class) - Unpack RPMS to a temporary dir, move it into place (atomic create) - - Handle KeyboardInterrupt better, jeez - RPM package - debuginfofs (client) - debuginfofs-server diff --git a/debuginfofs-mirror b/debuginfofs-mirror index 935719e..6c7fdb0 100755 --- a/debuginfofs-mirror +++ b/debuginfofs-mirror @@ -74,6 +74,7 @@ class DebuginfoFSDownloader(YumUtilBase): help="download debuginfo for this version of the distro.") o.add_option("--basearch", default="i386", help="download debuginfo for this arch") + # TODO: --skip-download, --force-unpack def setup(self): self.modify_options() @@ -178,10 +179,10 @@ def mkdebuginfolinks(sourcedir, targetdir): count += 1 return count -if __name__ == '__main__': +# TODO: break this up into more logical chunks +def main(): y = DebuginfoFSDownloader() opt = y.setup() - # FIXME handle KeyboardInterrupt # FIXME this is stupid - figure out how --verbose works if opt.verbose: y.logger = y.verbose_logger @@ -320,3 +321,9 @@ if __name__ == '__main__': # Make hardlinks r = mkdebuginfolinks(targetdir, os.path.join(opt.exportdir,'build-id')) y.logger.info("Linked %3i debuginfo file%s" % (r, r != 1 and "s" or "")) + +if __name__ == '__main__': + try: + main() + except KeyboardInterrupt: + print "Exiting on keyboard interrupt" -- cgit