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

almalinux9: fix package lists

parent bdf57427
Branches
No related tags found
1 merge request!173almalinux9: fix package lists
......@@ -15,6 +15,7 @@
# 2023-07-17 v1.3 ah fix hiding obsolete packages
# 2023-08-24 v1.4 ah centos9: update getStatusLine() + getSecurityCount
# 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(){
# extract list of packages 2 install
# global string packagemanOut output of update lister command
function yum.getPackageList(){
local iStart=3
# detect number of line containing "Obsoleting Packages"
local iEnd
typeset -i iEnd
iEnd=$( echo "$packagemanOut" | grep -n '^Obsoleting Packages' | cut -f 1 -d ':' )-1
local sEnd=$iEnd
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
(if grep '^Obsoleting Packages' <<< "$packagemanOut" >/dev/null ; then
local iStart=1
local iEnd; typeset -i iEnd
iEnd=$( echo "$packagemanOut" | grep -n '^Obsoleting Packages' | cut -f 1 -d ':' )-1
echo "$packagemanOut" | sed -n ${iStart},${iEnd}p
else
echo "$packagemanOut" | grep -v "^Last" | grep "[a-z]"
fi
echo "$packagemanOut"
fi) | grep -v "^Last metadata" | grep -i "[a-z]"
}
# ---------------------------------------------------------------
......@@ -66,7 +60,7 @@ function yum.getStatusLine(){
fi
;;
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 \
| grep -v "^Last" \
| 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