def extract(self, archive_path: str, extract_path: str) -> None: SUDO.file_assert(archive_path) extract_temp = make_temp_path("zip-extract-temp") SUDO.folder_ensure(extract_temp) zipper = CmdUnZip() zipper.with_archive(archive_path) zipper.with_extract(extract_temp) zipper.execute_unit_sert() SUDO.files_move(extract_temp, extract_path)
def extract(self, archive_path: str, extract_path: str) -> None: SUDO.file_assert(archive_path) extract_temp = make_temp_path("zip-extract-temp") SUDO.folder_ensure(extract_temp) tar = Tar() tar.with_archive(archive_path) tar.with_extract(extract_temp) tar.with_packer(archive_path) tar.with_make_unpack() # keep last tar.execute_unit_sert() SUDO.files_move(extract_temp, extract_path)
def extract(self, archive_path: str, extract_path: str) -> None: logger.debug(f"pack.extract.tar: {extract_path}") SUDO.file_assert(archive_path) extract_temp = make_temp_path("tar-extract-temp") SUDO.folder_ensure(extract_temp) tar = Tar() tar.with_archive(archive_path) tar.with_extract(extract_temp) tar.with_packer(archive_path) tar.with_make_unpack() # keep last tar.execute_unit_sert() if SUDO.folder_check(extract_path): # user rsync to preserve active machines SUDO.files_sync_full(extract_temp, extract_path) SUDO.files_delete(extract_temp) else: # user move for efficiency SUDO.files_move(extract_temp, extract_path) synchronize_header(archive_path, extract_path)