suppress git output

This commit is contained in:
Trevor Batley 2023-05-22 11:37:20 +10:00
parent 9b82858000
commit 1498c42a41

View File

@ -55,9 +55,11 @@ if [ $DEBUG ] ; then echo "************found ini file: $inifilename" ; fi
# Make this null if you want lots of output. Still quite a bit anyway # Make this null if you want lots of output. Still quite a bit anyway
QUIET="-q" QUIET="-q"
curlsilent="-s" curlsilent="-s"
suppress=" > /dev/null 2>&1"
if [ $DEBUG ] ; then if [ $DEBUG ] ; then
QUIET= QUIET=
curlsilent="-v" curlsilent="-v"
suppress=
fi fi
# Make this null to get curl to check ssl cert # Make this null to get curl to check ssl cert
checkSSL="-k" checkSSL="-k"
@ -132,7 +134,7 @@ fi
# Make sure credentials taken from store # Make sure credentials taken from store
# The first time you pull or push it will ask for credentials and then save them in a file. # The first time you pull or push it will ask for credentials and then save them in a file.
git config --global credential.helper store git config --global credential.helper store $suppress
# #
# Clone the CVS repository # Clone the CVS repository
@ -148,7 +150,7 @@ fi
# Then get it fully from CVS # Then get it fully from CVS
cd $CVSFiles cd $CVSFiles
cvs -d:ext:shell.koozali.org:/cvs/$2 $QUIET checkout $1 cvs -d:ext:shell.koozali.org:/cvs/$2 $QUIET checkout $1
# Prepare variable for file in repo to indicate core or contrib. # Prepare variable for file in repo to indicate core or contrib.
# and init gitea organisation # and init gitea organisation
@ -225,7 +227,7 @@ if [ "$RESPONSE" == "200" ]; then
# And Clone it # And Clone it
if [ $DEBUG ] ; then echo "git clone $GITEAHOST/$ORGGITEA/$1.git" ; fi if [ $DEBUG ] ; then echo "git clone $GITEAHOST/$ORGGITEA/$1.git" ; fi
cd $GITFiles cd $GITFiles
git clone "$GITEAHOST/$ORGGITEA/$1.git" git clone "$GITEAHOST/$ORGGITEA/$1.git" $suppress
#GIT_SSL_NO_VERIFY=true git clone "$GITEAHOST/$ORGGITEA/$1.git" #GIT_SSL_NO_VERIFY=true git clone "$GITEAHOST/$ORGGITEA/$1.git"
NOREPO=0 NOREPO=0
else else
@ -335,7 +337,7 @@ fi
# Pull in the auto created or updated files # Pull in the auto created or updated files
cd $GITFiles cd $GITFiles
#GIT_SSL_NO_VERIFY=true git clone "$GITEAHOST/$ORGGITEA/$1.git" #GIT_SSL_NO_VERIFY=true git clone "$GITEAHOST/$ORGGITEA/$1.git"
git clone "$GITEAHOST/$ORGGITEA/$1.git" git clone "$GITEAHOST/$ORGGITEA/$1.git" $suppress
if [ ! -d $GITFiles/$1 ] ; then if [ ! -d $GITFiles/$1 ] ; then
echo "ERROR*******Unable to access the new repo directory for $HTTP_URL $GITFiles/$1" echo "ERROR*******Unable to access the new repo directory for $HTTP_URL $GITFiles/$1"
@ -347,7 +349,7 @@ cd $CVSFiles/$1/$BASEORCONTRIB
# Fully populate the directory (gets the tar file - which is not strictly in CVS) and creates the directory source tree # Fully populate the directory (gets the tar file - which is not strictly in CVS) and creates the directory source tree
# applying the patches to the base in the tar file. # applying the patches to the base in the tar file.
# Might need to replace this by the code from the makefile if we decide to move "make prep" to git moe likely we'll implement a new one "make gitprep". # Might need to replace this by the code from the makefile if we decide to move "make prep" to git moe likely we'll implement a new one "make gitprep".
make prep make prep $suppress
# Extract the directory name for the file tree (it will include the name of the module plus some version information) # Extract the directory name for the file tree (it will include the name of the module plus some version information)
# Same trick that we use in the makefile.common - taking the name and verison from the .spec file. # Same trick that we use in the makefile.common - taking the name and verison from the .spec file.
@ -387,7 +389,7 @@ echo $BASEORCONTRIB > contriborbase
BASESPECFILE=$(basename $SPECFILE) BASESPECFILE=$(basename $SPECFILE)
for fpath in "$BASESPECFILE" "Makefile" for fpath in "$BASESPECFILE" "Makefile"
do do
echo "************Copying $CVSFiles/$1/$BASEORCONTRIB/$fpath" if [ $DEBUG ] ; then echo "************Copying $CVSFiles/$1/$BASEORCONTRIB/$fpath" ; fi
if [[ -f $CVSFiles/$1/$BASEORCONTRIB/$fpath ]] ; then if [[ -f $CVSFiles/$1/$BASEORCONTRIB/$fpath ]] ; then
cp -R $CVSFiles/$1/$BASEORCONTRIB/$fpath . cp -R $CVSFiles/$1/$BASEORCONTRIB/$fpath .
else else
@ -514,9 +516,9 @@ else
# Third party package # Third party package
# copy over the archive file and make sure the extension is tracked by git-lfs # copy over the archive file and make sure the extension is tracked by git-lfs
if [ $DEBUG ] ; then echo "************Found 3rd party package $NAME" ; fi if [ $DEBUG ] ; then echo "************Found 3rd party package $NAME" ; fi
git lfs install git lfs install $suppress
git lfs track "*.$EXT" git lfs track "*.$EXT" $suppress
git add .gitattributes git add .gitattributes $suppress
#git config lfs.http://gitea.bjsystems.co.uk/SMEContribs/bugzilla.git/info/lfs.locksverify true #git config lfs.http://gitea.bjsystems.co.uk/SMEContribs/bugzilla.git/info/lfs.locksverify true
if [[ -f $CVSFiles/$1/$BASEORCONTRIB/$ARCHIVEFILE ]] ; then if [[ -f $CVSFiles/$1/$BASEORCONTRIB/$ARCHIVEFILE ]] ; then
if [ $DEBUG ] ; then echo "************Copying archivefile $CVSFiles/$1/$BASEORCONTRIB/$ARCHIVEFILE" ; fi if [ $DEBUG ] ; then echo "************Copying archivefile $CVSFiles/$1/$BASEORCONTRIB/$ARCHIVEFILE" ; fi
@ -533,7 +535,7 @@ if [[ $ARCHIVEFILE != "$TREEPATH.tar.gz" ]] ; then
fi fi
# Take out any bogus dates: # Take out any bogus dates:
/usr/bin/BogusDateBot.sh $(basename $SPECFILE) /usr/bin/BogusDateBot.sh $(basename $SPECFILE) $suppress
# If it is an SME package, take out the patches and then update the release. # If it is an SME package, take out the patches and then update the release.
if [[ "$NAME" =~ ^(smeserver-|e-smith-).* ]]; then if [[ "$NAME" =~ ^(smeserver-|e-smith-).* ]]; then
@ -588,7 +590,7 @@ if [ ! -e $GITFiles/common ]; then
else else
# Just refresh it # Just refresh it
cd $GITFiles/common cd $GITFiles/common
git pull git pull $suppress
fi fi
# Now make sure that the make-archive is executible # Now make sure that the make-archive is executible
@ -667,7 +669,7 @@ if [[ "$NAME" =~ ^(smeserver-|e-smith-).* ]]; then
# Extract the text from the response # Extract the text from the response
PARAGRAPH=`echo $response | jq -r '.choices[].text'` PARAGRAPH=`echo $response | jq -r '.choices[].text'`
# Add it to what was there already # Add it to what was there already
echo "************Creating description for $1" if [ $DEBUG ] ; then echo "************Creating description for $1" ; fi
echo -e "\n\n## Description\n" >> README.md echo -e "\n\n## Description\n" >> README.md
echo -e "<br />*This description has been generated by an LLM AI system and cannot be relied on to be fully correct.*" >> README.md echo -e "<br />*This description has been generated by an LLM AI system and cannot be relied on to be fully correct.*" >> README.md
echo -e "*Once it has been checked, then this comment will be deleted*" >> README.md echo -e "*Once it has been checked, then this comment will be deleted*" >> README.md
@ -730,24 +732,24 @@ if [ $DEBUG ] ; then echo $RESPONSE ; fi
cd $GITFiles/$1 cd $GITFiles/$1
# stage and commit all the files created locally # stage and commit all the files created locally
git add -A git add -A $suppress
echo "$1 git status" >>gitstatus.log echo "$1 git status" >>gitstatus.log
git status >>gitstatus.log git status >>gitstatus.log
git status git status $suppress
COMMENT="initial commit of file from CVS for $1 on `date`" COMMENT="initial commit of file from CVS for $1 on `date`"
git commit -m "$COMMENT" $QUIET git commit -m "$COMMENT" $QUIET
# push the converted git repository to the remote # push the converted git repository to the remote
git remote remove origin git remote remove origin $suppress
git remote add origin "$GITEAHOST/$ORGGITEA/$1.git" git remote add origin "$GITEAHOST/$ORGGITEA/$1.git" $suppress
#GIT_SSL_NO_VERIFY=true git push --force -u $QUIET origin master #GIT_SSL_NO_VERIFY=true git push --force -u $QUIET origin master
git push --force -u $QUIET origin master git push --force -u $QUIET origin master $suppress
# Now create the version and release tag for these files # Now create the version and release tag for these files
RELEASE=`rpm --queryformat '%{release}\n' --specfile $NAME.spec | head -n 1` RELEASE=`rpm --queryformat '%{release}\n' --specfile $NAME.spec | head -n 1`
TAG=$VERSION-$RELEASE TAG=$VERSION-$RELEASE
git tag -a $TAG -m "$COMMENT" git tag -a $TAG -m "$COMMENT" $suppress
git push origin $TAG git push origin $TAG $suppress
echo "Created $1 Repo: $HTTP_URL - Comment:$COMMENT tag:$TAG" echo "Created $1 Repo: $HTTP_URL - Comment:$COMMENT tag:$TAG"
exit 0 exit 0