From ffa2ced11660e3298e97dc3333af053c1dce1036 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Thu, 6 Jun 2019 10:23:28 -0400 Subject: [PATCH] Hard stop if the keys are already there so caller needs to decide to remove it or not --- builddep.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/builddep.sh b/builddep.sh index c6040b15e..875fb1002 100755 --- a/builddep.sh +++ b/builddep.sh @@ -47,7 +47,6 @@ if [ "$OSNAME" == "AIX" ]; then else DFNAME=xcat-dep-`date +%Y%m%d%H%M`.tar.bz2 GSA=/gsa/pokgsa/projects/x/xcat/build/linux/xcat-dep - export HOME=/root # This is so rpm and gpg will know home, even in sudo fi if [ ! -d $GSA ]; then @@ -90,11 +89,11 @@ if [ -z "$DESTDIR" ]; then if [[ $XCATCOREDIR == *"xcat2_autobuild_daily_builds"* ]]; then # This shows we are in the daily build environment path, create the # deps package at the top level of the build directory - DESTDIR=../../xcat-dep + DESTDIR=../../xcat-dep-build else # This means we are building in some other clone of xcat-core, # so just place the destination one level up. - DESTDIR=../xcat-dep + DESTDIR=../xcat-dep-build fi fi @@ -128,8 +127,13 @@ GNU_KEYDIR="$HOME/.gnupg" MACROS=$HOME/.rpmmacros if [ "$OSNAME" != "AIX" ]; then # Get gpg keys in place + if [[ -d ${GNU_KEYDIR} ]]; then + echo "WARNING: The gnupg key dir: $GNU_KEYDIR exists, it will be overwitten. Stop." + echo "WARNING: To continue, remove it and rerun the script." + exit 1 + fi mkdir -p ${GNU_KEYDIR} - checkrc + checkrc for i in pubring.gpg secring.gpg trustdb.gpg; do if [ ! -f ${GNU_KEYDIR}/$i ] || [ `wc -c ${GNU_KEYDIR}/$i|cut -f 1 -d' '` == 0 ]; then rm -f ${GNU_KEYDIR}/$i