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
Commits
96cf9850
Commit
96cf9850
authored
1 year ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
almalinux9: fix package lists
parent
bdf57427
Branches
Branches containing commit
No related tags found
1 merge request
!173
almalinux9: fix package lists
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
check_packages2install-pkgmanager/yum.sh
+9
-15
9 additions, 15 deletions
check_packages2install-pkgmanager/yum.sh
with
9 additions
and
15 deletions
check_packages2install-pkgmanager/yum.sh
+
9
−
15
View file @
96cf9850
...
...
@@ -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"
\
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment