Separate step "prepare_standard_repositories", and add universe repository

This commit is contained in:
Saverio Miroddi 2021-04-28 15:55:11 +02:00
parent cca6b2bef9
commit 84b3cbe9c0

View File

@ -531,22 +531,33 @@ export ZFS_FREE_TAIL_SPACE=12
trap _exit_hook EXIT trap _exit_hook EXIT
} }
function update_apt_index { function prepare_standard_repositories {
apt update # Make sure it's enabled. Ubuntu MATE has it, while the standard Ubuntu doesn't.
# The program exits with success if the repository is already enabled.
#
add-apt-repository --yes --no-update universe
} }
# Mint 20 has the CDROM repository enabled, but apt fails when updating due to it (or possibly due # Mint 20 has the CDROM repository enabled, but apt fails when updating due to it (or possibly due
# to it being incorrectly setup). # to it being incorrectly setup).
# #
function update_apt_index_Linuxmint { function prepare_standard_repositories_Linuxmint {
perl -i -pe 's/^(deb cdrom)/# $1/' /etc/apt/sources.list perl -i -pe 's/^(deb cdrom)/# $1/' /etc/apt/sources.list
invoke "update_apt_index" # The universe repository may be already enabled, but it's more solid to ensure it.
#
invoke "prepare_standard_repositories"
}
function prepare_standard_repositories_Debian {
# Debian doesn't require universe (for dialog).
:
}
function update_apt_index {
apt update
} }
# REQUIREMENT: it must be ensured that, for any distro, `apt update` is invoked at this step, as
# subsequent steps rely on it.
#
# There are three parameters: # There are three parameters:
# #
# 1. the tools are preinstalled (ie. Ubuntu Desktop based); # 1. the tools are preinstalled (ie. Ubuntu Desktop based);
@ -1514,6 +1525,7 @@ invoke "save_disks_log"
invoke "find_suitable_disks" invoke "find_suitable_disks"
invoke "register_exit_hook" invoke "register_exit_hook"
invoke "create_passphrase_named_pipe" invoke "create_passphrase_named_pipe"
invoke "prepare_standard_repositories"
invoke "update_apt_index" invoke "update_apt_index"
invoke "set_zfs_ppa_requirement" invoke "set_zfs_ppa_requirement"
invoke "install_dialog_package" invoke "install_dialog_package"