listupgrade: upstream release 21.06.1
This commit is contained in:
parent
dbc853a815
commit
dd32ab5688
|
@ -29,7 +29,7 @@ The **patch** part changes incrementally at each release.
|
||||||
* evolinux-base: copy GPG key instead of using apt-key
|
* evolinux-base: copy GPG key instead of using apt-key
|
||||||
* evomaintenance: upstream release 0.6.4
|
* evomaintenance: upstream release 0.6.4
|
||||||
* kvm-host: replace the "kvm-tools" package with scripts deployed by Ansible
|
* kvm-host: replace the "kvm-tools" package with scripts deployed by Ansible
|
||||||
* listupgrade: upstream release 21.06
|
* listupgrade: upstream release 21.06.1
|
||||||
* nodejs: change GPG key name
|
* nodejs: change GPG key name
|
||||||
* ntpd: Add leapfile configuration setting to ntpd on debian 10+
|
* ntpd: Add leapfile configuration setting to ntpd on debian 10+
|
||||||
* packweb-apache: install phpMyAdmin from buster-backports
|
* packweb-apache: install phpMyAdmin from buster-backports
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
# - 60 : current release is not in the $r_releases list
|
# - 60 : current release is not in the $r_releases list
|
||||||
# - 70 : at least an upgradable package is not in the $r_packages list
|
# - 70 : at least an upgradable package is not in the $r_packages list
|
||||||
|
|
||||||
VERSION="21.06"
|
VERSION="21.06.1"
|
||||||
|
|
||||||
show_version() {
|
show_version() {
|
||||||
cat <<END
|
cat <<END
|
||||||
|
@ -152,21 +152,21 @@ force_mode() {
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
# Update APT cache and get packages to upgrade and packages on hold.
|
# Update APT cache and get packages to upgrade and packages on hold.
|
||||||
aptUpdateOutput=$(apt update 2>&1 | (grep -E -ve '^(Listing|WARNING|$)' -e upgraded -e 'up to date' || true))
|
aptUpdateOutput=$(apt -o Dir::State::Lists="${listupgrade_state_dir}" update 2>&1 | (grep -E -ve '^(Listing|WARNING|$)' -e upgraded -e 'up to date' || true))
|
||||||
|
|
||||||
if echo "${aptUpdateOutput}" | grep -E "^Err(:[0-9]+)? http"; then
|
if echo "${aptUpdateOutput}" | grep -E "^Err(:[0-9]+)? http"; then
|
||||||
echo "FATAL - Not able to fetch all sources (probably a pesky (mini)firewall). Please, fix me"
|
echo "FATAL - Not able to fetch all sources (probably a pesky (mini)firewall). Please, fix me" >&2
|
||||||
post_hooks_and_exit 100
|
post_hooks_and_exit 100
|
||||||
fi
|
fi
|
||||||
|
|
||||||
apt-mark showhold | sed -e 's/\(.\+\)/^\1\//' >"${packagesHold}"
|
apt-mark showhold | sed -e 's/\(.\+\)/^\1\//' >"${packagesHold}"
|
||||||
apt list --upgradable 2>&1 | grep -v -f "${packagesHold}" | grep -v -E '^(Listing|WARNING|$)' >"${packages}"
|
apt -o Dir::State::Lists="${listupgrade_state_dir}" list --upgradable 2>&1 | grep -v -f "${packagesHold}" | grep -v -E '^(Listing|WARNING|$)' >"${packages}"
|
||||||
packagesParsable=$(cut -f 1 -d / <"${packages}" | tr '\n' ' ')
|
packagesParsable=$(cut -f 1 -d / <"${packages}" | tr '\n' ' ')
|
||||||
|
|
||||||
# No updates? Exit!
|
# No updates? Exit!
|
||||||
if [ ! -s "${packages}" ]; then
|
if [ ! -s "${packages}" ]; then
|
||||||
if ! cron_mode; then
|
if ! cron_mode; then
|
||||||
echo "There is nothing to upgrade. Bye."
|
echo "There is nothing to upgrade. Bye." >&2
|
||||||
fi
|
fi
|
||||||
post_hooks_and_exit 0
|
post_hooks_and_exit 0
|
||||||
fi
|
fi
|
||||||
|
@ -283,7 +283,7 @@ main() {
|
||||||
/usr/sbin/sendmail "${mailto}" <"${template}"
|
/usr/sbin/sendmail "${mailto}" <"${template}"
|
||||||
|
|
||||||
# Now we try to fetch all the packages for the next update session
|
# Now we try to fetch all the packages for the next update session
|
||||||
downloadstatus=$(apt dist-upgrade --assume-yes --download-only -q2 2>&1)
|
downloadstatus=$(apt -o Dir::State::Lists="${listupgrade_state_dir}" dist-upgrade --assume-yes --download-only -q2 2>&1)
|
||||||
echo "${downloadstatus}" | grep -q 'Download complete and in download only mode'
|
echo "${downloadstatus}" | grep -q 'Download complete and in download only mode'
|
||||||
|
|
||||||
# shellcheck disable=SC2181
|
# shellcheck disable=SC2181
|
||||||
|
@ -295,15 +295,15 @@ main() {
|
||||||
if which lxc-ls >/dev/null; then
|
if which lxc-ls >/dev/null; then
|
||||||
for container in $(lxc-ls); do
|
for container in $(lxc-ls); do
|
||||||
|
|
||||||
aptUpdateOutput=$(lxc-attach -n "${container}" -- apt update 2>&1 | (grep -Eve '^(Listing|WARNING|$)' -e upgraded -e 'up to date' || true))
|
aptUpdateOutput=$(lxc-attach -n "${container}" -- apt -o Dir::State::Lists="${listupgrade_state_dir}" update 2>&1 | (grep -Eve '^(Listing|WARNING|$)' -e upgraded -e 'up to date' || true))
|
||||||
|
|
||||||
if (echo "${aptUpdateOutput}" | grep -E "^Err(:[0-9]+)? http"); then
|
if (echo "${aptUpdateOutput}" | grep -E "^Err(:[0-9]+)? http"); then
|
||||||
echo "FATAL CONTAINER - Not able to fetch all sources (probably a pesky (mini)firewall). Please, fix me"
|
echo "FATAL CONTAINER - Not able to fetch all sources (probably a pesky (mini)firewall). Please, fix me" >&2
|
||||||
post_hooks_and_exit 150
|
post_hooks_and_exit 150
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Now we try to fetch all the packages for the next update session
|
# Now we try to fetch all the packages for the next update session
|
||||||
downloadstatus=$(lxc-attach -n "${container}" -- apt dist-upgrade --assume-yes --download-only -q2 2>&1)
|
downloadstatus=$(lxc-attach -n "${container}" -- apt -o Dir::State::Lists="${listupgrade_state_dir}" dist-upgrade --assume-yes --download-only -q2 2>&1)
|
||||||
|
|
||||||
if echo "${downloadstatus}" | grep -q 'Download complete and in download only mode'; then
|
if echo "${downloadstatus}" | grep -q 'Download complete and in download only mode'; then
|
||||||
echo "${downloadstatus}"
|
echo "${downloadstatus}"
|
||||||
|
@ -357,6 +357,7 @@ mailto="${clientmail}"
|
||||||
date="Ce jeudi entre 18h00 et 23h00."
|
date="Ce jeudi entre 18h00 et 23h00."
|
||||||
hostname=$(grep HOSTNAME /etc/evomaintenance.cf | cut -d'=' -f2)
|
hostname=$(grep HOSTNAME /etc/evomaintenance.cf | cut -d'=' -f2)
|
||||||
hostname=${hostname%%.evolix.net}
|
hostname=${hostname%%.evolix.net}
|
||||||
|
listupgrade_state_dir="${listupgrade_state_dir:-/var/lib/listupgrade}"
|
||||||
hooksDir="/etc/evolinux/listupgrade-hooks"
|
hooksDir="/etc/evolinux/listupgrade-hooks"
|
||||||
|
|
||||||
# If hostname is composed with -, remove the first part.
|
# If hostname is composed with -, remove the first part.
|
||||||
|
|
Loading…
Reference in a new issue