示例#1
0
 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)
示例#2
0
文件: zip.py 项目: viogq/nspawn
 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)
示例#3
0
文件: tar.py 项目: viogq/nspawn
 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)