Skip to content
Snippets Groups Projects
Commit fcef6312 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

Merge branch '7043-fix-yum-again' into 'master'

again: fix total count of packages to install :-/

See merge request !245
parents 281bb4dc 7d1b7267
Branches
No related tags found
1 merge request!245again: fix total count of packages to install :-/
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
# 2023-09-12 v1.6 ah almalinux9: fix package lists # 2023-09-12 v1.6 ah almalinux9: fix package lists
# 2023-10-20 v1.7 ah harden sudo command execution # 2023-10-20 v1.7 ah harden sudo command execution
# 2023-12-13 v1.8 ah fix total count of packages to install # 2023-12-13 v1.8 ah fix total count of packages to install
# 2024-02-29 v1.9 ah again: fix total count of packages to install :-/
# =============================================================== # ===============================================================
...@@ -56,25 +57,26 @@ function yum.getStatusLine(){ ...@@ -56,25 +57,26 @@ function yum.getStatusLine(){
echo "No update available (older version v$_osversion). rc = $?" echo "No update available (older version v$_osversion). rc = $?"
fi fi
;; ;;
8) 8|9)
if ! sudo /usr/bin/yum --security check-update 2>&1 | grep "available" ; then sudo /usr/bin/yum --bugfix check-update 2>&1 | tail -1
echo "No update available. rc = $?" # if ! sudo /usr/bin/yum --security check-update 2>&1 | grep "available" ; then
fi # echo "No update available. rc = $?"
;; # fi
9) # ;;
local _total; _total=$( grep -c . <<< "${packages2install}" ) # 9)
local _sec; _sec=$( sudo /usr/bin/yum -y --security check-update \ # local _total; _total=$( grep -c . <<< "${packages2install}" )
| grep -v "^Last" \ # local _sec; _sec=$( sudo /usr/bin/yum -y --security check-update \
| grep -v "^No security updates needed" \ # | grep -v "^Last" \
| grep -c "[a-z]" # | grep -v "^No security updates needed" \
) # | grep -c "[a-z]"
# )
# create a status line like in former yum versions # # create a status line like in former yum versions
if [ -z "$_sec" ]; then # if [ -z "$_sec" ]; then
echo "No packages needed for security; ${_total} packages available" # echo "No packages needed for security; ${_total} packages available"
else # else
echo "$_sec package(s) needed for security, out of $_total available" # echo "$_sec package(s) needed for security, out of $_total available"
fi # fi
;; ;;
*) *)
echo "see below ... version ${_osversion} not implemented yet..." echo "see below ... version ${_osversion} not implemented yet..."
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment