ouline of git work

This commit is contained in:
Trevor Batley 2023-05-30 18:08:55 +10:00
parent ca0dc63f6f
commit 0eeda2655a

View File

@ -129,21 +129,16 @@ fi
#Fork e-smith-<pkg> into users repositories as smeserver-<pkg> #Fork e-smith-<pkg> into users repositories as smeserver-<pkg>
# - add bugzilla and wiki references # - add bugzilla and wiki references
if [ $DEBUG ] ; then echo "Forking $SORCEORG/$SOURCEPKG into $TARGETORG/$TARGETPKG!" ; fi
RESPONSE=$(curl "$SILENT" "$checkSSL" -X 'POST' \ RESPONSE=$(curl "$SILENT" "$checkSSL" -X 'POST' \
"https://src.koozali.org/api/v1/repos/$SOURCEORG/$SOURCEPKG/forks" \ "https://src.koozali.org/api/v1/repos/$SOURCEORG/$SOURCEPKG/forks" \
-H 'accept: application/json' \ -H 'accept: application/json' \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
-H "Authorization: token $SOURCEACCESSTOKEN" -H "Authorization: token $SOURCEACCESSTOKEN" \
-d '{ -d '{
"name": "'"$TARGETPKG"'", "name": "'"$TARGETPKG"'",
"description": "'"SMEServer Koozali developed git repo for $TARGETPKG base"'" "description": "'"SMEServer Koozali developed git repo for $TARGETPKG base"'"
}') }')
if [ $RESPONSE == "202" ] ; then
if [ $DEBUG ] ; then echo "$SOURCEPKG successfully forked" ; fi
else
echo "************Repository $SOURCEORG/$SOURCEPKG NOT forked on $SOURCEHOST ($RESPONSE)"
exit 1
fi
# create a Bugzilla URL # create a Bugzilla URL
PRODUCTBUGZILLA="SME%20Server%2010.X" PRODUCTBUGZILLA="SME%20Server%2010.X"
@ -177,31 +172,57 @@ WIKILINK=$(while read -r TITLE; do \
if [[ ! "$URL" =~ 'fr' ]] ; then echo "${URL}"; break; fi \ if [[ ! "$URL" =~ 'fr' ]] ; then echo "${URL}"; break; fi \
done <<< "${RESULTS}" ) done <<< "${RESULTS}" )
if [ $DEBUG ] ; then echo "Updating Description, Bug and Wiki links" ; fi
RESPONSE=$(curl "$SILENT" "$checkSSL" -X 'PATCH' \ RESPONSE=$(curl "$SILENT" "$checkSSL" -X 'PATCH' \
"$SOURCEHOST/api/v1/repos/$TARGETORG/$TARGETPKG" \ "$SOURCEHOST/api/v1/repos/$TARGETORG/$TARGETPKG" \
-H 'accept: application/json' \ -H 'accept: application/json' \
-H "Authorization: token $SOURCEACCESSTOKEN" \ -H "Authorization: token $SOURCEACCESSTOKEN" \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
-d '{ -d '{
"description": "'"SMEServer Koozali developed repo for $TARGETPKG base"'",
"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}",
"external_tracker_style": "numeric", "external_tracker_style": "numeric",
"external_tracker_url": "'"https://bugs.koozali.org/buglist.cgi?component=$TARGETPKG&product=$PRODUCTBUGZILLA"'" "external_tracker_url": "'"https://bugs.koozali.org/buglist.cgi?component=$TARGETPKG&product=$PRODUCTBUGZILLA"'"
}, },
"has_wiki": true,
"external_wiki": { "external_wiki": {
"external_wiki_url": "'"$WIKILINK"'" "external_wiki_url": "'"$WIKILINK"'"
} }
}' }'
) )
# Create the local Git repository
GITFiles=$WORKDIR/GITFiles/$TARGETORG
mkdir -p $GITFiles
cd $GITFiles
# Delete the local first
if [ -d "$TARGETPKG" ] ; then
if [ $DEBUG ] ; then echo "************Deleting local GIT files" ; fi
rm -Rf $GITFiles/$TARGETPKG
fi
# Clone the package
if [ $DEBUG ] ; then echo "git clone $SOURCEHOST/$TARGETORG/$TARGETPKG.git" ; fi
cd $GITFiles
git clone "$SOURCEHOST/$TARGETORG/$TARGETPKG.git"
cd $GITFiles/$TARGETPKG
#Update README.md #Update README.md
# - new name # - new name
# - Bugzilla link to new name whilst keeping old link for Legacy # - Bugzilla link to new name whilst keeping old link for Legacy
sed -i '/^e-smith/a smeserver' README.md
git add README.md
#Update Makefile #Update Makefile
# - NAME := smeserver-<pkg> # - NAME := smeserver-<pkg>
git add Makefile
#Rename e-smith-<pkg>.spec as smeserver-<pkg>.spec #Rename e-smith-<pkg>.spec as smeserver-<pkg>.spec
mv "$SOURCEPKG.spec" "$TARGETPKG.spec"
#Update smeserver-<pkg>.spec #Update smeserver-<pkg>.spec
# - change name to smeserver-<pkg> (%define name) # - change name to smeserver-<pkg> (%define name)
@ -211,7 +232,12 @@ RESPONSE=$(curl "$SILENT" "$checkSSL" -X 'PATCH' \
# - delete archivefilename file # - delete archivefilename file
# - add changelog entry (Bugzilla #12359) # - add changelog entry (Bugzilla #12359)
git rm "$SOURCEPKG.spec"
git add "$TARGETPKG.spec"
#Update createlinks #Update createlinks
# - if there is an e-smith-<pkg>-update event rename to smeserver-<pkg>-update # - if there is an e-smith-<pkg>-update event rename to smeserver-<pkg>-update
git commit -m "rename-e-smith-pkg"
#Convert repository to a Regular Repository (rather than fork) #Convert repository to a Regular Repository (rather than fork)