Only do yum update when needed
Currently the logic for this results in a full yum update when no package updates are found in the provided repository. This can lead to job timeouts when nothing was built in CI because it effectively does a yum update on every container and applies other system packages rather than ones that actually changed. There is a larger issue in that we can still get out of sync with the host OS. Change-Id: Iaf41691ea3cb6e78186741ac5e15614fb73f89ff Related-Bug: #1786764
This commit is contained in:
parent
a2229e738a
commit
7b587fe0f5
@ -14,5 +14,10 @@ if [ -n "$1" ] && command -v repoquery >/dev/null 2>&1; then
|
||||
packages_for_update=("$(repoquery --disablerepo='*' --enablerepo=$1 --qf %{NAME} -a)")
|
||||
fi
|
||||
|
||||
if [ -z $package_for_update ]; then
|
||||
echo "No packages were found for update..."
|
||||
exit
|
||||
fi
|
||||
|
||||
yum -y update $packages_for_update
|
||||
rm -rf /var/cache/yum
|
||||
|
Loading…
x
Reference in New Issue
Block a user