both code try to fix the same problem
# To do: exclude Centos 6 postgres packages
bash 'Add postgres package repositories' do
user 'root'
cwd '/tmp'
code <<-EOH
<<<<<<< HEAD
CHECK_RPM=$(rpm -qa | grep pgdg-centos91)
if [ "$CHECK_RPM" != "" ]
then
echo "pgdg-centos91*.rpm is installed!"
else
curl -O https://download.postgresql.org/pub/repos/yum/9.1/redhat/rhel-6-x86_64/pgdg-centos91-9.1-6.noarch.rpm
rpm -ivh pgdg*
fi
=======
curl -O https://download.postgresql.org/pub/repos/yum/9.1/redhat/rhel-6-x86_64/pgdg-centos91-9.1-6.noarch.rpm
rpm -q pgdg-centos91-9.1-6.noarch || rpm -ivh pgdg*
>>>>>>> Affiliate Login (#64): problem with vagrant provisioning of gigadb-website
EOH
end
the advantage of the HEAD code is that it doesn't even download the rpm if it is already installed.
Which made me think of a way to improve the feature branch code into:
rpm -q pgdg-centos91-9.1-6.noarch \
|| curl -O https://download.postgresql.org/pub/repos/yum/9.1/redhat/rhel-6-x86_64/pgdg-centos91-9.1-6.noarch.rpm \
&& rpm -ivh pgdg*
but the HEAD code is still better as it is not querying a specific dot dot version of the rpm so it's more flexible.