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

Yum: fix for #6610

parent 179a3704
No related branches found
No related tags found
1 merge request!144Yum: fix for #6610
...@@ -7,13 +7,14 @@ ...@@ -7,13 +7,14 @@
# included by ../check_packages2install # included by ../check_packages2install
# #
# --------------------------------------------------------------- # ---------------------------------------------------------------
# ah <axel.hahn@iml.unibe.ch> # ah <axel.hahn@unibe.ch>
# 2022-06-03 v1.0 ah first version # 2022-06-03 v1.0 ah first version
# 2022-06-07 v1.1 ah add sudo for yum --bugfix check-update # 2022-06-07 v1.1 ah add sudo for yum --bugfix check-update
# rename functions # rename functions
# 2022-08-31 v1.2 ah status line depends on os major version # 2022-08-31 v1.2 ah status line depends on os major version
# 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() + # 2023-08-24 v1.4 ah centos9: update getStatusLine() + getSecurityCount
# 2023-08-25 v1.5 ah centos9: fix package lists
# =============================================================== # ===============================================================
...@@ -37,6 +38,12 @@ function yum.getPackageList(){ ...@@ -37,6 +38,12 @@ function yum.getPackageList(){
test "$iEnd" = "-1" && sEnd='$' test "$iEnd" = "-1" && sEnd='$'
test $iEnd -gt $iStart && echo "$packagemanOut" | sed -n ${iStart},${sEnd}p test $iEnd -gt $iStart && echo "$packagemanOut" | sed -n ${iStart},${sEnd}p
if [ $iEnd -gt $iStart ]; then
echo "$packagemanOut" | sed -n ${iStart},${sEnd}p
else
echo "$packagemanOut" | grep -v "^Last" | grep "[a-z]"
fi
} }
# --------------------------------------------------------------- # ---------------------------------------------------------------
...@@ -60,7 +67,11 @@ function yum.getStatusLine(){ ...@@ -60,7 +67,11 @@ function yum.getStatusLine(){
;; ;;
9) 9)
local _total; _total=$( echo "${packages2install}" | wc -l ) local _total; _total=$( echo "${packages2install}" | wc -l )
local _sec; _sec=$( sudo /usr/bin/yum -y --security check-update | grep -v "^Last" | grep -c "." ) local _sec; _sec=$( sudo /usr/bin/yum -y --security check-update \
| grep -v "^Last" \
| 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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment