mirror of
https://github.com/YunoHost/package_check.git
synced 2024-09-03 20:06:20 +02:00
yolo: attempt to preinstall apt dependencies in the initial lxc snapshot
This commit is contained in:
parent
e7b47542c8
commit
94abddf58d
2 changed files with 16 additions and 0 deletions
|
@ -49,6 +49,8 @@ LXC_CREATE () {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
set_witness_files
|
set_witness_files
|
||||||
|
_PREINSTALL_APT_DEPS
|
||||||
|
|
||||||
sleep 3
|
sleep 3
|
||||||
log_info "Creating initial snapshot $LXC_NAME ..."
|
log_info "Creating initial snapshot $LXC_NAME ..."
|
||||||
lxc snapshot $LXC_NAME snap0
|
lxc snapshot $LXC_NAME snap0
|
||||||
|
|
14
lib/tests.sh
14
lib/tests.sh
|
@ -4,6 +4,20 @@
|
||||||
# "Low-level" logistic helpers
|
# "Low-level" logistic helpers
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
|
_PREINSTALL_APT_DEPS()
|
||||||
|
{
|
||||||
|
[[ -e $package_path/manifest.toml ]] || return
|
||||||
|
|
||||||
|
local apt_deps=$(python3 -c "import toml, sys; t = toml.loads(sys.stdin.read()); p = t['resources'].get('apt', {}).get('packages', ''); print(p.replace(',', ' ')) if isinstance(p, str) else print(' '.join(p));" < $package_path/manifest.toml)
|
||||||
|
|
||||||
|
log_small_title "Preinstalling apt dependencies before creating the initial snapshot..."
|
||||||
|
RUN_INSIDE_LXC apt install $apt_deps || true
|
||||||
|
|
||||||
|
# Execute the command given in argument in the container and log its results.
|
||||||
|
lxc exec $LXC_NAME -t -- /bin/bash -c "apt install $apt_deps" | tee -a "$full_log" >/dev/null
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
_RUN_YUNOHOST_CMD() {
|
_RUN_YUNOHOST_CMD() {
|
||||||
|
|
||||||
log_debug "Running yunohost $1"
|
log_debug "Running yunohost $1"
|
||||||
|
|
Loading…
Add table
Reference in a new issue