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