mirror of
https://github.com/truenas/scale-build.git
synced 2025-12-24 21:07:00 +00:00
Add endpoint to setup build dir for package
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
import contextlib
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
@@ -168,3 +169,14 @@ class BuildPackageMixin:
|
|||||||
@property
|
@property
|
||||||
def deflags(self):
|
def deflags(self):
|
||||||
return ['--no-lintian', f'-j{self.jobs if self.jobs else os.cpu_count()}', '-us', '-uc', '-b']
|
return ['--no-lintian', f'-j{self.jobs if self.jobs else os.cpu_count()}', '-us', '-uc', '-b']
|
||||||
|
|
||||||
|
@contextlib.contextmanager
|
||||||
|
def build_dir(self):
|
||||||
|
try:
|
||||||
|
self.delete_overlayfs()
|
||||||
|
self.setup_chroot_basedir()
|
||||||
|
self.make_overlayfs()
|
||||||
|
shutil.copytree(self.source_path, self.source_in_chroot, dirs_exist_ok=True, symlinks=True)
|
||||||
|
yield
|
||||||
|
finally:
|
||||||
|
self.delete_overlayfs()
|
||||||
|
|||||||
Reference in New Issue
Block a user