use awk and markdown for contribs
This commit is contained in:
parent
0c858eaba1
commit
e30641250e
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user