From f9db2dbd16dd51268d31bf3771e467d1da2adfbd Mon Sep 17 00:00:00 2001 From: Stephen Smoogen Date: Sat, 1 Jun 2019 22:16:10 +0000 Subject: [PATCH] [grobi] add in final logic for link setup --- roles/grobisplitter/files/rhel8-split.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/roles/grobisplitter/files/rhel8-split.sh b/roles/grobisplitter/files/rhel8-split.sh index 3366ed0490..c441ef3781 100755 --- a/roles/grobisplitter/files/rhel8-split.sh +++ b/roles/grobisplitter/files/rhel8-split.sh @@ -80,5 +80,17 @@ for ARCH in ${ARCHES}; do done ## Set up the builds so they are pointing to the last working version -rm -f ${HOMEDIR}/koji/latest -ln -s ${DATEDIR} ${HOMEDIR}/koji/latest +cd ${HOMEDIR}/koji/ +if [[ -e latest ]]; then + if [[ -h latest ]]; then + rm -f latest + else + echo "Unable to remove latest. it is not a symbolic link" + exit + fi +else + echo "No latest link found" +fi + +echo "Linking ${DATE} to latest" +ln -s ${DATE} ${HOMEDIR}/koji/latest