def archive(self, archive_path: str, extract_path: str) -> None: SUDO.folder_assert(extract_path) archive_temp = make_temp_path("zip-archive-temp") SUDO.parent_ensure(archive_temp) zipper = CmdZip() zipper.with_archive(archive_temp) zipper.with_extract(extract_path) zipper.execute_unit_sert() SUDO.files_move(archive_temp, archive_path)
def archive(self, archive_path: str, extract_path: str) -> None: SUDO.folder_assert(extract_path) archive_temp = make_temp_path("zip-archive-temp") SUDO.parent_ensure(archive_temp) tar = Tar() tar.with_archive(archive_temp) tar.with_extract(extract_path) tar.with_packer(archive_path) tar.with_make_pack() # keep last tar.execute_unit_sert() SUDO.files_move(archive_temp, archive_path)
def archive(self, archive_path: str, extract_path: str) -> None: logger.debug(f"pack.archive.tar: {extract_path}") SUDO.folder_assert(extract_path) archive_temp = make_temp_path("tar-archive-temp") SUDO.parent_ensure(archive_temp) tar = Tar() tar.with_archive(archive_temp) tar.with_extract(extract_path) tar.with_packer(archive_path) tar.with_make_pack() # keep last tar.execute_unit_sert() SUDO.files_move(archive_temp, archive_path) synchronize_header(extract_path, archive_path)