From 2bc3c5f031008a33ba0050a41b70f29715db2b96 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Fri, 6 Feb 2015 10:55:14 -0500 Subject: [PATCH] Seems like mklocalrepo never worked for Zypper because the /etc/yum.repos.d was hard coded. Enhanced to work with SLES distributions --- buildcore.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/buildcore.sh b/buildcore.sh index 20d342803..2c84f8b55 100755 --- a/buildcore.sh +++ b/buildcore.sh @@ -428,7 +428,14 @@ if [[ $REPOFILE == "xCAT-*.repo" ]]; then echo "ERROR: For xcat-dep, please execute $0 in the correct / subdirectory" exit 1 fi -sed -e 's|baseurl=.*|baseurl=file://'"`pwd`"'|' $REPOFILE | sed -e 's|gpgkey=.*|gpgkey=file://'"`pwd`"'/repodata/repomd.xml.key|' > /etc/yum.repos.d/$REPOFILE +# +# default to RHEL yum, if doesn't exist try Zypper +# +DIRECTORY="/etc/yum.repos.d" +if [[ ! -d ${DIRECTORY} ]]; then + DIRECTORY="/etc/zypp/repos.d" +fi +sed -e 's|baseurl=.*|baseurl=file://'"`pwd`"'|' $REPOFILE | sed -e 's|gpgkey=.*|gpgkey=file://'"`pwd`"'/repodata/repomd.xml.key|' > ${DIRECTORY}/$REPOFILE cd - EOF2 chmod 775 mklocalrepo.sh