Merge "Remove old versions of grub2 from the yum cache"

This commit is contained in:
Jenkins 2014-01-13 13:06:33 +00:00 committed by Gerrit Code Review
commit 77370c6740

View File

@ -6,12 +6,14 @@ yum remove -y grub2
# Install grub2 dependencies to minimise packages installed during finalise.
install-packages grub2-tools gettext os-prober system-logos
# Ensure grub2 rpm is in the yum cache
# Remove all old versions of grub2 from the yum cache and then ensure the
# latest version is in the cache.
basearch=$(cat /etc/yum/vars/basearch)
find /tmp/yum/$basearch -regex ".*/grub2-[0-9].*\.rpm" -exec rm -f {} \;
install-packages -d grub2
# Copy grub2 rpm out of mounted yum cache for install during finalise
mkdir /tmp/grub
basearch=$(cat /etc/yum/vars/basearch)
cp $(find /tmp/yum/$basearch -regex ".*/grub2-[0-9].*\.rpm") /tmp/grub
echo "rpm -i /tmp/grub/*.rpm" > /tmp/grub/install