1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/lxd_ynh.git synced 2024-09-03 19:45:53 +02:00

Apply suggestions from code review

This commit is contained in:
Kayou 2024-02-06 20:54:56 +01:00 committed by GitHub
parent de909638b2
commit 1a0b1cc8dd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 11 additions and 32 deletions

View file

@ -56,15 +56,17 @@ ram.runtime = "500M"
[resources.apt]
packages = [
# According to https://documentation.ubuntu.com/lxd/en/latest/installing/#install-lxd-from-source
"acl",
"attr",
"autoconf",
"automake",
"dnsmasq-base",
"git",
"libacl1-dev",
"libcap-dev",
"liblxc1",
"lxc-dev",
"liblxc-dev",
"libsqlite3-dev",
"libtool",
"libudev-dev",
@ -78,20 +80,11 @@ ram.runtime = "500M"
"tcl",
"xz-utils",
"ebtables",
"libapparmor-dev",
"libseccomp-dev",
"libcap-dev",
# For lvm2
"lvm2",
"thin-provisioning-tools",
"btrfs-progs",
"busybox",
"libattr1-dev",
"libuv1",
"libdevmapper-event1.02.1",
"dmeventd",
"lxc",
"tcl8.6",
# For debuging
"iproute2",
# For btrfs
"btrfs-progs"
]

View file

@ -94,14 +94,7 @@ ynh_remove_systemd_socket_config () {
}
_ynh_add_dnsmasq() {
# Declare an array to define the options of this helper.
local legacy_args=t
local -A args_array=( [t]=template= )
local template
ynh_handle_getopts_args "$@"
local template="${template:-dnsmasq.conf}"
ynh_add_config --template="$template" --destination="/etc/dnsmasq.d/$app"
ynh_add_config --template="dnsmasq.conf" --destination="/etc/dnsmasq.d/$app"
ynh_systemd_action --service_name=dnsmasq --action=restart
}
@ -113,14 +106,7 @@ _ynh_remove_dnsmasq() {
}
_ynh_add_ld_so() {
# Declare an array to define the options of this helper.
local legacy_args=t
local -A args_array=( [t]=template= )
local template
ynh_handle_getopts_args "$@"
local template="${template:-ld.so.conf}"
ynh_add_config --template="$template" --destination="/etc/ld.so.conf.d/$app.conf"
ynh_add_config --template="ld.so.conf" --destination="/etc/ld.so.conf.d/$app.conf"
ldconfig
}

View file

@ -32,7 +32,7 @@ ynh_restore_file --origin_path="/etc/bash_completion.d/lxd-client"
#=================================================
# RESTORE SYSTEM CONFIGURATIONS
#=================================================
ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1
ynh_script_progression --message="Restoring system configurations related to $app..."
ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
ynh_restore_file --origin_path="/etc/systemd/system/$app.socket"

View file

@ -22,7 +22,7 @@ ynh_systemd_action --service_name="$app" --action="stop" --log_path="/var/log/$a
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
ynh_script_progression --message="Ensuring downward compatibility..."
# Remove old file
if [ -f "/usr/local/bin/lxd-p2c" ]; then