From b3490bf8a4bc6677a42738279c7ffbc8b13c84c9 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Thu, 15 Nov 2018 10:02:58 -0500 Subject: [PATCH 1/4] Add a test for rpm-sign, which is required to successfullly build the deps package --- builddep.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/builddep.sh b/builddep.sh index 2d7b221c1..4a3212917 100755 --- a/builddep.sh +++ b/builddep.sh @@ -49,6 +49,12 @@ if [ ! -d $GSA ]; then exit 1 fi +REQPKG="rpm-sign" +if [ `rpm -q $REQPKG >> /dev/null; echo $?` != 0 ]; then + echo "ERROR: $REQPKG is required to successfully create the xcat-deps package. Install and rerun." + exit 1 +fi + # set grep to quiet by default GREP="grep -q" if [ "$VERBOSE" = "1" -o "$VERBOSE" = "yes" ]; then From 59fd3da57339e16d319130ff697a1b78fdb80244 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Thu, 15 Nov 2018 10:04:25 -0500 Subject: [PATCH 2/4] Clean up code that was commented out 3 years back --- builddep.sh | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/builddep.sh b/builddep.sh index 4a3212917..08036c887 100755 --- a/builddep.sh +++ b/builddep.sh @@ -64,14 +64,10 @@ if [ "$VERBOSE" = "1" -o "$VERBOSE" = "yes" ]; then fi # this is needed only when we are transitioning the yum over to frs -# YUMREPOURL1="http://xcat.org/yum" -# YUMREPOURL2="http://xcat.org/files/yum" if [ "$FRSYUM" != 0 ]; then YUMDIR="$FRS/repos" - # YUMREPOURL="$YUMREPOURL2" else YUMDIR=htdocs - # YUMREPOURL="$YUMREPOURL1" fi cd `dirname $0` @@ -133,18 +129,6 @@ if [ "$OSNAME" != "AIX" ]; then # Modify xcat-dep.repo files to point to the correct place echo "===> Modifying the xcat-dep.repo files to point to the correct location..." - # 10/01/2015 - vkhu - # The URLs have been updated in GSA, this section is not needed at the moment - # - #if [ "$FRSYUM" != 0 ]; then - # newurl="$YUMREPOURL2" - # oldurl="$YUMREPOURL1" - #else - # newurl="$YUMREPOURL1" - # oldurl="$YUMREPOURL2" - #fi - # - #sed -i -e "s|=$oldurl|=$newurl|g" `find . -name "xcat-dep.repo" ` fi if [ "$OSNAME" == "AIX" ]; then From fc01224da04e169844b12dcc2aeebe63f86241bc Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Fri, 16 Nov 2018 11:31:54 -0500 Subject: [PATCH 3/4] Add a test to make sure we are not running this on debian based operating systems --- builddep.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/builddep.sh b/builddep.sh index 08036c887..ca4206c42 100755 --- a/builddep.sh +++ b/builddep.sh @@ -19,6 +19,14 @@ # of the FRS area. # VERBOSE=1 - Set to 1 to see more VERBOSE output +# This script should only be run on RPM based machines +# This test is not foolproof, but at least tries to detect +if [ `/bin/rpm -q -f /bin/rpm >/dev/null 2>&1; echo $?` != 0 ]; then + echo "ERROR: This script should only be executed on a RPM based Operation System." + exit 1 +fi + +exit 0 # you can change this if you need to USER=xcat TARGET_MACHINE=xcat.org From 33fa03880aaa88eec04eaa5d565f4b503a2a25a4 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Fri, 16 Nov 2018 11:39:56 -0500 Subject: [PATCH 4/4] Add more packages to check for when running the builddep.sh scripts --- builddep.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/builddep.sh b/builddep.sh index ca4206c42..8f66989c4 100755 --- a/builddep.sh +++ b/builddep.sh @@ -26,7 +26,6 @@ if [ `/bin/rpm -q -f /bin/rpm >/dev/null 2>&1; echo $?` != 0 ]; then exit 1 fi -exit 0 # you can change this if you need to USER=xcat TARGET_MACHINE=xcat.org @@ -57,11 +56,15 @@ if [ ! -d $GSA ]; then exit 1 fi -REQPKG="rpm-sign" -if [ `rpm -q $REQPKG >> /dev/null; echo $?` != 0 ]; then - echo "ERROR: $REQPKG is required to successfully create the xcat-deps package. Install and rerun." - exit 1 -fi +REQPKG=("rpm-sign" "createrepo") +for pkg in ${REQPKG[*]}; do + if [ `rpm -q $pkg >> /dev/null; echo $?` != 0 ]; then + echo "ERROR: $pkg is required to successfully create the xcat-deps package. Install and rerun." + exit 1 + else + echo "Checking for package=$pkg ..." + fi +done # set grep to quiet by default GREP="grep -q"