lots more debug

This commit is contained in:
Trevor Batley 2023-06-13 10:12:49 +10:00
parent 9c4d268e3d
commit 15899ef0c7

View File

@ -56,19 +56,15 @@ for param in $3 $4 $5 $6; do
break
fi
done
if [ $DEBUG ] ; then echo "found ini file: $inifilename" ; fi
SILENT="-s"
QUIET="-q"
if [ $DEBUG ] ; then
echo "found ini file: $inifilename"
SILENT=
QUIET=
fi
GITEAHOST=${remote_GITEAHOST}
ACCESSTOKEN=${remote_GITEAACCESSTOKEN}
ORG_NAME="$2"
REPO_NAME="$1"
if [[ $smegit_WORKDIR == ~* ]] ; then
# relative to users home dir
WORKDIR=$(echo ~)${smegit_WORKDIR:1}
@ -93,6 +89,7 @@ if [ $DEBUG ] ; then echo $GITFiles ; fi
# See if it already exists
if [ ! -e $GITFiles/common ]; then
#Get it
if [ $DEBUG ] ; then echo "clone common" ; fi
cd $GITFiles
git clone "${smegit_COMMONREPO}" $QUIET
if [ ! -e $GITFiles/common ]; then
@ -101,6 +98,7 @@ if [ ! -e $GITFiles/common ]; then
fi
else
# Just refresh it
if [ $DEBUG ] ; then echo "refresh common" ; fi
cd $GITFiles/common
git pull
fi
@ -109,6 +107,7 @@ fi
chmod +x $GITFiles/common/make-archive.sh
# See if repo exits in git
if [ $DEBUG ] ; then echo "check if $REPO_NAME in $ORG_NAME exists on $GITEAHOST" ; fi
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
@ -118,6 +117,7 @@ else
read -p "Do you wish to run git-cvs2git?(y/n) " yn
case $yn in
[Yy]* )
if [ $DEBUG ] ; then echo "running git-cvs2git.sh" ; fi
logname="git-cvs2git-create-$ORG_NAME-$REPO_NAME-$(date +'%FT%H%M').log"
git-cvs2git.sh "$REPO_NAME" "$ORG_NAME" > $logname
break;;
@ -126,6 +126,7 @@ else
esac
done
# And check it is now there
if [ $DEBUG ] ; then echo "check if $REPO_NAME in $ORG_NAME exists on $GITEAHOST" ; fi
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
@ -143,6 +144,7 @@ if [[ -d $REPO_NAME ]] ; then
if [ $DEBUG ] ; then echo "Deleting all files in $GITFiles/$REPO_NAME" ; fi
rm -rf "$GITFiles/$REPO_NAME"
fi
if [ $DEBUG ] ; then echo "cloning $REPOURL" ; fi
git clone "$REPOURL" $QUIET
cd $GITFiles
@ -152,6 +154,7 @@ if [[ ! -d $GITFiles/$REPO_NAME ]] ; then
fi
cd $GITFiles/$REPO_NAME
# and run mockbuild
if [ $DEBUG ] ; then echo "running make mockbuild" ; fi
logname="mockbuild-$ORG_NAME-$REPO_NAME-$(date +'%FT%H%M').log"
if make mockbuild 2>&1 > $logname ; then
echo "Looks like mockbuild worked for $ORG_NAME/$REPO_NAME"