From 1c4b06eae8c0d591fba13a52cf056c34eef93c50 Mon Sep 17 00:00:00 2001 From: Trevor Batley Date: Fri, 12 May 2023 11:29:42 +1000 Subject: [PATCH] fix dodgy debug echo --- git-cvs2git.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/git-cvs2git.sh b/git-cvs2git.sh index cfcd298..bd23697 100755 --- a/git-cvs2git.sh +++ b/git-cvs2git.sh @@ -154,7 +154,7 @@ cvs -d:ext:shell.koozali.org:/cvs/$2 $QUIET checkout $1 # and init gitea organisation # Adjust where we put the repo locally accordingly. ORGGITEA=$2 -if [ "$2" == "smecontribs" ]; then +if [[ "$2" == "smecontribs" ]]; then BASEORCONTRIB="contribs10" PRODUCTBUGZILLA="SME%20Contribs" else @@ -217,7 +217,7 @@ fi # See if it exists on the Gitea host REPO_NAME=$1 -if [ $DEBUG ] ; then echo "curl $checkSSL $curlsilent -o /dev/null -w %{http_code} $GITEAHOST/api/v1/repos/$ORGGITEA/$REPO_NAME" +if [ $DEBUG ] ; then echo "check that $GITEAHOST/$ORGGITEA/$REPO_NAME exists" RESPONSE=$(curl $checkSSL $curlsilent -o /dev/null -w "%{http_code}" "$GITEAHOST/api/v1/repos/$ORGGITEA/$REPO_NAME") if [ "$RESPONSE" == "200" ]; then if [ $DEBUG ] ; then echo "************Repository for $1 already exists!" ; fi @@ -239,7 +239,7 @@ cd $GITFiles if [ -d "$1" ] ; then cd $GITFiles/$1 # Retain the contents of the README.md (incase its been editted, and saving multiple GPT accesses) - if [ -f README.md ]; then + if [ -f README.md ] ; then # Move it and remember its new (temp) name READMECONTENTS=`mktemp` mv -f README.md "$READMECONTENTS" @@ -325,7 +325,7 @@ fi # And check it now exists RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" "$GITEAHOST/api/v1/repos/$ORGGITEA/$1") -if [ "$RESPONSE" == "200" ]; then +if [[ "$RESPONSE" == "200" ]]; then if [ $DEBUG ] ; then echo "************Repository for $1 exists" ; fi else echo "ERROR*******Repository for $1 has not been created ($JSONREQ)" @@ -368,7 +368,7 @@ if [ ! -f $ARCHIVEFILE ]; then # Try another tack if [ $DEBUG ] ; then echo "************File $ARCHIVE does not exist - trying *.$EXT" ; fi ARCHIVEFILE=`ls *.$EXT | head -n 1` - if [ ! -f $ARCHIVEFILE || -z $ARCHIVEFILE ]; then + if [[ ! -f $ARCHIVEFILE || -z $ARCHIVEFILE ]]; then echo "ERROR*******Can't identify archive file $ARCHIVEFILE $EXT `pwd`" exit 1 fi @@ -528,7 +528,7 @@ else fi cd $GITFiles/$1 -if [ $ARCHIVEFILE != "$TREEPATH.tar.gz" ] ; then +if [[ $ARCHIVEFILE != "$TREEPATH.tar.gz" ]] ; then echo "$ARCHIVEFILE" > archivefilename fi @@ -630,7 +630,7 @@ if [[ "$NAME" =~ ^(smeserver-|e-smith-).* ]]; then if [[ ! "$URL" =~ 'fr' ]] ; then echo "${URL}"; break; fi \ done <<< "${RESULTS}" ) - if [ "$READMECONTENTS" == "" ]; then + if [[ "$READMECONTENTS" == "" ]]; then # nothing previous # Copy across the Wiki links to the README if [ ! "$URLS" = "" ]; then