2024-10-27 13:07:54 +01:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# git-edit-readme.sh
|
|
|
|
#
|
2024-10-27 16:44:50 +01:00
|
|
|
# Edit the README.md for an smeserver package and alter the Bugzilla link
|
2024-10-27 13:07:54 +01:00
|
|
|
#
|
|
|
|
# $1 = package name
|
2024-10-27 16:44:50 +01:00
|
|
|
|
|
|
|
ORG=smecontribs # or smeserver
|
|
|
|
|
|
|
|
echo "$ORG / $1"
|
|
|
|
|
|
|
|
cd ~/GITFiles/$ORG
|
2024-10-27 13:07:54 +01:00
|
|
|
if [ -d "$1" ]; then
|
|
|
|
cd "$1"
|
|
|
|
git pull
|
|
|
|
else
|
2024-10-27 16:44:50 +01:00
|
|
|
git clone "https://src.koozali.org/$ORG/$1"
|
2024-10-27 13:07:54 +01:00
|
|
|
cd "$1"
|
|
|
|
fi
|
|
|
|
|
2024-10-27 16:44:50 +01:00
|
|
|
echo "Current directory: `pwd`"
|
|
|
|
|
2024-10-27 13:07:54 +01:00
|
|
|
if [ -f "README.md" ]; then
|
2024-10-27 16:44:50 +01:00
|
|
|
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
|
|
|
|
|
2024-10-27 13:07:54 +01:00
|
|
|
git status
|
|
|
|
git add --all
|
2024-10-27 16:44:50 +01:00
|
|
|
git commit -m "Update README with specific Bugzilla links"
|
2024-10-27 13:07:54 +01:00
|
|
|
git push
|
|
|
|
else
|
|
|
|
echo "README.md not found in $1"
|
|
|
|
fi
|