Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
icinga-checks
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IML Open Source
icinga-checks
Merge requests
!245
again: fix total count of packages to install :-/
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
again: fix total count of packages to install :-/
7043-fix-yum-again
into
master
Overview
0
Commits
1
Pipelines
0
Changes
1
Merged
Hahn Axel (hahn)
requested to merge
7043-fix-yum-again
into
master
1 year ago
Overview
0
Commits
1
Pipelines
0
Changes
1
Expand
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
7d1b7267
1 commit,
1 year ago
1 file
+
20
−
18
Side-by-side
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
check_packages2install-pkgmanager/yum.sh
+
20
−
18
Options
@@ -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..."
Loading