mirror of
https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git
synced 2025-07-23 04:25:10 +03:00
treewide: split chroots from workdir
Introduce a new "cache" subdirectory in the pmbootstrap workdir, all the cache and config bits go in here, anything that needs to be accessible from inside a chroot. The whole dir is then bind-mounted into the chroot as /cache with appropriate symlinks. This dir is in the config as config.cache. In addition, all the cache_* and other config dirs are renamed to be closer to the names of the equivalent dirs in the chroot (e.g. abuild-config) and to avoid redundant naming since they are now under a "cache" dir. Signed-off-by: Casey Connolly <kcxt@postmarketos.org>
This commit is contained in:
parent
1560a3f221
commit
9f8edf539d
34 changed files with 130 additions and 127 deletions
|
@ -56,7 +56,7 @@ def copy_to_buildpath(
|
|||
def abuild_overrides(apkbuild: Path) -> None:
|
||||
"""Override some abuild functions by patching the APKBUILD file."""
|
||||
|
||||
if apkbuild.is_relative_to(get_context().config.work / "cache_git"):
|
||||
if apkbuild.is_relative_to(get_context().config.cache / "git"):
|
||||
raise ValueError(f"Refusing to patch file in pmaports repo: {apkbuild}")
|
||||
|
||||
# Patch the APKBUILD file
|
||||
|
@ -144,7 +144,7 @@ def index_repo(arch: Arch | None = None) -> None:
|
|||
paths: list[Path] = []
|
||||
|
||||
for channel in pmb.config.pmaports.all_channels():
|
||||
pkgdir: Path = get_context().config.work / "packages" / channel
|
||||
pkgdir: Path = get_context().config.cache / "packages" / channel
|
||||
if arch:
|
||||
paths.append(pkgdir / arch)
|
||||
else:
|
||||
|
@ -153,7 +153,7 @@ def index_repo(arch: Arch | None = None) -> None:
|
|||
for path in paths:
|
||||
if path.is_dir():
|
||||
path_channel, path_arch = path.parts[-2:]
|
||||
path_repo_chroot = Path("/mnt/pmbootstrap/packages") / path_channel / path_arch
|
||||
path_repo_chroot = Path("/cache/packages") / path_channel / path_arch
|
||||
logging.debug(f"(native) index {path_channel}/{path_arch} repository")
|
||||
description = str(datetime.datetime.now())
|
||||
commands = [
|
||||
|
@ -210,7 +210,7 @@ def configure_ccache(chroot: Chroot = Chroot.native(), verify: bool = False) ->
|
|||
# Check if the settings have been set already
|
||||
arch = chroot.arch
|
||||
config = get_context().config
|
||||
path = config.work / f"cache_ccache_{arch}" / "ccache.conf"
|
||||
path = config.cache / f"ccache_{arch}" / "ccache.conf"
|
||||
if os.path.exists(path):
|
||||
with open(path, encoding="utf-8") as handle:
|
||||
for line in handle:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue