added file dependency check, switched back to english, smaller fix and improvements

This commit is contained in:
fatalerrors
2021-11-18 14:53:11 +01:00
parent 9fc9b96165
commit b71a0c2ee8
21 changed files with 360 additions and 173 deletions

View File

@@ -22,9 +22,14 @@ export DEP_upgrade_dist="conf_ntp"
upgrade_dist()
{
local proxyfile=/etc/apt/apt.conf.d/00proxy
local norecommends=/etc/apt/apt.conf.d/99no-recommends
# We backup entire apt dir as future version will normalise source.list files
backupdist /etc/apt
prnt I "Basic apt configuration..."
echo 'APT::Install-Recommends "false";' > $norecommends
echo 'APT::AutoRemove::RecommendsImportant "false";' >> $norecommends
echo 'APT::AutoRemove::SuggestsImportant "false";' >> $norecommends
prnt I "Configuration du proxy pour APT..."
if [[ -n $PROXYAPT ]]; then
@@ -35,7 +40,7 @@ upgrade_dist()
)
fi
echo "# Generated automatically on $(stdtime) by $0" > $proxyfile
echo "Acquire::http::Proxy \"http://${PROXYAPT}:${PROXYAPTPORT}\";" >> $proxyfile
echo "Acquire::http::Proxy \"http://${PROXYAPT}:${PROXYAPT_PORT}\";" >> $proxyfile
elif [[ -n $http_proxy ]]; then
echo "# Generated automatically on $(stdtime) by $0" > $proxyfile
echo "Acquire::http::Proxy \"http://${http_proxy}\";" >> $proxyfile
@@ -44,7 +49,7 @@ upgrade_dist()
fi
# Remplace source.list from dist with ours (be smarter)
installfile "${SYS_DIST}_${SYS_VER}.list" /etc/apt/sources.list
installfile "pkgman/${SYS_DIST}_${SYS_VER}.list" /etc/apt/sources.list
prnt I "Mise à jour de la liste des paquets..."
pkgupdt
@@ -61,13 +66,14 @@ precheck_upgrade_dist()
prnt I "Vérification du réseau..."
if [[ $(noerror wget -q --tries=10 --timeout=20 --spider http://www.cnrs.fr) != 0 ]]; then
prnt E "Réseau non fonctionnel ! Abandon."
prnt E "It seems network configuration is not functionnal! Giving up."
die 160
fi
if [[ -n $PROXYAPT && -z $PROXYAPTPORT ]]; then
if [[ -n $PROXYAPT && -z $PROXYAPT_PORT ]]; then
prnt E "Un serveur proxy a été spécifié mais pas son port d'usage."
die 160
fi
file_exists pkgman/${SYS_DIST}_${SYS_VER}.list
}
cron_upgrade_dist()