From 4355ab1d299ef8822667debb513367ae624de754 Mon Sep 17 00:00:00 2001 From: Robin Candau Date: Sat, 6 Jul 2024 23:42:17 +0200 Subject: [PATCH 01/10] feat: Check for services that require a post upgrade restart Check if any services need to be restarted after updating and offers to do so (if there are). The listing of the services is done via `checkservices` from [archlinux/contrib](https://github.com/archlinux/contrib) (available in the [extra] [archlinux-contrib](https://archlinux.org/packages/extra/any/archlinux-contrib/) package). The `dbus-broker.service` and `systemd-logind.service` services are purposely excluded from the listing as they are known for creating issues on restart (see https://github.com/bus1/dbus-broker/issues/93 & https://askubuntu.com/questions/1057028/ubuntu-18-04-freezes-when-running-systemctl-restart-systemd-logind-service) Close https://github.com/Antiz96/arch-update/issues/181 --- README-fr.md | 8 +++-- README.md | 6 ++-- doc/man/arch-update.1 | 6 +++- doc/man/fr/arch-update.1 | 6 +++- src/script/arch-update.sh | 61 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 80 insertions(+), 7 deletions(-) diff --git a/README-fr.md b/README-fr.md index a9e078d8..a7b75418 100644 --- a/README-fr.md +++ b/README-fr.md @@ -29,6 +29,7 @@ Fonctionnalités : - Vérification et listing automatiques des paquets orphelins et propose de les supprimer. - Vérification automatique de la présence d'anciens paquets et/ou paquets désinstallés dans le cache et propose de les supprimer. - Listing et aide au traitement des fichiers pacnew/pacsave. +- Vérification automatique des services nécessitant un redémarrage d'après mise à jour et propose de les redémarrer s'il y en a. - Vérification automatique des mises à jour du noyau en attente nécessitant un redémarrage et propose de redémarrer s'il y en a une. - Support de `sudo`, `doas` et `run0`. - Prise en charge optionnelle des paquets AUR (via `yay` ou `paru`). @@ -40,14 +41,14 @@ Fonctionnalités : ### AUR Installez le paquet AUR [arch-update](https://aur.archlinux.org/packages/arch-update "arch-update AUR package"). -Consultez également [la liste des dépendances optionnelles](https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=arch-update#n11) dont vous pourriez avoir besoin. +Consultez également la liste des dépendances optionnelles (disponible dans la section ["depuis la source"](#depuis-la-source) ci-dessous) dont vous pourriez avoir besoin. ### Depuis la source Installez les dépendances requises : ```bash -sudo pacman -S --needed pacman-contrib curl htmlq diffutils hicolor-icon-theme python python-pyqt6 qt6-svg glib2 +sudo pacman -S --needed pacman-contrib archlinux-contrib curl htmlq diffutils hicolor-icon-theme python python-pyqt6 qt6-svg glib2 ``` Dépendances optionnelles supplémentaires dont vous pourriez avoir besoin ou que vous pourriez souhaiter : @@ -179,7 +180,8 @@ Codes de sortie : 7 Aucune mise à jour en attente durant l'utilisation de l'option `-l/--list` 8 Erreur lors de la génération d'un fichier de configuration avec l'option `--gen-config` 9 Erreur lors de la lecture du fichier de configuration avec l'option `--show-config` -10 Erreur lors de la creation du fichier desktop autostart pour l'applet systray avec l'option `--tray --enable` +10 Erreur lors de la creation du fichier desktop autostart pour l'applet systray avec l'option `--tray --enable` +11 Erreur lors du redémarrage des services nécessitant un redémarrage après mise à jour ``` Pour plus d'informations, consultez la page de manuel arch-update(1). diff --git a/README.md b/README.md index b484c81d..086d9c10 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ Features: - Automatic check and listing of orphan packages and offers to remove them. - Automatic check for old and/or uninstalled cached packages and offers to remove them. - Lists and helps you processing pacnew/pacsave files. +- Automatic check for services requiring a post update restart and offers to do so if there are. - Automatic check for pending kernel updates requiring a reboot to be applied and offers to do so if there's one. - Support for `sudo`, `doas` & `run0`. - Optional support for AUR packages (through `yay` or `paru`). @@ -40,14 +41,14 @@ Features: ### AUR Install the [arch-update](https://aur.archlinux.org/packages/arch-update "arch-update AUR package") AUR package. -Also check [the list of optional dependencies](https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=arch-update#n11) you might need or want. +See also the list of optional dependencies (available in the ["from source"](#from-source) section below) you may need. ### From Source Install required dependencies: ```bash -sudo pacman -S --needed pacman-contrib curl htmlq diffutils hicolor-icon-theme python python-pyqt6 qt6-svg glib2 +sudo pacman -S --needed pacman-contrib archlinux-contrib curl htmlq diffutils hicolor-icon-theme python python-pyqt6 qt6-svg glib2 ``` Additional optional dependencies you might need or want: @@ -180,6 +181,7 @@ Exit Codes: 8 Error when generating a configuration file with the `--gen-config` option 9 Error when reading the configuration file with the `--show-config` option 10 Error when creating the autostart desktop file for the systray applet with the `--tray --enable` option +11 Error when restarting services that require a post upgrade restart ``` For more information, see the arch-update(1) man page. diff --git a/doc/man/arch-update.1 b/doc/man/arch-update.1 index cda6993c..7a4071ec 100644 --- a/doc/man/arch-update.1 +++ b/doc/man/arch-update.1 @@ -20,7 +20,7 @@ If no option is passed, launch the relevant series of functions to perform a com .br Before performing the update, it offers to display the latest Arch Linux news to the user. By default, Arch news are only displayed if at least a new one has been published since the last run. Arch news published since the last run or at the same date are tagged as '[NEW]'. .br -Arch-Update also checks for orphan packages, unused Flatpak packages, old and/or uninstalled cached packages in pacman's cache, pacnew/pacsave files and pending kernel update requiring a reboot to be applied and, if there are, offers to process them. +Arch-Update also checks for orphan packages, unused Flatpak packages, old and/or uninstalled cached packages in pacman's cache, pacnew/pacsave files, services requiring a post update restart as well as pending kernel update requiring a reboot to be applied and, if there are, offers to process them. .br Those functions are launched when you click on the systray applet. @@ -227,6 +227,10 @@ Error when calling the reboot command to apply a pending kernel update .B 10 .RB "Error when creating the autostart desktop file for the systray applet with the " "--tray --enable " "option" +.TP +.B 11 +Error when restarting services that require a post upgrade restart + .SH SEE ALSO .BR checkupdates (8), .BR pacman (8), diff --git a/doc/man/fr/arch-update.1 b/doc/man/fr/arch-update.1 index 65822122..a41514dd 100644 --- a/doc/man/fr/arch-update.1 +++ b/doc/man/fr/arch-update.1 @@ -20,7 +20,7 @@ Si aucune option n'est passée, lance la série de fonctions adéquates pour eff .br Avant d'effectuer la mise à jour, propose d'afficher les dernières Arch news à l'utilisateur. Par défaut, les Arch news sont seulement affichées si au moins une nouvelle news a été publiée depuis la dernière exécution. Les Arch news publiées depuis la dernière exécution ou à la même date sont étiquetées comme '[NOUVEAU]'. .br -Arch-Update vérifie aussi la présence de paquets orphelins/inutilisés, d'anciens paquets mis en cache, de fichiers pacnew/pacsave et de mise à jour du noyau en attente et, s'il y en a, propose de les traiter. +Arch-Update vérifie aussi la présence de paquets orphelins/inutilisés, d'anciens paquets mis en cache, de fichiers pacnew/pacsave, de services nécessitant un redémarrage après mise à jour, ainsi que les mises à jour du noyau en attente et, s'il y en a, propose de les traiter. .br Ces fonctions sont lancées quand vous cliquez sur l'applet systray. @@ -227,6 +227,10 @@ Erreur lors de l'appel de la commande reboot pour appliquer une mise à jour du .B 10 .RB "Erreur lors de la création du fichier desktop autostart pour l'applet systray avec l'option " "--tray --enable" +.TP +.B 11 +Erreur lors du redémarrage des services nécessitant un redémarrage après mise à jour + .SH VOIR AUSSI .BR checkupdates (8), .BR pacman (8), diff --git a/src/script/arch-update.sh b/src/script/arch-update.sh index 77d9beee..bf024e38 100755 --- a/src/script/arch-update.sh +++ b/src/script/arch-update.sh @@ -632,6 +632,66 @@ pacnew_files() { fi } +# Definition of the restart_services function: Verify if any services require a post update restart +restart_services() { + services=$(yes No | sudo checkservices -FP 2> /dev/null | grep ".service" | grep -v -e "dbus-broker.service" -e "systemd-logind.service" | cut -f2 -d "'") + services_num=$(echo "${services}" | wc -l) + + if [ -n "${services}" ]; then + if [ "${services_num}" -eq 1 ]; then + main_msg "$(eval_gettext "Services:\nThe following service requires a post upgrade restart\n")" + else + main_msg "$(eval_gettext "Services:\nThe following services require a post upgrade restart\n")" + fi + + i=1 + while IFS= read -r line; do + echo "${i} - ${line}" + ((i=i+1)) + done < <(printf '%s\n' "${services}") + + ask_msg_array "$(eval_gettext "Select the service(s) to restart (e.g. 1 3 5), select 0 to restart them all or press \"enter\" to continue without restarting the service(s):")" + + if [ "${answer_array[0]}" -eq 0 ] 2> /dev/null; then + if ! "${su_cmd}" systemctl restart ${services}; then + error_msg "$(eval_gettext "An error has occurred during service(s) restart\nPlease, verify the above service(s) status\n")" && quit_msg + exit 11 + fi + else + array_to_string=$(printf "%s\n" "${answer_array[@]}") + mapfile -t answer_array < <(echo "${array_to_string}" | awk '!seen[$0]++') + + for num in "${answer_array[@]}"; do + if [ "${num}" -le "${services_num}" ] 2> /dev/null && [ "${num}" -gt "0" ]; then + service_restarted="y" + service_selected=$(sed -n "${num}"p <<< "${services}") + + if "${su_cmd}" systemctl restart "${service_selected}"; then + info_msg "$(eval_gettext "The \${service_selected} service has been successfully restarted")" + else + error_msg "$(eval_gettext "An error occurred during the restart of the \${service_selected} service")" + service_fail="y" + fi + fi + done + + if [ -z "${service_fail}" ]; then + echo + info_msg "$(eval_gettext "Service(s) restarted succesfully\n")" + else + echo + error_msg "$(eval_gettext "An error occurred during the service(s) restart\nPlease, verify the status of the above service(s)\n")" && quit_msg + exit 11 + fi + + if [ -z "${service_restarted}" ]; then + warning_msg "$(eval_gettext "The service(s) restart hasn't been performed\nPlease, consider restarting services that have been updated to fully apply the upgrade\n")" + fi + fi + else + info_msg "$(eval_gettext "No service requiring a post upgrade restart found\n")" + fi +} # Definition of the kernel_reboot function: Verify if there's a kernel update waiting for a reboot to be applied kernel_reboot() { kernel_compare=$(file /boot/vmlinuz* /usr/lib/modules/*/vmlinuz* | sed 's/^.*version\ //' | awk '{print $1}' | grep "$(uname -r)") @@ -684,6 +744,7 @@ full_upgrade() { orphan_packages packages_cache pacnew_files + restart_services kernel_reboot quit_msg } From de08f867cce34f5035bff7dab6e5351f07ac4640 Mon Sep 17 00:00:00 2001 From: Robin Candau Date: Sat, 6 Jul 2024 23:50:32 +0200 Subject: [PATCH 02/10] style: Typo fix --- src/script/arch-update.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/script/arch-update.sh b/src/script/arch-update.sh index bf024e38..42fc2e03 100755 --- a/src/script/arch-update.sh +++ b/src/script/arch-update.sh @@ -677,7 +677,7 @@ restart_services() { if [ -z "${service_fail}" ]; then echo - info_msg "$(eval_gettext "Service(s) restarted succesfully\n")" + info_msg "$(eval_gettext "Service(s) restarted successfully\n")" else echo error_msg "$(eval_gettext "An error occurred during the service(s) restart\nPlease, verify the status of the above service(s)\n")" && quit_msg From 826ae2c341fe3d64430850f0ab584817ed4513c4 Mon Sep 17 00:00:00 2001 From: Robin Candau Date: Sat, 6 Jul 2024 23:59:44 +0200 Subject: [PATCH 03/10] style: Typo fixes --- README-fr.md | 2 +- README.md | 2 +- doc/man/arch-update.1 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README-fr.md b/README-fr.md index a7b75418..cb5dfc5a 100644 --- a/README-fr.md +++ b/README-fr.md @@ -29,7 +29,7 @@ Fonctionnalités : - Vérification et listing automatiques des paquets orphelins et propose de les supprimer. - Vérification automatique de la présence d'anciens paquets et/ou paquets désinstallés dans le cache et propose de les supprimer. - Listing et aide au traitement des fichiers pacnew/pacsave. -- Vérification automatique des services nécessitant un redémarrage d'après mise à jour et propose de les redémarrer s'il y en a. +- Vérification automatique des services nécessitant un redémarrage après mise à jour et propose de les redémarrer s'il y en a. - Vérification automatique des mises à jour du noyau en attente nécessitant un redémarrage et propose de redémarrer s'il y en a une. - Support de `sudo`, `doas` et `run0`. - Prise en charge optionnelle des paquets AUR (via `yay` ou `paru`). diff --git a/README.md b/README.md index 086d9c10..c9dd0dff 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Features: - Automatic check and listing of orphan packages and offers to remove them. - Automatic check for old and/or uninstalled cached packages and offers to remove them. - Lists and helps you processing pacnew/pacsave files. -- Automatic check for services requiring a post update restart and offers to do so if there are. +- Automatic check for services requiring a post upgrade restart and offers to do so if there are. - Automatic check for pending kernel updates requiring a reboot to be applied and offers to do so if there's one. - Support for `sudo`, `doas` & `run0`. - Optional support for AUR packages (through `yay` or `paru`). diff --git a/doc/man/arch-update.1 b/doc/man/arch-update.1 index 7a4071ec..95d127c5 100644 --- a/doc/man/arch-update.1 +++ b/doc/man/arch-update.1 @@ -20,7 +20,7 @@ If no option is passed, launch the relevant series of functions to perform a com .br Before performing the update, it offers to display the latest Arch Linux news to the user. By default, Arch news are only displayed if at least a new one has been published since the last run. Arch news published since the last run or at the same date are tagged as '[NEW]'. .br -Arch-Update also checks for orphan packages, unused Flatpak packages, old and/or uninstalled cached packages in pacman's cache, pacnew/pacsave files, services requiring a post update restart as well as pending kernel update requiring a reboot to be applied and, if there are, offers to process them. +Arch-Update also checks for orphan packages, unused Flatpak packages, old and/or uninstalled cached packages in pacman's cache, pacnew/pacsave files, services requiring a post upgrade restart as well as pending kernel update requiring a reboot to be applied and, if there are, offers to process them. .br Those functions are launched when you click on the systray applet. From fa43d980a704113c4db0bf5d26ded7e941cc1ce8 Mon Sep 17 00:00:00 2001 From: Robin Candau Date: Sun, 7 Jul 2024 00:20:42 +0200 Subject: [PATCH 04/10] style: Fix various syntax and style stuff --- src/script/arch-update.sh | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/src/script/arch-update.sh b/src/script/arch-update.sh index 42fc2e03..9ff9e8a5 100755 --- a/src/script/arch-update.sh +++ b/src/script/arch-update.sh @@ -650,10 +650,17 @@ restart_services() { ((i=i+1)) done < <(printf '%s\n' "${services}") + echo ask_msg_array "$(eval_gettext "Select the service(s) to restart (e.g. 1 3 5), select 0 to restart them all or press \"enter\" to continue without restarting the service(s):")" if [ "${answer_array[0]}" -eq 0 ] 2> /dev/null; then - if ! "${su_cmd}" systemctl restart ${services}; then + # shellcheck disable=SC2086 + if "${su_cmd}" systemctl restart ${services}; then + echo + info_msg "$(eval_gettext "Service(s) restarted successfully\n")" + + else + echo error_msg "$(eval_gettext "An error has occurred during service(s) restart\nPlease, verify the above service(s) status\n")" && quit_msg exit 11 fi @@ -667,24 +674,26 @@ restart_services() { service_selected=$(sed -n "${num}"p <<< "${services}") if "${su_cmd}" systemctl restart "${service_selected}"; then + echo info_msg "$(eval_gettext "The \${service_selected} service has been successfully restarted")" else + echo error_msg "$(eval_gettext "An error occurred during the restart of the \${service_selected} service")" service_fail="y" fi fi done - if [ -z "${service_fail}" ]; then - echo - info_msg "$(eval_gettext "Service(s) restarted successfully\n")" + if [ -n "${service_restarted}" ]; then + if [ -z "${service_fail}" ]; then + echo + info_msg "$(eval_gettext "Service(s) restarted successfully\n")" + else + echo + error_msg "$(eval_gettext "An error occurred during the service(s) restart\nPlease, verify the status of the above service(s)\n")" && quit_msg + exit 11 + fi else - echo - error_msg "$(eval_gettext "An error occurred during the service(s) restart\nPlease, verify the status of the above service(s)\n")" && quit_msg - exit 11 - fi - - if [ -z "${service_restarted}" ]; then warning_msg "$(eval_gettext "The service(s) restart hasn't been performed\nPlease, consider restarting services that have been updated to fully apply the upgrade\n")" fi fi From 37a36d7b49ca3c7772ee0dade9b1882a7af93e1b Mon Sep 17 00:00:00 2001 From: Robin Candau Date: Sun, 7 Jul 2024 00:31:14 +0200 Subject: [PATCH 05/10] style: Add missing line break --- src/script/arch-update.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/src/script/arch-update.sh b/src/script/arch-update.sh index 9ff9e8a5..ef8f2566 100755 --- a/src/script/arch-update.sh +++ b/src/script/arch-update.sh @@ -694,6 +694,7 @@ restart_services() { exit 11 fi else + echo warning_msg "$(eval_gettext "The service(s) restart hasn't been performed\nPlease, consider restarting services that have been updated to fully apply the upgrade\n")" fi fi From de5f02eb429b0e5b359025d557bb5bbb3bbb3f7a Mon Sep 17 00:00:00 2001 From: Robin Candau Date: Sun, 7 Jul 2024 00:34:32 +0200 Subject: [PATCH 06/10] style: Add missing line break --- src/script/arch-update.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/script/arch-update.sh b/src/script/arch-update.sh index ef8f2566..0107b4c3 100755 --- a/src/script/arch-update.sh +++ b/src/script/arch-update.sh @@ -652,15 +652,14 @@ restart_services() { echo ask_msg_array "$(eval_gettext "Select the service(s) to restart (e.g. 1 3 5), select 0 to restart them all or press \"enter\" to continue without restarting the service(s):")" + echo if [ "${answer_array[0]}" -eq 0 ] 2> /dev/null; then # shellcheck disable=SC2086 if "${su_cmd}" systemctl restart ${services}; then - echo info_msg "$(eval_gettext "Service(s) restarted successfully\n")" else - echo error_msg "$(eval_gettext "An error has occurred during service(s) restart\nPlease, verify the above service(s) status\n")" && quit_msg exit 11 fi @@ -674,10 +673,8 @@ restart_services() { service_selected=$(sed -n "${num}"p <<< "${services}") if "${su_cmd}" systemctl restart "${service_selected}"; then - echo info_msg "$(eval_gettext "The \${service_selected} service has been successfully restarted")" else - echo error_msg "$(eval_gettext "An error occurred during the restart of the \${service_selected} service")" service_fail="y" fi From 38b0b8bada9e1354804070dbd732b2a90dc86421 Mon Sep 17 00:00:00 2001 From: Robin Candau Date: Sun, 7 Jul 2024 00:36:24 +0200 Subject: [PATCH 07/10] style: Remove useless line break --- src/script/arch-update.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/src/script/arch-update.sh b/src/script/arch-update.sh index 0107b4c3..942d8fef 100755 --- a/src/script/arch-update.sh +++ b/src/script/arch-update.sh @@ -691,7 +691,6 @@ restart_services() { exit 11 fi else - echo warning_msg "$(eval_gettext "The service(s) restart hasn't been performed\nPlease, consider restarting services that have been updated to fully apply the upgrade\n")" fi fi From 65f5621cb6ec790f075c5c80abe5d57203270d83 Mon Sep 17 00:00:00 2001 From: Robin Candau Date: Sun, 7 Jul 2024 01:00:17 +0200 Subject: [PATCH 08/10] feat: Only check for post upgrade restart service if packages got upgraded --- src/script/arch-update.sh | 112 ++++++++++++++++++++------------------ 1 file changed, 59 insertions(+), 53 deletions(-) diff --git a/src/script/arch-update.sh b/src/script/arch-update.sh index 942d8fef..95ae27c1 100755 --- a/src/script/arch-update.sh +++ b/src/script/arch-update.sh @@ -423,6 +423,8 @@ update() { echo error_msg "$(eval_gettext "An error has occurred during the update process\nThe update has been aborted\n")" && quit_msg exit 5 + else + packages_updated="y" fi fi @@ -435,6 +437,8 @@ update() { echo error_msg "$(eval_gettext "An error has occurred during the update process\nThe update has been aborted\n")" && quit_msg exit 5 + else + packages_updated="y" fi fi @@ -634,68 +638,70 @@ pacnew_files() { # Definition of the restart_services function: Verify if any services require a post update restart restart_services() { - services=$(yes No | sudo checkservices -FP 2> /dev/null | grep ".service" | grep -v -e "dbus-broker.service" -e "systemd-logind.service" | cut -f2 -d "'") - services_num=$(echo "${services}" | wc -l) - - if [ -n "${services}" ]; then - if [ "${services_num}" -eq 1 ]; then - main_msg "$(eval_gettext "Services:\nThe following service requires a post upgrade restart\n")" - else - main_msg "$(eval_gettext "Services:\nThe following services require a post upgrade restart\n")" - fi - - i=1 - while IFS= read -r line; do - echo "${i} - ${line}" - ((i=i+1)) - done < <(printf '%s\n' "${services}") - - echo - ask_msg_array "$(eval_gettext "Select the service(s) to restart (e.g. 1 3 5), select 0 to restart them all or press \"enter\" to continue without restarting the service(s):")" - echo - - if [ "${answer_array[0]}" -eq 0 ] 2> /dev/null; then - # shellcheck disable=SC2086 - if "${su_cmd}" systemctl restart ${services}; then - info_msg "$(eval_gettext "Service(s) restarted successfully\n")" - + if [ -n "${packages_updated}" ]; then + services=$(yes No | sudo checkservices -FP 2> /dev/null | grep ".service" | grep -v -e "dbus-broker.service" -e "systemd-logind.service" | cut -f2 -d "'") + services_num=$(echo "${services}" | wc -l) + + if [ -n "${services}" ]; then + if [ "${services_num}" -eq 1 ]; then + main_msg "$(eval_gettext "Services:\nThe following service requires a post upgrade restart\n")" else - error_msg "$(eval_gettext "An error has occurred during service(s) restart\nPlease, verify the above service(s) status\n")" && quit_msg - exit 11 + main_msg "$(eval_gettext "Services:\nThe following services require a post upgrade restart\n")" fi - else - array_to_string=$(printf "%s\n" "${answer_array[@]}") - mapfile -t answer_array < <(echo "${array_to_string}" | awk '!seen[$0]++') - - for num in "${answer_array[@]}"; do - if [ "${num}" -le "${services_num}" ] 2> /dev/null && [ "${num}" -gt "0" ]; then - service_restarted="y" - service_selected=$(sed -n "${num}"p <<< "${services}") - - if "${su_cmd}" systemctl restart "${service_selected}"; then - info_msg "$(eval_gettext "The \${service_selected} service has been successfully restarted")" - else - error_msg "$(eval_gettext "An error occurred during the restart of the \${service_selected} service")" - service_fail="y" - fi - fi - done - - if [ -n "${service_restarted}" ]; then - if [ -z "${service_fail}" ]; then - echo + + i=1 + while IFS= read -r line; do + echo "${i} - ${line}" + ((i=i+1)) + done < <(printf '%s\n' "${services}") + + echo + ask_msg_array "$(eval_gettext "Select the service(s) to restart (e.g. 1 3 5), select 0 to restart them all or press \"enter\" to continue without restarting the service(s):")" + echo + + if [ "${answer_array[0]}" -eq 0 ] 2> /dev/null; then + # shellcheck disable=SC2086 + if "${su_cmd}" systemctl restart ${services}; then info_msg "$(eval_gettext "Service(s) restarted successfully\n")" + else - echo - error_msg "$(eval_gettext "An error occurred during the service(s) restart\nPlease, verify the status of the above service(s)\n")" && quit_msg + error_msg "$(eval_gettext "An error has occurred during service(s) restart\nPlease, verify the above service(s) status\n")" && quit_msg exit 11 fi else - warning_msg "$(eval_gettext "The service(s) restart hasn't been performed\nPlease, consider restarting services that have been updated to fully apply the upgrade\n")" + array_to_string=$(printf "%s\n" "${answer_array[@]}") + mapfile -t answer_array < <(echo "${array_to_string}" | awk '!seen[$0]++') + + for num in "${answer_array[@]}"; do + if [ "${num}" -le "${services_num}" ] 2> /dev/null && [ "${num}" -gt "0" ]; then + service_restarted="y" + service_selected=$(sed -n "${num}"p <<< "${services}") + + if "${su_cmd}" systemctl restart "${service_selected}"; then + info_msg "$(eval_gettext "The \${service_selected} service has been successfully restarted")" + else + error_msg "$(eval_gettext "An error occurred during the restart of the \${service_selected} service")" + service_fail="y" + fi + fi + done + + if [ -n "${service_restarted}" ]; then + if [ -z "${service_fail}" ]; then + echo + info_msg "$(eval_gettext "Service(s) restarted successfully\n")" + else + echo + error_msg "$(eval_gettext "An error occurred during the service(s) restart\nPlease, verify the status of the above service(s)\n")" && quit_msg + exit 11 + fi + else + warning_msg "$(eval_gettext "The service(s) restart hasn't been performed\nPlease, consider restarting services that have been updated to fully apply the upgrade\n")" + fi fi + else + info_msg "$(eval_gettext "No service requiring a post upgrade restart found\n")" fi - else - info_msg "$(eval_gettext "No service requiring a post upgrade restart found\n")" fi } # Definition of the kernel_reboot function: Verify if there's a kernel update waiting for a reboot to be applied From b736ce5d35f9829a7c575a4fb3cf9e049ea676a6 Mon Sep 17 00:00:00 2001 From: Robin Candau Date: Sun, 7 Jul 2024 01:13:02 +0200 Subject: [PATCH 09/10] fix: Exclude most well-knows display managers' services from the listing --- src/script/arch-update.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/script/arch-update.sh b/src/script/arch-update.sh index 95ae27c1..b8446aa8 100755 --- a/src/script/arch-update.sh +++ b/src/script/arch-update.sh @@ -639,7 +639,7 @@ pacnew_files() { # Definition of the restart_services function: Verify if any services require a post update restart restart_services() { if [ -n "${packages_updated}" ]; then - services=$(yes No | sudo checkservices -FP 2> /dev/null | grep ".service" | grep -v -e "dbus-broker.service" -e "systemd-logind.service" | cut -f2 -d "'") + services=$(yes No | sudo checkservices -FP 2> /dev/null | grep ".service" | grep -v -e "dbus-broker.service" -e "systemd-logind.service" -e "gdm.service" -e "sddm.service" -e "lightdm.service" -e "lxdm.service" -e "slim.service" -e "xdm.service" -e "greetd.service" -e "nodm.service" -e "ly.service" -e "lemurs.service" | cut -f2 -d "'") services_num=$(echo "${services}" | wc -l) if [ -n "${services}" ]; then From ce9521d543a7a99583d751a23b13125ecbcdbd55 Mon Sep 17 00:00:00 2001 From: Robin Candau Date: Sun, 7 Jul 2024 02:04:17 +0200 Subject: [PATCH 10/10] feat: Add translations --- po/arch-update.pot | 162 +++++++++++++++++++++++------------ po/fr.po | 175 +++++++++++++++++++++++++------------- src/script/arch-update.sh | 6 +- 3 files changed, 227 insertions(+), 116 deletions(-) diff --git a/po/arch-update.pot b/po/arch-update.pot index 4c2ba512..75a5485b 100644 --- a/po/arch-update.pot +++ b/po/arch-update.pot @@ -197,16 +197,16 @@ msgstr "" msgid "Proceed with update? [Y/n]" msgstr "" -#: src/script/arch-update.sh:327 src/script/arch-update.sh:476 -#: src/script/arch-update.sh:509 src/script/arch-update.sh:551 -#: src/script/arch-update.sh:618 src/script/arch-update.sh:644 +#: src/script/arch-update.sh:327 src/script/arch-update.sh:480 +#: src/script/arch-update.sh:513 src/script/arch-update.sh:555 +#: src/script/arch-update.sh:622 src/script/arch-update.sh:716 #, sh-format msgid "Y" msgstr "" -#: src/script/arch-update.sh:327 src/script/arch-update.sh:476 -#: src/script/arch-update.sh:509 src/script/arch-update.sh:551 -#: src/script/arch-update.sh:618 src/script/arch-update.sh:644 +#: src/script/arch-update.sh:327 src/script/arch-update.sh:480 +#: src/script/arch-update.sh:513 src/script/arch-update.sh:555 +#: src/script/arch-update.sh:622 src/script/arch-update.sh:716 #, sh-format msgid "y" msgstr "" @@ -265,242 +265,294 @@ msgstr "" msgid "Updating Packages...\\n" msgstr "" -#: src/script/arch-update.sh:424 src/script/arch-update.sh:436 -#: src/script/arch-update.sh:447 +#: src/script/arch-update.sh:424 src/script/arch-update.sh:438 +#: src/script/arch-update.sh:451 #, sh-format msgid "" "An error has occurred during the update process\\nThe update has been " "aborted\\n" msgstr "" -#: src/script/arch-update.sh:431 +#: src/script/arch-update.sh:433 #, sh-format msgid "Updating AUR Packages...\\n" msgstr "" -#: src/script/arch-update.sh:443 +#: src/script/arch-update.sh:447 #, sh-format msgid "Updating Flatpak Packages...\\n" msgstr "" -#: src/script/arch-update.sh:454 +#: src/script/arch-update.sh:458 #, sh-format msgid "The update has been applied\\n" msgstr "" -#: src/script/arch-update.sh:466 +#: src/script/arch-update.sh:470 #, sh-format msgid "Orphan Packages:" msgstr "" -#: src/script/arch-update.sh:470 +#: src/script/arch-update.sh:474 #, sh-format msgid "" "Would you like to remove this orphan package (and its potential " "dependencies) now? [y/N]" msgstr "" -#: src/script/arch-update.sh:472 +#: src/script/arch-update.sh:476 #, sh-format msgid "" "Would you like to remove these orphan packages (and their potential " "dependencies) now? [y/N]" msgstr "" -#: src/script/arch-update.sh:478 +#: src/script/arch-update.sh:482 #, sh-format msgid "Removing Orphan Packages...\\n" msgstr "" -#: src/script/arch-update.sh:482 src/script/arch-update.sh:515 -#: src/script/arch-update.sh:558 src/script/arch-update.sh:568 -#: src/script/arch-update.sh:578 src/script/arch-update.sh:587 +#: src/script/arch-update.sh:486 src/script/arch-update.sh:519 +#: src/script/arch-update.sh:562 src/script/arch-update.sh:572 +#: src/script/arch-update.sh:582 src/script/arch-update.sh:591 #, sh-format msgid "" "An error has occurred during the removal process\\nThe removal has been " "aborted\\n" msgstr "" -#: src/script/arch-update.sh:485 src/script/arch-update.sh:518 +#: src/script/arch-update.sh:489 src/script/arch-update.sh:522 #, sh-format msgid "The removal has been applied\\n" msgstr "" -#: src/script/arch-update.sh:490 src/script/arch-update.sh:522 -#: src/script/arch-update.sh:595 +#: src/script/arch-update.sh:494 src/script/arch-update.sh:526 +#: src/script/arch-update.sh:599 #, sh-format msgid "The removal hasn't been applied\\n" msgstr "" -#: src/script/arch-update.sh:494 +#: src/script/arch-update.sh:498 #, sh-format msgid "No orphan package found\\n" msgstr "" -#: src/script/arch-update.sh:499 +#: src/script/arch-update.sh:503 #, sh-format msgid "Flatpak Unused Packages:" msgstr "" -#: src/script/arch-update.sh:503 +#: src/script/arch-update.sh:507 #, sh-format msgid "Would you like to remove this Flatpak unused package now? [y/N]" msgstr "" -#: src/script/arch-update.sh:505 +#: src/script/arch-update.sh:509 #, sh-format msgid "Would you like to remove these Flatpak unused packages now? [y/N]" msgstr "" -#: src/script/arch-update.sh:511 +#: src/script/arch-update.sh:515 #, sh-format msgid "Removing Flatpak Unused Packages..." msgstr "" -#: src/script/arch-update.sh:526 +#: src/script/arch-update.sh:530 #, sh-format msgid "No Flatpak unused package found\\n" msgstr "" -#: src/script/arch-update.sh:543 +#: src/script/arch-update.sh:547 #, sh-format msgid "Cached Packages:\\nThere's an old or uninstalled cached package\\n" msgstr "" -#: src/script/arch-update.sh:544 +#: src/script/arch-update.sh:548 #, sh-format msgid "Would you like to remove it from the cache now? [Y/n]" msgstr "" -#: src/script/arch-update.sh:546 +#: src/script/arch-update.sh:550 #, sh-format msgid "Cached Packages:\\nThere are old and/or uninstalled cached packages\\n" msgstr "" -#: src/script/arch-update.sh:547 +#: src/script/arch-update.sh:551 #, sh-format msgid "Would you like to remove them from the cache now? [Y/n]" msgstr "" -#: src/script/arch-update.sh:554 src/script/arch-update.sh:574 +#: src/script/arch-update.sh:558 src/script/arch-update.sh:578 #, sh-format msgid "Removing old cached packages..." msgstr "" -#: src/script/arch-update.sh:564 src/script/arch-update.sh:583 +#: src/script/arch-update.sh:568 src/script/arch-update.sh:587 #, sh-format msgid "Removing uninstalled cached packages..." msgstr "" -#: src/script/arch-update.sh:599 +#: src/script/arch-update.sh:603 #, sh-format msgid "No old or uninstalled cached package found\\n" msgstr "" -#: src/script/arch-update.sh:608 +#: src/script/arch-update.sh:612 #, sh-format msgid "Pacnew Files:" msgstr "" -#: src/script/arch-update.sh:612 +#: src/script/arch-update.sh:616 #, sh-format msgid "Would you like to process this file now? [Y/n]" msgstr "" -#: src/script/arch-update.sh:614 +#: src/script/arch-update.sh:618 #, sh-format msgid "Would you like to process these files now? [Y/n]" msgstr "" -#: src/script/arch-update.sh:620 +#: src/script/arch-update.sh:624 #, sh-format msgid "Processing Pacnew Files...\\n" msgstr "" -#: src/script/arch-update.sh:624 +#: src/script/arch-update.sh:628 #, sh-format msgid "The pacnew file(s) processing has been applied\\n" msgstr "" -#: src/script/arch-update.sh:627 +#: src/script/arch-update.sh:631 #, sh-format msgid "The pacnew file(s) processing hasn't been applied\\n" msgstr "" -#: src/script/arch-update.sh:631 +#: src/script/arch-update.sh:635 #, sh-format msgid "No pacnew file found\\n" msgstr "" -#: src/script/arch-update.sh:640 +#: src/script/arch-update.sh:647 +#, sh-format +msgid "Services:\\nThe following service requires a post upgrade restart\\n" +msgstr "" + +#: src/script/arch-update.sh:649 +#, sh-format +msgid "Services:\\nThe following services require a post upgrade restart\\n" +msgstr "" + +#: src/script/arch-update.sh:659 +#, sh-format +msgid "" +"Select the service(s) to restart (e.g. 1 3 5), select 0 to restart them all " +"or press \"enter\" to continue without restarting the service(s):" +msgstr "" + +#: src/script/arch-update.sh:665 src/script/arch-update.sh:692 +#, sh-format +msgid "Service(s) restarted successfully\\n" +msgstr "" + +#: src/script/arch-update.sh:668 src/script/arch-update.sh:695 +#, sh-format +msgid "" +"An error has occurred during the service(s) restart\\nPlease, verify the " +"above service(s) status\\n" +msgstr "" + +#: src/script/arch-update.sh:681 +#, sh-format +msgid "The ${service_selected} service has been successfully restarted" +msgstr "" + +#: src/script/arch-update.sh:683 +#, sh-format +msgid "" +"An error has occurred during the restart of the ${service_selected} service" +msgstr "" + +#: src/script/arch-update.sh:699 +#, sh-format +msgid "" +"The service(s) restart hasn't been performed\\nPlease, consider restarting " +"services that have been updated to fully apply the upgrade\\n" +msgstr "" + +#: src/script/arch-update.sh:703 +#, sh-format +msgid "No service requiring a post upgrade restart found\\n" +msgstr "" + +#: src/script/arch-update.sh:712 #, sh-format msgid "" "Reboot required:\\nThere's a pending kernel update on your system requiring " "a reboot to be applied\\n" msgstr "" -#: src/script/arch-update.sh:641 +#: src/script/arch-update.sh:713 #, sh-format msgid "Would you like to reboot now? [y/N]" msgstr "" -#: src/script/arch-update.sh:654 +#: src/script/arch-update.sh:726 #, sh-format msgid "Rebooting in ${sec}...\\r" msgstr "" -#: src/script/arch-update.sh:660 +#: src/script/arch-update.sh:732 #, sh-format msgid "" "An error has occurred during the reboot process\\nThe reboot has been " "aborted\\n" msgstr "" -#: src/script/arch-update.sh:668 +#: src/script/arch-update.sh:740 #, sh-format msgid "" "The reboot hasn't been performed\\nPlease, consider rebooting to finalize " "the pending kernel update\\n" msgstr "" -#: src/script/arch-update.sh:672 +#: src/script/arch-update.sh:744 #, sh-format msgid "No pending kernel update found\\n" msgstr "" -#: src/script/arch-update.sh:727 +#: src/script/arch-update.sh:800 #, sh-format msgid "Example configuration file not found" msgstr "" -#: src/script/arch-update.sh:732 +#: src/script/arch-update.sh:805 #, sh-format msgid "" "The '${config_file}' configuration file already exists\\nPlease, remove it " "before generating a new one" msgstr "" -#: src/script/arch-update.sh:737 +#: src/script/arch-update.sh:810 #, sh-format msgid "The '${config_file}' configuration file has been generated" msgstr "" -#: src/script/arch-update.sh:742 +#: src/script/arch-update.sh:815 #, sh-format msgid "No configuration file found" msgstr "" -#: src/script/arch-update.sh:761 +#: src/script/arch-update.sh:834 #, sh-format msgid "Arch-Update tray desktop file not found" msgstr "" -#: src/script/arch-update.sh:768 +#: src/script/arch-update.sh:841 #, sh-format msgid "The '${tray_desktop_file_autostart}' file already exists" msgstr "" -#: src/script/arch-update.sh:773 +#: src/script/arch-update.sh:846 #, sh-format msgid "" "The '${tray_desktop_file_autostart}' file has been created, the Arch-Update " @@ -509,7 +561,7 @@ msgid "" "from your app menu" msgstr "" -#: src/script/arch-update.sh:781 +#: src/script/arch-update.sh:854 #, sh-format msgid "There's already a running instance of the Arch-Update systray applet" msgstr "" diff --git a/po/fr.po b/po/fr.po index 53350a3a..1bb09c19 100644 --- a/po/fr.po +++ b/po/fr.po @@ -218,16 +218,16 @@ msgstr "Aucune mise à jour disponible\\n" msgid "Proceed with update? [Y/n]" msgstr "Procéder à la mise à jour ? [O/n]" -#: src/script/arch-update.sh:327 src/script/arch-update.sh:476 -#: src/script/arch-update.sh:509 src/script/arch-update.sh:551 -#: src/script/arch-update.sh:618 src/script/arch-update.sh:644 +#: src/script/arch-update.sh:327 src/script/arch-update.sh:480 +#: src/script/arch-update.sh:513 src/script/arch-update.sh:555 +#: src/script/arch-update.sh:622 src/script/arch-update.sh:716 #, sh-format msgid "Y" msgstr "O" -#: src/script/arch-update.sh:327 src/script/arch-update.sh:476 -#: src/script/arch-update.sh:509 src/script/arch-update.sh:551 -#: src/script/arch-update.sh:618 src/script/arch-update.sh:644 +#: src/script/arch-update.sh:327 src/script/arch-update.sh:480 +#: src/script/arch-update.sh:513 src/script/arch-update.sh:555 +#: src/script/arch-update.sh:622 src/script/arch-update.sh:716 #, sh-format msgid "y" msgstr "o" @@ -254,7 +254,7 @@ msgid "" "\"enter\" to quit:" msgstr "" "Sélectionnez les news à lire (par exemple: 1 3 5), sélectionnez 0 pour toutes les lire " -"ou appuyez sur \"entrée\" pour quitter:" +"ou appuyez sur \"entrée\" pour quitter :" #: src/script/arch-update.sh:377 #, sh-format @@ -263,7 +263,7 @@ msgid "" "\"enter\" to proceed with update:" msgstr "" "Sélectionnez les news à lire (par exemple: 1 3 5), sélectionnez 0 pour toutes les lire " -"ou appuyez sur \"entrée\" pour procéder à la mise à jour:" +"ou appuyez sur \"entrée\" pour procéder à la mise à jour :" #: src/script/arch-update.sh:399 #, sh-format @@ -290,8 +290,8 @@ msgstr "URL :" msgid "Updating Packages...\\n" msgstr "Mise à jour des paquets...\\n" -#: src/script/arch-update.sh:424 src/script/arch-update.sh:436 -#: src/script/arch-update.sh:447 +#: src/script/arch-update.sh:424 src/script/arch-update.sh:438 +#: src/script/arch-update.sh:451 #, sh-format msgid "" "An error has occurred during the update process\\nThe update has been " @@ -300,27 +300,27 @@ msgstr "" "Une erreur est survenue pendant le processus de mise à jour\\nLa mise à jour a été " "abandonnée\\n" -#: src/script/arch-update.sh:431 +#: src/script/arch-update.sh:433 #, sh-format msgid "Updating AUR Packages...\\n" msgstr "Mise à jour des paquets AUR...\\n" -#: src/script/arch-update.sh:443 +#: src/script/arch-update.sh:447 #, sh-format msgid "Updating Flatpak Packages...\\n" msgstr "Mise à jour des paquets Flatpak...\\n" -#: src/script/arch-update.sh:454 +#: src/script/arch-update.sh:458 #, sh-format msgid "The update has been applied\\n" msgstr "La mise à jour a été appliquée\\n" -#: src/script/arch-update.sh:466 +#: src/script/arch-update.sh:470 #, sh-format msgid "Orphan Packages:" msgstr "Paquets orphelins :" -#: src/script/arch-update.sh:470 +#: src/script/arch-update.sh:474 #, sh-format msgid "" "Would you like to remove this orphan package (and its potential " @@ -329,7 +329,7 @@ msgstr "" "Voulez-vous supprimer ce paquet orphelin (et ses potentielles " "dépendances) maintenant ? [o/N]" -#: src/script/arch-update.sh:472 +#: src/script/arch-update.sh:476 #, sh-format msgid "" "Would you like to remove these orphan packages (and their potential " @@ -338,14 +338,14 @@ msgstr "" "Voulez-vous supprimer ces paquets orphelins (et leurs potentielles " "dépendances) maintenant ? [o/N]" -#: src/script/arch-update.sh:478 +#: src/script/arch-update.sh:482 #, sh-format msgid "Removing Orphan Packages...\\n" msgstr "Suppression des paquets orphelins...\\n" -#: src/script/arch-update.sh:482 src/script/arch-update.sh:515 -#: src/script/arch-update.sh:558 src/script/arch-update.sh:568 -#: src/script/arch-update.sh:578 src/script/arch-update.sh:587 +#: src/script/arch-update.sh:486 src/script/arch-update.sh:519 +#: src/script/arch-update.sh:562 src/script/arch-update.sh:572 +#: src/script/arch-update.sh:582 src/script/arch-update.sh:591 #, sh-format msgid "" "An error has occurred during the removal process\\nThe removal has been " @@ -354,137 +354,196 @@ msgstr "" "Une erreur est survenue pendant le processus de suppression\\nLa suppression a été " "abandonnée\\n" -#: src/script/arch-update.sh:485 src/script/arch-update.sh:518 +#: src/script/arch-update.sh:489 src/script/arch-update.sh:522 #, sh-format msgid "The removal has been applied\\n" msgstr "La suppression a été appliquée\\n" -#: src/script/arch-update.sh:490 src/script/arch-update.sh:522 -#: src/script/arch-update.sh:595 +#: src/script/arch-update.sh:494 src/script/arch-update.sh:526 +#: src/script/arch-update.sh:599 #, sh-format msgid "The removal hasn't been applied\\n" msgstr "La suppression n'a pas été appliquée\\n" -#: src/script/arch-update.sh:494 +#: src/script/arch-update.sh:498 #, sh-format msgid "No orphan package found\\n" msgstr "Aucun paquet orphelin n'a été trouvé\\n" -#: src/script/arch-update.sh:499 +#: src/script/arch-update.sh:503 #, sh-format msgid "Flatpak Unused Packages:" msgstr "Paquets Flatpak inutilisés :" -#: src/script/arch-update.sh:503 +#: src/script/arch-update.sh:507 #, sh-format msgid "Would you like to remove this Flatpak unused package now? [y/N]" msgstr "Voulez-vous supprimer ce paquet Flatpak inutilisé maintenant ? [o/N]" -#: src/script/arch-update.sh:505 +#: src/script/arch-update.sh:509 #, sh-format msgid "Would you like to remove these Flatpak unused packages now? [y/N]" msgstr "Voulez-vous supprimer ces paquets Flatpak inutilisés maintenant ? [o/N]" -#: src/script/arch-update.sh:511 +#: src/script/arch-update.sh:515 #, sh-format msgid "Removing Flatpak Unused Packages..." msgstr "Suppression des paquets Flatpak inutilisés..." -#: src/script/arch-update.sh:526 +#: src/script/arch-update.sh:530 #, sh-format msgid "No Flatpak unused package found\\n" msgstr "Aucun paquet Flatpak inutilisé n'a été trouvé\\n" -#: src/script/arch-update.sh:543 +#: src/script/arch-update.sh:547 #, sh-format msgid "Cached Packages:\\nThere's an old or uninstalled cached package\\n" msgstr "Paquets mis en cache :\\nIl y a un paquet ancien ou désinstallé mis en cache\\n" -#: src/script/arch-update.sh:544 +#: src/script/arch-update.sh:548 #, sh-format msgid "Would you like to remove it from the cache now? [Y/n]" msgstr "Voulez-vous le supprimer du cache maintenant ? [O/n]" -#: src/script/arch-update.sh:546 +#: src/script/arch-update.sh:550 #, sh-format msgid "Cached Packages:\\nThere are old and/or uninstalled cached packages\\n" msgstr "Paquets mis en cache :\\nIl y a plusieurs paquets anciens ou désinstallés mis en cache\\n" -#: src/script/arch-update.sh:547 +#: src/script/arch-update.sh:551 #, sh-format msgid "Would you like to remove them from the cache now? [Y/n]" msgstr "Voulez-vous les supprimer du cache maintenant ? [O/n]" -#: src/script/arch-update.sh:554 src/script/arch-update.sh:574 +#: src/script/arch-update.sh:558 src/script/arch-update.sh:578 #, sh-format msgid "Removing old cached packages..." msgstr "Suppression des anciens paquets mis en cache..." -#: src/script/arch-update.sh:564 src/script/arch-update.sh:583 +#: src/script/arch-update.sh:568 src/script/arch-update.sh:587 #, sh-format msgid "Removing uninstalled cached packages..." msgstr "Suppression des paquets désinstallés mis en cache..." -#: src/script/arch-update.sh:599 +#: src/script/arch-update.sh:603 #, sh-format msgid "No old or uninstalled cached package found\\n" msgstr "Aucun paquet ancien ou désinstallé mis en cache n'a été trouvé\\n" -#: src/script/arch-update.sh:608 +#: src/script/arch-update.sh:612 #, sh-format msgid "Pacnew Files:" msgstr "Fichiers Pacnew :" -#: src/script/arch-update.sh:612 +#: src/script/arch-update.sh:616 #, sh-format msgid "Would you like to process this file now? [Y/n]" msgstr "Voulez-vous traiter ce fichier maintenant ? [O/n]" -#: src/script/arch-update.sh:614 +#: src/script/arch-update.sh:618 #, sh-format msgid "Would you like to process these files now? [Y/n]" msgstr "Voulez-vous traiter ces fichiers maintenant ? [O/n]" -#: src/script/arch-update.sh:620 +#: src/script/arch-update.sh:624 #, sh-format msgid "Processing Pacnew Files...\\n" msgstr "Traitement des fichiers pacnew...\\n" -#: src/script/arch-update.sh:624 +#: src/script/arch-update.sh:628 #, sh-format msgid "The pacnew file(s) processing has been applied\\n" msgstr "Le traitement des fichiers pacnew a été appliqué\\n" -#: src/script/arch-update.sh:627 +#: src/script/arch-update.sh:631 #, sh-format msgid "The pacnew file(s) processing hasn't been applied\\n" msgstr "Le traitement des fichiers pacnew n'a pas été appliqué\\n" -#: src/script/arch-update.sh:631 +#: src/script/arch-update.sh:635 #, sh-format msgid "No pacnew file found\\n" msgstr "Aucun fichier pacnew n'a été trouvé\\n" -#: src/script/arch-update.sh:640 +#: src/script/arch-update.sh:647 +#, sh-format +msgid "Services:\\nThe following service requires a post upgrade restart\\n" +msgstr "Services :\\nLe service suivant requiert un redémarrage suite à sa mise à jour\\n" + +#: src/script/arch-update.sh:649 +#, sh-format +msgid "Services:\\nThe following services require a post upgrade restart\\n" +msgstr "Services :\\nLes services suivants requièrent un redémarrage suite à leur mise à jour\\n" + +#: src/script/arch-update.sh:659 +#, sh-format +msgid "" +"Select the service(s) to restart (e.g. 1 3 5), select 0 to restart them all " +"or press \"enter\" to continue without restarting the service(s):" +msgstr "" +"Sélectionnez le(s) service(s) à redémarrer (par exemple: 1 3 5); sélectionnez 0 pour tous les redémarrer " +"ou appuyez sur \"entrée\" pour continuer sans redémarrer le(s) service(s) :" + +#: src/script/arch-update.sh:665 src/script/arch-update.sh:692 +#, sh-format +msgid "Service(s) restarted successfully\\n" +msgstr "Service(s) redémarré(s) avec succès\\n" + +#: src/script/arch-update.sh:668 src/script/arch-update.sh:695 +#, sh-format +msgid "" +"An error has occurred during the service(s) restart\\nPlease, verify the " +"above service(s) status\\n" +msgstr "" +"Une erreur est survenue pendant le redémarrage du/des service(s)\\n Veuillez vérifier " +"le statut des services ci-dessus\\n" + +#: src/script/arch-update.sh:681 +#, sh-format +msgid "The ${service_selected} service has been successfully restarted" +msgstr "Le service ${service_selected} a été redémarré avec succès" + +#: src/script/arch-update.sh:683 +#, sh-format +msgid "" +"An error has occurred during the restart of the ${service_selected} service" +msgstr "" +"Une erreur est survenue pendant le redémarrage du service ${service_selected}" + +#: src/script/arch-update.sh:699 +#, sh-format +msgid "" +"The service(s) restart hasn't been performed\\nPlease, consider restarting " +"services that have been updated to fully apply the upgrade\\n" +msgstr "" +"Le redémarrage du/des service(s) n'a pas été appliqué\\nVeuillez considérer redémarrer " +"les services qui ont été mis à jour pour appliquer complètement la mise à niveau\\n" + +#: src/script/arch-update.sh:703 +#, sh-format +msgid "No service requiring a post upgrade restart found\\n" +msgstr "Aucun service nécessitant un redémarrage suite à la mise à jour n'a été trouvé\\n" + +#: src/script/arch-update.sh:712 #, sh-format msgid "" "Reboot required:\\nThere's a pending kernel update on your system requiring " "a reboot to be applied\\n" msgstr "" -"Redémarrage nécessaire :\\nIl y a une mise à jour du noyau en attente sur votre système qui nécessite " +"Redémarrage nécessaire :\\nIl y a une mise à jour du noyau en attente sur votre système qui nécessite " "un redémarrage pour être appliquée\\n" -#: src/script/arch-update.sh:641 +#: src/script/arch-update.sh:713 #, sh-format msgid "Would you like to reboot now? [y/N]" msgstr "Voulez-vous redémarrer votre système maintenant ? [o/N]" -#: src/script/arch-update.sh:654 +#: src/script/arch-update.sh:726 #, sh-format msgid "Rebooting in ${sec}...\\r" msgstr "Redémarrage dans ${sec}...\\r" -#: src/script/arch-update.sh:660 +#: src/script/arch-update.sh:732 #, sh-format msgid "" "An error has occurred during the reboot process\\nThe reboot has been " @@ -493,7 +552,7 @@ msgstr "" "Une erreur est survenue pendant le processus de redémarrage\\nLe redémarrage a été " "abandonné\\n" -#: src/script/arch-update.sh:668 +#: src/script/arch-update.sh:740 #, sh-format msgid "" "The reboot hasn't been performed\\nPlease, consider rebooting to finalize " @@ -502,17 +561,17 @@ msgstr "" "Le redémarrage n'a pas été effectué\\nVeuillez considérer redémarrer votre système pour finaliser " "la mise à jour du noyau en attente\\n" -#: src/script/arch-update.sh:672 +#: src/script/arch-update.sh:744 #, sh-format msgid "No pending kernel update found\\n" msgstr "Aucune mise à jour du noyau en attente n'a été trouvée\\n" -#: src/script/arch-update.sh:727 +#: src/script/arch-update.sh:800 #, sh-format msgid "Example configuration file not found" msgstr "Fichier de configuration exemple non trouvé" -#: src/script/arch-update.sh:732 +#: src/script/arch-update.sh:805 #, sh-format msgid "" "The '${config_file}' configuration file already exists\\nPlease, remove it " @@ -521,27 +580,27 @@ msgstr "" "Le fichier de configuration '${config_file}' existe déjà.\\nVeuillez le supprimer " "avant d'en générer un nouveau" -#: src/script/arch-update.sh:737 +#: src/script/arch-update.sh:810 #, sh-format msgid "The '${config_file}' configuration file has been generated" msgstr "Le fichier de configuration '${config_file}' a été généré" -#: src/script/arch-update.sh:742 +#: src/script/arch-update.sh:815 #, sh-format msgid "No configuration file found" msgstr "Aucun fichier de configuration n'a été trouvé" -#: src/script/arch-update.sh:761 +#: src/script/arch-update.sh:834 #, sh-format msgid "Arch-Update tray desktop file not found" msgstr "Le fichier Arch-Update tray desktop n'a pas été trouvé" -#: src/script/arch-update.sh:768 +#: src/script/arch-update.sh:841 #, sh-format msgid "The '${tray_desktop_file_autostart}' file already exists" msgstr "Le fichier '${tray_desktop_file_autostart}' existe déjà" -#: src/script/arch-update.sh:773 +#: src/script/arch-update.sh:846 #, sh-format msgid "" "The '${tray_desktop_file_autostart}' file has been created, the Arch-Update " @@ -554,7 +613,7 @@ msgstr "" "immédiatement, vous pouvez lancer l'application \"Arch-Update Systray Applet\" " "depuis votre menu d'application" -#: src/script/arch-update.sh:781 +#: src/script/arch-update.sh:854 #, sh-format msgid "There's already a running instance of the Arch-Update systray applet" msgstr "Il y a déjà une instance de l'applet systray d'Arch-Update en cours d'exécution" diff --git a/src/script/arch-update.sh b/src/script/arch-update.sh index b8446aa8..5ea4fd0b 100755 --- a/src/script/arch-update.sh +++ b/src/script/arch-update.sh @@ -665,7 +665,7 @@ restart_services() { info_msg "$(eval_gettext "Service(s) restarted successfully\n")" else - error_msg "$(eval_gettext "An error has occurred during service(s) restart\nPlease, verify the above service(s) status\n")" && quit_msg + error_msg "$(eval_gettext "An error has occurred during the service(s) restart\nPlease, verify the above service(s) status\n")" && quit_msg exit 11 fi else @@ -680,7 +680,7 @@ restart_services() { if "${su_cmd}" systemctl restart "${service_selected}"; then info_msg "$(eval_gettext "The \${service_selected} service has been successfully restarted")" else - error_msg "$(eval_gettext "An error occurred during the restart of the \${service_selected} service")" + error_msg "$(eval_gettext "An error has occurred during the restart of the \${service_selected} service")" service_fail="y" fi fi @@ -692,7 +692,7 @@ restart_services() { info_msg "$(eval_gettext "Service(s) restarted successfully\n")" else echo - error_msg "$(eval_gettext "An error occurred during the service(s) restart\nPlease, verify the status of the above service(s)\n")" && quit_msg + error_msg "$(eval_gettext "An error has occurred during the service(s) restart\nPlease, verify the above service(s) status\n")" && quit_msg exit 11 fi else