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

Merge branch '6661-yum-check-update-on-alma' into 'master'

almalinux9: fix package lists

See merge request !173
parents bdf57427 96cf9850
No related branches found
No related tags found
1 merge request!173almalinux9: fix package lists
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
# 2023-07-17 v1.3 ah fix hiding obsolete packages # 2023-07-17 v1.3 ah fix hiding obsolete packages
# 2023-08-24 v1.4 ah centos9: update getStatusLine() + getSecurityCount # 2023-08-24 v1.4 ah centos9: update getStatusLine() + getSecurityCount
# 2023-08-25 v1.5 ah centos9: fix package lists # 2023-08-25 v1.5 ah centos9: fix package lists
# 2023-09-12 v1.6 ah almalinux9: fix package lists
# =============================================================== # ===============================================================
...@@ -28,22 +29,15 @@ function yum.getUpdates(){ ...@@ -28,22 +29,15 @@ function yum.getUpdates(){
# extract list of packages 2 install # extract list of packages 2 install
# global string packagemanOut output of update lister command # global string packagemanOut output of update lister command
function yum.getPackageList(){ function yum.getPackageList(){
local iStart=3
# detect number of line containing "Obsoleting Packages" # detect number of line containing "Obsoleting Packages"
local iEnd (if grep '^Obsoleting Packages' <<< "$packagemanOut" >/dev/null ; then
typeset -i iEnd local iStart=1
iEnd=$( echo "$packagemanOut" | grep -n '^Obsoleting Packages' | cut -f 1 -d ':' )-1 local iEnd; typeset -i iEnd
iEnd=$( echo "$packagemanOut" | grep -n '^Obsoleting Packages' | cut -f 1 -d ':' )-1
local sEnd=$iEnd echo "$packagemanOut" | sed -n ${iStart},${iEnd}p
test "$iEnd" = "-1" && sEnd='$'
# test $iEnd -gt $iStart && echo "$packagemanOut" | sed -n ${iStart},${sEnd}p
if [ $iEnd -gt $iStart ]; then
echo "$packagemanOut" | sed -n ${iStart},${sEnd}p
else else
echo "$packagemanOut" | grep -v "^Last" | grep "[a-z]" echo "$packagemanOut"
fi fi) | grep -v "^Last metadata" | grep -i "[a-z]"
} }
# --------------------------------------------------------------- # ---------------------------------------------------------------
...@@ -66,7 +60,7 @@ function yum.getStatusLine(){ ...@@ -66,7 +60,7 @@ function yum.getStatusLine(){
fi fi
;; ;;
9) 9)
local _total; _total=$( echo "${packages2install}" | wc -l ) local _total; _total=$( echo -n "${packages2install}" | wc -l )
local _sec; _sec=$( sudo /usr/bin/yum -y --security check-update \ local _sec; _sec=$( sudo /usr/bin/yum -y --security check-update \
| grep -v "^Last" \ | grep -v "^Last" \
| grep -v "^No security updates needed" \ | grep -v "^No security updates needed" \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment