From e30641250e37423f45c7d532a4e8411e08ebba16 Mon Sep 17 00:00:00 2001 From: Brian Read Date: Sun, 27 Oct 2024 15:44:50 +0000 Subject: [PATCH] use awk and markdown for contribs --- git-edit-readme.sh | 57 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 50 insertions(+), 7 deletions(-) diff --git a/git-edit-readme.sh b/git-edit-readme.sh index 7d4f7c1..f825f69 100755 --- a/git-edit-readme.sh +++ b/git-edit-readme.sh @@ -2,25 +2,68 @@ # # git-edit-readme.sh # -# Edit the README.md for an smeserver package and alter the bugzilla link +# Edit the README.md for an smeserver package and alter the Bugzilla link # # $1 = package name -# -cd ~/GITFiles/smeserver + +ORG=smecontribs # or smeserver + +echo "$ORG / $1" + +cd ~/GITFiles/$ORG if [ -d "$1" ]; then cd "$1" git pull else - git clone "https://src.koozali.org/smeserver/$1" + git clone "https://src.koozali.org/$ORG/$1" cd "$1" fi -# Edit the README.md file +echo "Current directory: `pwd`" + if [ -f "README.md" ]; then - sed -i '/Show list of outstanding bugs: \[here\]/c\Show list of outstanding bugs: [here](https://bugs.koozali.org/buglist.cgi?quicksearch='"$1"')' README.md + echo "Running awk to update README.md" + + # Use a temporary file to handle multi-line replacement + awk '/Show list of outstanding bugs: \[here\]/{ + print "Show list of outstanding bugs:" + print "[All](https://bugs.koozali.org/buglist.cgi?action=wrap" \ + "&bug_status=UNCONFIRMED&bug_status=CONFIRMED" \ + "&bug_status=NEEDINFO&bug_status=IN_PROGRESS" \ + "&bug_status=RESOLVED&bug_status=VERIFIED" \ + "&classification=Contribs&component='"$1"'&list_id=105781" \ + "&order=changeddate+DESC%2Ccomponent%2Cpriority" \ + "%2Cbug_severity&product=SME+Contribs&query_format=advanced) " + print "[Confirmed](https://bugs.koozali.org/buglist.cgi?action=wrap" \ + "&bug_status=CONFIRMED&classification=Contribs&component='"$1"'" \ + "&list_id=105781&order=changeddate+DESC%2Ccomponent%2Cpriority" \ + "%2Cbug_severity&product=SME+Contribs&query_format=advanced) " + print "[Unconfirmed](https://bugs.koozali.org/buglist.cgi?action=wrap" \ + "&bug_status=UNCONFIRMED&classification=Contribs&component='"$1"'" \ + "&list_id=105781&order=changeddate+DESC%2Ccomponent%2Cpriority" \ + "%2Cbug_severity&product=SME+Contribs&query_format=advanced) " + print "[Need Info](https://bugs.koozali.org/buglist.cgi?action=wrap" \ + "&bug_status=NEEDINFO&classification=Contribs&component='"$1"'" \ + "&list_id=105781&order=changeddate+DESC%2Ccomponent%2Cpriority" \ + "%2Cbug_severity&product=SME+Contribs&query_format=advanced) " + print "[In Progress](https://bugs.koozali.org/buglist.cgi?action=wrap" \ + "&bug_status=IN_PROGRESS&classification=Contribs&component='"$1"'" \ + "&list_id=105781&order=changeddate+DESC%2Ccomponent%2Cpriority" \ + "%2Cbug_severity&product=SME+Contribs&query_format=advanced) " + print "[Verified](https://bugs.koozali.org/buglist.cgi?action=wrap" \ + "&bug_status=VERIFIED&classification=Contribs&component='"$1"'" \ + "&list_id=105781&order=changeddate+DESC%2Ccomponent%2Cpriority" \ + "%2Cbug_severity&product=SME+Contribs&query_format=advanced) " + print "[Resolved](https://bugs.koozali.org/buglist.cgi?action=wrap" \ + "&bug_status=RESOLVED&classification=Contribs&component='"$1"'" \ + "&list_id=105781&order=changeddate+DESC%2Ccomponent%2Cpriority" \ + "%2Cbug_severity&product=SME+Contribs&query_format=advanced) " + next + }1' README.md > README.tmp && mv README.tmp README.md + git status git add --all - git commit -m "Update readme bugzilla link to show all outstanding bugs" + git commit -m "Update README with specific Bugzilla links" git push else echo "README.md not found in $1"