From 4143cd69b5da06df39a0b5f318898569291c4deb Mon Sep 17 00:00:00 2001 From: beelsr <beels@technologist.com> Date: Sat, 30 Jul 2016 11:14:51 -0400 Subject: [PATCH] fix yum gpgenabled check to allow spaces around = (#247) Issue 245 yum.conf allows an arbitrary number of spaces to surround the equals assignment. --- include/tests_ports_packages | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/tests_ports_packages b/include/tests_ports_packages index 5902c544..e23f6fe0 100644 --- a/include/tests_ports_packages +++ b/include/tests_ports_packages @@ -823,8 +823,8 @@ FOUND=0 FileExists /etc/yum.conf if [ ${FILE_FOUND} -eq 1 ]; then - SearchItem "^gpgenabled=1$" "/etc/yum.conf"; if [ ${ITEM_FOUND} -eq 1 ]; then FOUND=1; fi - SearchItem "^gpgcheck=1$" "/etc/yum.conf"; if [ ${ITEM_FOUND} -eq 1 ]; then FOUND=1; fi + SearchItem "^gpgenabled\s*=\s*1$" "/etc/yum.conf"; if [ ${ITEM_FOUND} -eq 1 ]; then FOUND=1; fi + SearchItem "^gpgcheck\s*=\s*1$" "/etc/yum.conf"; if [ ${ITEM_FOUND} -eq 1 ]; then FOUND=1; fi if [ ${FOUND} -eq 1 ]; then LogText "Result: GPG check is enabled" Display --indent 2 --text "- Checking GPG checks (yum.conf)" --result "${STATUS_OK}" --color GREEN