MCPcopy Create free account
hub / github.com/ClangBuiltLinux/tc-build / extract

Method extract

tc_build/source.py:69–88  ·  view source on GitHub ↗
(self, extraction_location: Path)

Source from the content-addressed store, hash-verified

67 raise RuntimeError(msg)
68
69 def extract(self, extraction_location: Path) -> None:
70 if not tc_build.utils.path_is_set(self.local_location):
71 msg = 'No local tarball location specified?'
72 raise RuntimeError(msg)
73 if not self.local_location.exists():
74 msg = f"Local tarball ('{self.local_location}') could not be found, download it first?"
75 raise RuntimeError(msg)
76
77 extraction_location.mkdir(exist_ok=True, parents=True)
78 tar_cmd = [
79 'tar',
80 '--auto-compress',
81 f"--directory={extraction_location}",
82 '--extract',
83 f"--file={self.local_location}",
84 '--strip-components=1',
85 ]
86
87 tc_build.utils.print_info(f"Extracting {self.local_location} into {extraction_location}...")
88 subprocess.run(tar_cmd, check=True)
89
90
91class SourceManager:

Callers 2

prepareMethod · 0.80
prepareMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected