[eos-manual-intervention] added option --ask-ignorepkg

This commit is contained in:
manuel
2025-12-11 16:34:55 +02:00
parent 1c1d8e806f
commit 1e9140272c
2 changed files with 21 additions and 16 deletions
+2 -2
View File
@@ -4,7 +4,7 @@
pkgname=eos-manual-intervention
pkgdesc="Manual interventions manager."
url="https://github.com/endeavouros-team/PKGBUILDS/raw/master/$pkgname"
pkgver=0.25.12.1
pkgver=0.25.12.2
pkgrel=1
arch=('any')
license=('GPL')
@@ -14,7 +14,7 @@ source=(
$url/$pkgname
$url/$pkgname.interventions
)
sha512sums=('5d8b8d48b1545e98525815b2c8d1c02625c515caf239ccdc603d0354f22ae6ee91c02dd3c56153b46c7eb564270c247b205785a50762dd064c9afc6a3abccfcc'
sha512sums=('ac894b48f641c36ebb70d787e881f3062981e775e05ce1a1d144100127f53c7c0a9c99f464d4bf34e11d8123e5e1748c06c501470b844f6e796da853602732dc'
'e78a5f4f684c6eccb3c6e311991949429ac51d79f0979b2b84e4ee46ca8f2d3a7311991e69eb44503fbe3b48c2c895e3f6d7a3805f8e099ce34be40070c4ed67')
package() {
+19 -14
View File
@@ -110,25 +110,25 @@ NewsPage() {
}
CheckPacmanConf() {
local -r conf=/etc/pacman.conf
local lines="$(grep -n "^[ \t]*IgnorePkg[ \t]*=[ \t]*[a-zA-Z0-9]" $conf)"
local lines="$(grep -n "^[ \t]*IgnorePkg[ \t]*=[ \t]*[a-zA-Z0-9]" $pacmanconf)"
if [ "$lines" ] ; then
cat <<EOF >&2
==> $progname: warning:
==> File $conf contains IgnorePkg line(s).
This *may* affect manual interventions because partial upgrades are not supported.
File $pacmanconf contains IgnorePkg line(s).
This *may* affect manual interventions because partial upgrades are not supported.
EOF
readarray -t lines < <(echo "$lines")
printf " %s\n" "${lines[@]}" >&2
echo2 ""
local reply=""
read -p "==> Do you want to continue [yes/NO]? " reply >&2
case "$reply" in
[yY]*) ;;
*) exit 0 ;;
esac
if [ $ask_ignorepkg = yes ] ; then
readarray -t lines < <(echo "$lines")
printf " %s\n" "${lines[@]}" >&2
echo2 ""
local reply=""
read -p "==> Do you want to continue [yes/NO]? " reply >&2
case "$reply" in
[yY]*) ;;
*) exit 0 ;;
esac
fi
fi
}
@@ -141,6 +141,7 @@ Help() {
Purpose: Execute and manage essential manual interventions.
Usage: $progname [options]
Options: -h, --help This help.
--ask-ignorepkg If 'IgnorePkg' is used in $pacmanconf, ask user whether to proceed.
-n, --show-arch-news Show the Arch news page in a browser.
--count Only show the number of available interventions, don't run them.
EOF
@@ -152,6 +153,7 @@ Options() {
case "$arg" in
-h | --help) Help; exit 0 ;;
-n | --show-arch-news) NewsPage; exit 0 ;;
--ask-ignorepkg) ask_ignorepkg=yes ;;
--count) only_show_count=yes ;;
-t | --test) use_local_ifile=yes ;; # for internal testing
-*) WARN "unsupported option $arg, see $progname --help" ;;
@@ -165,6 +167,8 @@ Main() {
local -r interventions_dir="$HOME/.cache/$progname"
local -r interventions_file="$interventions_dir/$progname.interventions"
local -r handled_fixes="$interventions_dir/$progname.handled"
local -r pacmanconf=/etc/pacman.conf
local ask_ignorepkg=no
local MI_func_names=()
local only_show_count=no
local use_local_ifile=no
@@ -173,6 +177,7 @@ Main() {
CheckPacmanConf
FetchInterventionsFile
RunInterventionsIfNeeded
echo "" >&2
return 0
}