Merge pull request #196 from saveriomiroddi/fix_invoke_super_functions

Fix functions endlessly invoking themselves
This commit is contained in:
Saverio Miroddi 2021-04-30 19:47:17 +02:00 committed by GitHub
commit f1726951d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -150,21 +150,24 @@ c_udevadm_settle_timeout=10 # seconds
# A target function must exist, otherwise a error is raised, unless `--optional` is specified. # A target function must exist, otherwise a error is raised, unless `--optional` is specified.
# `--optional` is useful when a step is specific to a single distribution, e.g. Debian's root password. # `--optional` is useful when a step is specific to a single distribution, e.g. Debian's root password.
# #
# WATCH OUT! Don't forget *not* to call this from an ovverridden function, otherwise, it will call itself
# endlessly!
#
# Examples: # Examples:
# #
# $ function install_jail_zfs_packages { :; } # $ function install_jail_zfs_packages { :; }
# $ function install_jail_zfs_packages_Debian { :; } # $ function install_jail_zfs_packages_Debian { :; }
# $ distro_dependent_invoke "install_jail_zfs_packages" # $ invoke "install_jail_zfs_packages"
# #
# If the distribution is `Debian`, the second will be invoked, otherwise, the first. # If the distribution is `Debian`, the second will be invoked, otherwise, the first.
# #
# $ function update_zed_cache_Ubuntu { :; } # $ function update_zed_cache_Ubuntu { :; }
# $ distro_dependent_invoke "update_zed_cache" --optional # $ invoke "update_zed_cache" --optional
# #
# If the distribution is `Debian`, nothing will happen. # If the distribution is `Debian`, nothing will happen.
# #
# $ function update_zed_cache_Ubuntu { :; } # $ function update_zed_cache_Ubuntu { :; }
# $ distro_dependent_invoke "update_zed_cache" # $ invoke "update_zed_cache"
# #
# If the distribution is `Debian`, an error will be raised. # If the distribution is `Debian`, an error will be raised.
# #
@ -547,7 +550,7 @@ function prepare_standard_repositories_Linuxmint {
# The universe repository may be already enabled, but it's more solid to ensure it. # The universe repository may be already enabled, but it's more solid to ensure it.
# #
invoke "prepare_standard_repositories" prepare_standard_repositories
} }
function prepare_standard_repositories_Debian { function prepare_standard_repositories_Debian {
@ -1320,7 +1323,7 @@ function install_jail_zfs_packages_UbuntuServer {
if [[ $v_use_ppa != "1" ]]; then if [[ $v_use_ppa != "1" ]]; then
chroot_execute "apt install --yes zfsutils-linux zfs-initramfs" chroot_execute "apt install --yes zfsutils-linux zfs-initramfs"
else else
invoke "install_jail_zfs_packages" install_jail_zfs_packages
fi fi
} }