Thu, 24 Jul 2008 22:46:27 -0400
Be more careful on SIGINT/SIGKILL cleanup.
Don't blow away .dtrx-*, instead look for our specific extraction directory
and delete that.
TODO | file | annotate | diff | comparison | revisions | |
scripts/dtrx | file | annotate | diff | comparison | revisions |
--- a/TODO Thu Jul 24 22:35:38 2008 -0400 +++ b/TODO Thu Jul 24 22:46:27 2008 -0400 @@ -2,11 +2,6 @@ To do: -* Investigate the right way to handle SIGPIPE and do so. - -* --expert mode: prompts don't show an explanation of what the options are, - unless you ask with ?. - Things which I have a use case/anti-use case for: * Support pisi packages (http://paketler.pardus.org.tr/pardus-2007/) * Steal ideas from <http://martin.ankerl.com/files/e>. @@ -22,3 +17,5 @@ * Use zipfile instead of the zip commands. * Processing from stdin. * shar support. +* --expert mode: prompts don't show an explanation of what the options are, + unless you ask with ?.
--- a/scripts/dtrx Thu Jul 24 22:35:38 2008 -0400 +++ b/scripts/dtrx Thu Jul 24 22:46:27 2008 -0400 @@ -1009,14 +1009,18 @@ print logger.debug("traceback:\n" + ''.join(traceback.format_stack(frame)).rstrip()) - logger.debug("got signal %s; cleaning up" % (signal_num,)) - clean_targets = set([os.path.realpath('.')]) - if hasattr(self, 'current_directory'): - clean_targets.add(os.path.realpath(self.current_directory)) - for directory in clean_targets: - os.chdir(directory) - for path in glob.glob('.dtrx-*'): - self.clean_destination(path) + logger.debug("got signal %s" % (signal_num,)) + try: + basename = self.current_extractor.target + except AttributeError: + basename = None + if basename is not None: + logger.debug("cleaning up %s" % (basename,)) + clean_targets = set([os.path.realpath('.')]) + if hasattr(self, 'current_directory'): + clean_targets.add(os.path.realpath(self.current_directory)) + for directory in clean_targets: + self.clean_destination(os.path.join(directory, basename)) sys.exit(1) def parse_options(self, arguments): @@ -1108,6 +1112,7 @@ def try_extractors(self, filename, builder): errors = [] for extractor in builder: + self.current_extractor = extractor # For the abort() method. error = self.action.run(filename, extractor) if error: errors.append((extractor.file_type, extractor.encoding, error,