def _file_requires_unpack(self, input_file, output_dir, cache, config_entry): if cache: output_dir = archive.get_output_path(input_file, output_dir) input_file_changed = cache.entry_has_changed(input_file) output_dir_changed = False if not config_entry or self._is_destination_cache_enabled(config_entry): output_dir_changed = not os.path.exists(output_dir) or cache.entry_has_changed(output_dir) if input_file_changed: g_log.info("File %s has changed" % input_file) if output_dir_changed: g_log.info("Output directory %s has changed" % output_dir) return input_file_changed or output_dir_changed g_log.info("Cache is not found so we need to unpack") return True
def _update_cache(self, input_file, output_dir, cache, config_entry): if cache: if not config_entry or self._is_destination_cache_enabled(config_entry): cache.update_entry(archive.get_output_path(input_file, output_dir)) cache.update_entry(input_file) cache.flush()
def _unpack_file(self, input_file, output_dir): g_log.info("Extracting %s to %s..." % (input_file, output_dir)) self._remove_file(archive.get_output_path(input_file, output_dir)) archive.unpack(input_file, output_dir) g_log.info("Extracting %s... DONE" % (input_file))