Steve Baker 262e5497e0 update_repo to limit to packages in repo
Rather than updating every package, allow to limit to a single repo
2018-05-14 10:43:34 +12:00

19 lines
410 B
Bash
Executable File

#!/bin/sh
set -ex
if [ -f /tmp/host_packages.json ]; then
if /tmp/compare-package-json.py < /tmp/host_packages.json ; then
echo "Host package versions match, no update required"
exit
fi
fi
packages_for_update=
if [ -n "$1" ]; then
packages_for_update=("$(repoquery --disablerepo='*' --enablerepo=$1 --qf %{NAME} -a)")
fi
yum -y update $packages_for_update
rm -rf /var/cache/yum