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

View file

@ -94,14 +94,7 @@ ynh_remove_systemd_socket_config () {
} }
_ynh_add_dnsmasq() { _ynh_add_dnsmasq() {
# Declare an array to define the options of this helper. ynh_add_config --template="dnsmasq.conf" --destination="/etc/dnsmasq.d/$app"
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_systemd_action --service_name=dnsmasq --action=restart ynh_systemd_action --service_name=dnsmasq --action=restart
} }
@ -113,14 +106,7 @@ _ynh_remove_dnsmasq() {
} }
_ynh_add_ld_so() { _ynh_add_ld_so() {
# Declare an array to define the options of this helper. ynh_add_config --template="ld.so.conf" --destination="/etc/ld.so.conf.d/$app.conf"
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"
ldconfig ldconfig
} }

View file

@ -32,7 +32,7 @@ ynh_restore_file --origin_path="/etc/bash_completion.d/lxd-client"
#================================================= #=================================================
# RESTORE SYSTEM CONFIGURATIONS # 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.service"
ynh_restore_file --origin_path="/etc/systemd/system/$app.socket" 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 # ENSURE DOWNWARD COMPATIBILITY
#================================================= #=================================================
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 ynh_script_progression --message="Ensuring downward compatibility..."
# Remove old file # Remove old file
if [ -f "/usr/local/bin/lxd-p2c" ]; then if [ -f "/usr/local/bin/lxd-p2c" ]; then