From 7eb6b5769e8fb21ec5f53ba038c5e6790499e2d5 Mon Sep 17 00:00:00 2001 From: Trevor Batley Date: Tue, 6 Jun 2023 19:31:48 +1000 Subject: [PATCH] quieten a little --- git-get-repo-and-build.sh | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/git-get-repo-and-build.sh b/git-get-repo-and-build.sh index d53aaa4..28859e0 100755 --- a/git-get-repo-and-build.sh +++ b/git-get-repo-and-build.sh @@ -38,16 +38,20 @@ DEBUG= if [ ${smegit_DEBUG} == "true" ] ; then DEBUG=true ; fi if [ $DEBUG ] ; then echo "found ini file: $inifilename" ; fi -curlsilent="-s" -if [ $DEBUG ] ; then curlsilent= ; fi +SILENT="-s" +QUIET="-q" +if [ $DEBUG ] ; then + SILENT= + QUIET= +fi GITEAHOST=${remote_GITEAHOST} ACCESSTOKEN=${remote_GITEAACCESSTOKEN} if [ $3 ] ; then - if [ $3 == "local" ] ; then - GITEAHOST=${local_GITEAHOST} - ACCESSTOKEN=${local_GITEAACCESSTOKEN} - fi + if [ $3 == "local" ] ; then + GITEAHOST=${local_GITEAHOST} + ACCESSTOKEN=${local_GITEAACCESSTOKEN} + fi fi ORG_NAME="$2" REPO_NAME="$1" @@ -76,7 +80,7 @@ if [ $DEBUG ] ; then echo $GITFiles ; fi if [ ! -e $GITFiles/common ]; then #Get it cd $GITFiles - git clone "${smegit_COMMONREPO}" + git clone $QUIET "${smegit_COMMONREPO}" if [ ! -e $GITFiles/common ]; then echo "ERROR*******No Common Repo found - package $REPO_NAME" exit 1 @@ -84,14 +88,14 @@ if [ ! -e $GITFiles/common ]; then else # Just refresh it cd $GITFiles/common - git pull + git $QUIET pull fi # Now make sure that the make-archive is executible chmod +x $GITFiles/common/make-archive.sh # See if repo exits in git -RESPONSE=$(curl $curlsilent -o /dev/null -w "%{http_code}" "$GITEAHOST/api/v1/repos/$ORG_NAME/$REPO_NAME") +RESPONSE=$(curl $SILENT -o /dev/null -w "%{http_code}" "$GITEAHOST/api/v1/repos/$ORG_NAME/$REPO_NAME") if [ "$RESPONSE" == "200" ]; then if [ $DEBUG ] ; then echo "Repository for $ORG_NAME/$REPO_NAME exists!" ; fi else @@ -106,7 +110,7 @@ else esac done # And check it is now there - RESPONSE=$(curl $curlsilent -o /dev/null -w "%{http_code}" "$GITEAHOST/api/v1/repos/$ORG_NAME/$REPO_NAME") + RESPONSE=$(curl $SILENT -o /dev/null -w "%{http_code}" "$GITEAHOST/api/v1/repos/$ORG_NAME/$REPO_NAME") if [ "$RESPONSE" == "200" ]; then if [ $DEBUG ] ; then echo "Repository for $ORG_NAME/$REPO_NAME created sucessfully!" ; fi else @@ -125,7 +129,7 @@ if [[ -d $REPO_NAME ]] ; then rm -rf "$REPO_NAME" fi cd $GITFiles -git clone "$REPOURL" +git $QUIET clone "$REPOURL" cd $GITFiles @@ -144,12 +148,3 @@ else echo "$(date +'%FT%H%M') Mockbuild failed for $ORG_NAME/$REPO_NAME " >> $GITFiles/mockbuilds.log exit 1 fi - - - - - - - - -