Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add the NoAUR option to arch-update.conf #309

Merged
merged 1 commit into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions doc/man/arch-update.conf.5.scd
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ Options are case sensitive, so capital letters have to be respected.
*NoVersion*
Do not show versions changes for packages when listing pending updates (including when using the `-l / --list` option, see the *arch-update*(1) man page for more details).

*NoAUR*
Ignore AUR packages support.

*NoFlatpak*
Ignore Flatpak packages support.

Expand Down
3 changes: 3 additions & 0 deletions doc/man/fr/arch-update.conf.5.scd
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ Les options sont sensibles à la casse, les majuscules doivent donc être respec
*NoVersion*
Ne pas afficher les modifications de versions des paquets lors du listing des mises à jour en attente (y compris lors de l'utilisation de l'option `-l / --list`, voir la page de manuel *arch-update*(1) pour plus de détails).

*NoAUR*
Ignorer la prise en charge des paquets AUR.

*NoFlatpak*
Ignorer la prise en charge des paquets Flatpak.

Expand Down
1 change: 1 addition & 0 deletions res/config/arch-update.conf.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#NoColor
#NoVersion
#NoAUR
#NoFlatpak
#NoNotification
#NewsNum=5
Expand Down
34 changes: 18 additions & 16 deletions src/lib/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,22 +109,24 @@ quit_msg() {
}

# Definition of the AUR helper to use (depending on if / which one is installed on the system and if it's not already defined in arch-update.conf) for the optional AUR packages support
# shellcheck disable=SC2034
if [ -z "${aur_helper}" ]; then
if command -v paru > /dev/null; then
# shellcheck disable=SC2034
aur_helper="paru"
elif command -v yay > /dev/null; then
# shellcheck disable=SC2034
aur_helper="yay"
elif command -v pikaur > /dev/null; then
# shellcheck disable=SC2034
aur_helper="pikaur"
fi
else
if ! command -v "${aur_helper}" > /dev/null; then
warning_msg "$(eval_gettext "The \${aur_helper} AUR helper set for AUR packages support in the arch-update.conf configuration file is not found\n")"
unset aur_helper
if [ -z "${no_aur}" ]; then
# shellcheck disable=SC2034
if [ -z "${aur_helper}" ]; then
if command -v paru > /dev/null; then
# shellcheck disable=SC2034
aur_helper="paru"
elif command -v yay > /dev/null; then
# shellcheck disable=SC2034
aur_helper="yay"
elif command -v pikaur > /dev/null; then
# shellcheck disable=SC2034
aur_helper="pikaur"
fi
else
if ! command -v "${aur_helper}" > /dev/null; then
warning_msg "$(eval_gettext "The \${aur_helper} AUR helper set for AUR packages support in the arch-update.conf configuration file is not found\n")"
unset aur_helper
fi
fi
fi

Expand Down
4 changes: 4 additions & 0 deletions src/lib/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ if [ -f "${config_file}" ]; then
# shellcheck disable=SC2034
no_version=$(grep -Eq '^[[:space:]]*NoVersion[[:space:]]*$' "${config_file}" 2> /dev/null && echo "true")

# Check the "NoAUR" option in arch-update.conf
# shellcheck disable=SC2034
no_aur=$(grep -Eq '^[[:space:]]*NoAUR[[:space:]]*$' "${config_file}" 2> /dev/null && echo "true")

# Check the "NoFlatpak" option in arch-update.conf
# shellcheck disable=SC2034
no_flatpak=$(grep -Eq '^[[:space:]]*NoFlatpak[[:space:]]*$' "${config_file}" 2> /dev/null && echo "true")
Expand Down