From c9e3f1782c8533c02381b7783bac75f5e12384ea Mon Sep 17 00:00:00 2001 From: Trevor Batley Date: Mon, 5 Jun 2023 14:04:19 +1000 Subject: [PATCH] more debug statements --- rename-e-smith-pkg.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/rename-e-smith-pkg.sh b/rename-e-smith-pkg.sh index 9568f34..21eee15 100755 --- a/rename-e-smith-pkg.sh +++ b/rename-e-smith-pkg.sh @@ -162,7 +162,7 @@ if [[ "$SOURCEORG" == "smecontribs" ]]; then fi # migrate the source package over to target with updated fields -if [ $DEBUG ] ; then echo "Migrating $SOURCEORG/$SOURCEPKG as $TARGETORG/$1 on $TARGETHOST" ; fi +if [ $DEBUG ] ; then echo "Migrating $SOURCEORG/$SOURCEPKG as $TARGETORG/$TRAGETPKG on $GITEAHOST" ; fi RESPONSE=$(curl $SILENT $checkSSL -X 'POST' \ "$GITEAHOST/api/v1/repos/migrate" \ -H 'accept: application/json' \ @@ -179,6 +179,7 @@ RESPONSE=$(curl $SILENT $checkSSL -X 'POST' \ # Migrate does NOT copy accross the issues and wiki external links # grab WIKILINK from source package +if [ $DEBUG ] ; then echo "Retrieving WIKIKLINK from $SOURCEORG/$SOURCEPKG" ; fi WIKILINK=$(curl "$SILENT" "$checkSSL" -X 'GET' \ "$GITEAHOST/api/v1/repos/$SOURCEORG/$SOURCEPKG" \ -H 'accept: application/json' \ @@ -188,13 +189,13 @@ WIKILINK=$(curl "$SILENT" "$checkSSL" -X 'GET' \ if [ $DEBUG ] ; then echo "WIKILINK=$WIKILINK" ; fi # Update the repo with the changed bugzilla url and original wiki url -if [ $DEBUG ] ; then echo "Updating Description, Bug and Wiki links" ; fi +if [ $DEBUG ] ; then echo "Updating Bug and Wiki links" ; fi RESPONSE=$(curl "$SILENT" "$checkSSL" -X 'PATCH' \ - "$GITEAHOST/api/v1/repos/$TARGETORG/$TARGETPKG" \ - -H 'accept: application/json' \ - -H "Authorization: token $GITEAACCESSTOKEN" \ - -H 'Content-Type: application/json' \ - -d '{ + "$GITEAHOST/api/v1/repos/$TARGETORG/$TARGETPKG" \ + -H 'accept: application/json' \ + -H "Authorization: token $GITEAACCESSTOKEN" \ + -H 'Content-Type: application/json' \ + -d '{ "has_issues": true, "external_tracker": { "external_tracker_format": "https://bugs.koozali.org/show_bug.cgi?id={index}", @@ -284,6 +285,7 @@ git push origin &> /dev/null # Do we want to transfer the new package into the source organisation if [ $TRANSFER ] ; then + if [ $DEBUG ] ; then echo "Transferring $TARGETORG/$TARGETPKG to $SOURCEORG/$TARGETPKG" ; fi #Check that target package does not exist if [ $DEBUG ] ; then echo "Check if $SORCEORG/$TARGETPKG is there!" ; fi RESPONSE=$(curl $SILENT -o /dev/null -w "%{http_code}" "$GITEAHOST/api/v1/repos/$SOURCEORG/$TARGETPKG") @@ -323,6 +325,7 @@ if [ $TRANSFER ] ; then # Transfer the package back to source organisation if [[ -z $EXISTS ]] ; then + if [ $DEBUG ] ; then echo "Acrtual Transfer" ; fi RESPONSE=$(curl "$SILENT" "$checkSSL" -o /dev/null -w "%{http_code}" -X 'POST' \ "$GITEAHOST/api/v1/repos/$TARGETORG/$TARGETPKG/transfer" \ -H 'accept: application/json' \