diff options
author | Will Woods <wwoods@redhat.com> | 2009-02-20 17:43:23 -0500 |
---|---|---|
committer | Will Woods <wwoods@redhat.com> | 2009-02-20 17:43:23 -0500 |
commit | adbeea396641962f8a9ee347caa5750777d2fc0f (patch) | |
tree | 079889a43122d0b7026806e64dad42fedc0f1c45 | |
parent | 48088e7545e07adbc30fb8ff851de0f0a8d759c2 (diff) | |
download | debuginfofs-adbeea396641962f8a9ee347caa5750777d2fc0f.tar.gz debuginfofs-adbeea396641962f8a9ee347caa5750777d2fc0f.tar.xz debuginfofs-adbeea396641962f8a9ee347caa5750777d2fc0f.zip |
Handle KeyboardInterrupt better
-rw-r--r-- | TODO | 1 | ||||
-rwxr-xr-x | debuginfofs-mirror | 11 |
2 files changed, 9 insertions, 3 deletions
@@ -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" |