more debug statements

This commit is contained in:
Trevor Batley 2023-06-05 14:04:19 +10:00
parent de4a821af5
commit c9e3f1782c

View File

@ -162,7 +162,7 @@ if [[ "$SOURCEORG" == "smecontribs" ]]; then
fi fi
# migrate the source package over to target with updated fields # 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' \ RESPONSE=$(curl $SILENT $checkSSL -X 'POST' \
"$GITEAHOST/api/v1/repos/migrate" \ "$GITEAHOST/api/v1/repos/migrate" \
-H 'accept: application/json' \ -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 # Migrate does NOT copy accross the issues and wiki external links
# grab WIKILINK from source package # grab WIKILINK from source package
if [ $DEBUG ] ; then echo "Retrieving WIKIKLINK from $SOURCEORG/$SOURCEPKG" ; fi
WIKILINK=$(curl "$SILENT" "$checkSSL" -X 'GET' \ WIKILINK=$(curl "$SILENT" "$checkSSL" -X 'GET' \
"$GITEAHOST/api/v1/repos/$SOURCEORG/$SOURCEPKG" \ "$GITEAHOST/api/v1/repos/$SOURCEORG/$SOURCEPKG" \
-H 'accept: application/json' \ -H 'accept: application/json' \
@ -188,13 +189,13 @@ WIKILINK=$(curl "$SILENT" "$checkSSL" -X 'GET' \
if [ $DEBUG ] ; then echo "WIKILINK=$WIKILINK" ; fi if [ $DEBUG ] ; then echo "WIKILINK=$WIKILINK" ; fi
# Update the repo with the changed bugzilla url and original wiki url # 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' \ RESPONSE=$(curl "$SILENT" "$checkSSL" -X 'PATCH' \
"$GITEAHOST/api/v1/repos/$TARGETORG/$TARGETPKG" \ "$GITEAHOST/api/v1/repos/$TARGETORG/$TARGETPKG" \
-H 'accept: application/json' \ -H 'accept: application/json' \
-H "Authorization: token $GITEAACCESSTOKEN" \ -H "Authorization: token $GITEAACCESSTOKEN" \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
-d '{ -d '{
"has_issues": true, "has_issues": true,
"external_tracker": { "external_tracker": {
"external_tracker_format": "https://bugs.koozali.org/show_bug.cgi?id={index}", "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 # Do we want to transfer the new package into the source organisation
if [ $TRANSFER ] ; then if [ $TRANSFER ] ; then
if [ $DEBUG ] ; then echo "Transferring $TARGETORG/$TARGETPKG to $SOURCEORG/$TARGETPKG" ; fi
#Check that target package does not exist #Check that target package does not exist
if [ $DEBUG ] ; then echo "Check if $SORCEORG/$TARGETPKG is there!" ; fi 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") 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 # Transfer the package back to source organisation
if [[ -z $EXISTS ]] ; then if [[ -z $EXISTS ]] ; then
if [ $DEBUG ] ; then echo "Acrtual Transfer" ; fi
RESPONSE=$(curl "$SILENT" "$checkSSL" -o /dev/null -w "%{http_code}" -X 'POST' \ RESPONSE=$(curl "$SILENT" "$checkSSL" -o /dev/null -w "%{http_code}" -X 'POST' \
"$GITEAHOST/api/v1/repos/$TARGETORG/$TARGETPKG/transfer" \ "$GITEAHOST/api/v1/repos/$TARGETORG/$TARGETPKG/transfer" \
-H 'accept: application/json' \ -H 'accept: application/json' \