generator.generate_pacman_conf_body(): add in_chroot=False param to use config.get_path('pacman') if necessary

This commit is contained in:
InsanePrawn 2022-08-23 21:41:41 +02:00
parent 5a794ba3dd
commit 3952892029
5 changed files with 10 additions and 5 deletions

View file

@ -193,7 +193,9 @@ export LDFLAGS="$LDFLAGS,-L/usr/{hostspec}/lib,-L/{chroot}/usr/lib,-rpath-link,/
def generate_pacman_conf_body(
arch: Arch,
check_space: bool = True,
in_chroot: bool = True,
):
pacman_cache = config.get_path('pacman') if not in_chroot else CHROOT_PATHS['pacman']
return f'''
#
# /etc/pacman.conf
@ -208,7 +210,7 @@ def generate_pacman_conf_body(
# If you wish to use different paths, uncomment and update the paths.
#RootDir = /
#DBPath = /var/lib/pacman/
CacheDir = {CHROOT_PATHS['pacman']}/{arch}
CacheDir = {pacman_cache}/{arch}
#LogFile = /var/log/pacman.log
#GPGDir = /etc/pacman.d/gnupg/
#HookDir = /etc/pacman.d/hooks/