diff --git a/blergh b/blergh deleted file mode 100644 index 190a180..0000000 --- a/blergh +++ /dev/null @@ -1 +0,0 @@ -123 diff --git a/chroot.py b/chroot.py index a855292..5e88b75 100644 --- a/chroot.py +++ b/chroot.py @@ -14,7 +14,7 @@ def create_chroot( chroot_name, arch='aarch64', packages=['base'], - pacman_conf='/app/local/etc/pacman.conf', + pacman_conf=os.path.join(config.runtime['script_source_dir'], 'local/etc/pacman.conf'), extra_repos: dict[str, RepoInfo] = {}, chroot_base_path: str = None, ): diff --git a/config.py b/config.py index ad59eb0..bd22a5d 100644 --- a/config.py +++ b/config.py @@ -47,6 +47,7 @@ CONFIG_RUNTIME_DEFAULTS = { 'config_file': None, 'arch': None, 'no_wrap': False, + 'script_source_dir': os.path.dirname(os.path.realpath(__file__)) } diff --git a/image.py b/image.py index 5c4b607..e925ed8 100644 --- a/image.py +++ b/image.py @@ -168,7 +168,7 @@ def cmd_build(): create_chroot( chroot_name, packages=packages, - pacman_conf='/app/local/etc/pacman.conf', + pacman_conf=os.path.join(config.runtime['script_source_dir'], 'local/etc/pacman.conf'), extra_repos=extra_repos, ) create_chroot_user(chroot_name, user=profile['username'], password=profile['password']) diff --git a/packages.py b/packages.py index 53f4e18..b144436 100644 --- a/packages.py +++ b/packages.py @@ -17,12 +17,12 @@ makepkg_env = os.environ.copy() | { 'MAKEFLAGS': f"-j{multiprocessing.cpu_count() if config.file['build']['threads'] < 1 else config.file['build']['threads']}", } -makepkg_cross_env = makepkg_env | {'PACMAN': '/app/local/bin/pacman_aarch64'} +makepkg_cross_env = makepkg_env | {'PACMAN': os.path.join(config.runtime['script_source_dir'], '/local/bin/pacman_aarch64')} makepkg_cmd = [ 'makepkg', '--config', - '/app/local/etc/makepkg.conf', + os.path.join(config.runtime['script_source_dir'], 'local/etc/makepkg.conf'), '--noconfirm', '--ignorearch', '--needed', @@ -301,7 +301,7 @@ def setup_build_chroot(arch='aarch64', extra_packages=[]) -> str: chroot_path = create_chroot( chroot_name, packages=['base-devel', 'git'] + extra_packages, - pacman_conf='/app/local/etc/pacman.conf', + pacman_conf=os.path.join(config.runtime['script_source_dir'], 'local/etc/pacman.conf'), extra_repos=get_kupfer_local(arch).repos, ) diff --git a/wrapper.py b/wrapper.py index b9dd299..4fec968 100644 --- a/wrapper.py +++ b/wrapper.py @@ -49,7 +49,7 @@ def wrap_docker(): results.append(arg) return results - script_path = os.path.dirname(os.path.realpath(__file__)) + script_path = config.runtime['script_source_dir'] with open(os.path.join(script_path, 'version.txt')) as version_file: version = version_file.read().replace('\n', '') tag = f'registry.gitlab.com/kupfer/kupferbootstrap:{version}'