small fixes
This commit is contained in:
parent
81f22e67ae
commit
0e21f9060d
5 changed files with 9 additions and 8 deletions
2
cache.py
2
cache.py
|
@ -5,7 +5,7 @@ from config import config
|
||||||
from wrapper import enforce_wrap
|
from wrapper import enforce_wrap
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
PATHS = ['chroots', 'pacman', 'jumpdrive']
|
PATHS = ['chroots', 'pacman', 'jumpdrive', 'packages']
|
||||||
|
|
||||||
|
|
||||||
@click.group(name='cache')
|
@click.group(name='cache')
|
||||||
|
|
|
@ -101,7 +101,7 @@ def create_chroot_user(
|
||||||
if password:
|
if password:
|
||||||
install_script += f'echo "{user}:{password}" | chpasswd'
|
install_script += f'echo "{user}:{password}" | chpasswd'
|
||||||
else:
|
else:
|
||||||
install_script += 'passwd'
|
install_script += 'echo "Set user password:" && passwd'
|
||||||
result = run_chroot_cmd(install_script, chroot_name=chroot_name, chroot_base_path=chroot_base_path)
|
result = run_chroot_cmd(install_script, chroot_name=chroot_name, chroot_base_path=chroot_base_path)
|
||||||
if result.returncode != 0:
|
if result.returncode != 0:
|
||||||
raise Exception('Failed to setup user')
|
raise Exception('Failed to setup user')
|
||||||
|
|
|
@ -97,7 +97,7 @@ class Distro:
|
||||||
extras = [Repo(name, url_template=info.url_template, arch=self.arch, options=info.options, scan=False) for name, info in extra_repos.items()]
|
extras = [Repo(name, url_template=info.url_template, arch=self.arch, options=info.options, scan=False) for name, info in extra_repos.items()]
|
||||||
return '\n'.join(repo.config_snippet() for repo in (list(self.repos.values()) + extras))
|
return '\n'.join(repo.config_snippet() for repo in (list(self.repos.values()) + extras))
|
||||||
|
|
||||||
def get_pacman_conf(self, extra_repos: dict[str, RepoInfo] = []):
|
def get_pacman_conf(self, extra_repos: dict[str, RepoInfo] = [], check_space=False):
|
||||||
header = f'''
|
header = f'''
|
||||||
#
|
#
|
||||||
# /etc/pacman.conf
|
# /etc/pacman.conf
|
||||||
|
@ -133,7 +133,7 @@ Architecture = {self.arch}
|
||||||
#UseSyslog
|
#UseSyslog
|
||||||
Color
|
Color
|
||||||
#NoProgressBar
|
#NoProgressBar
|
||||||
CheckSpace
|
{'' if check_space else '#'}CheckSpace
|
||||||
VerbosePkgLists
|
VerbosePkgLists
|
||||||
ParallelDownloads = 8
|
ParallelDownloads = 8
|
||||||
|
|
||||||
|
|
2
image.py
2
image.py
|
@ -173,7 +173,7 @@ def cmd_build():
|
||||||
)
|
)
|
||||||
create_chroot_user(chroot_name, user=profile['username'], password=profile['password'])
|
create_chroot_user(chroot_name, user=profile['username'], password=profile['password'])
|
||||||
if post_cmds:
|
if post_cmds:
|
||||||
result = run_chroot_cmd(' && '.join(post_cmds, chroot_name))
|
result = run_chroot_cmd(' && '.join(post_cmds), chroot_name)
|
||||||
if result.returncode != 0:
|
if result.returncode != 0:
|
||||||
raise Exception('Error running post_cmds')
|
raise Exception('Error running post_cmds')
|
||||||
|
|
||||||
|
|
|
@ -119,7 +119,7 @@ def check_prebuilts(dir: str = None):
|
||||||
|
|
||||||
|
|
||||||
def discover_packages(dir: str = None) -> dict[str, Package]:
|
def discover_packages(dir: str = None) -> dict[str, Package]:
|
||||||
dir = dir if dir else config.get_paths('pkgbuilds')
|
dir = dir if dir else config.get_path('pkgbuilds')
|
||||||
packages = {}
|
packages = {}
|
||||||
paths = []
|
paths = []
|
||||||
|
|
||||||
|
@ -287,8 +287,9 @@ def check_package_version_built(package: Package) -> bool:
|
||||||
|
|
||||||
for line in result.stdout.decode('utf-8').split('\n'):
|
for line in result.stdout.decode('utf-8').split('\n'):
|
||||||
if line != "":
|
if line != "":
|
||||||
file = os.path.basename(line)
|
file = os.path.join(config.get_path('packages'), package.repo, os.path.basename(line))
|
||||||
if not os.path.exists(os.path.join(config.get_path('packages'), package.repo, file)):
|
logging.debug(f'Checking if {file} is built')
|
||||||
|
if not os.path.exists(file):
|
||||||
built = False
|
built = False
|
||||||
|
|
||||||
return built
|
return built
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue