forked from derphilipp/macportsscripts
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
mp-trac-category-ports.sh
33 lines (31 loc) · 1.18 KB
/
mp-trac-category-ports.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/sh
# Taken from https://trac.macports.org/wiki/KDEProblems/KDETickets/KDE4-Category
# There is a separate one for localization ones at:
# https://trac.macports.org/wiki/KDEProblems/KDETickets/KDE4-Category/KDE4-l10n
# (TODO: make a more generalizable version?)
echo "||'''Port'''||'''Category'''||'''Repository'''||'''Tickets'''||"; \
for name in $(port echo "category:(\W|^)$1(\W|$)"); do \
port file $name 2>&1 \
| grep 'tarballs' \
| sed -E \
-e 's|/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/||' \
-e 's|^(.*)/Portfile$|trunk/dports/\1|' \
| awk -v NAME=$name 'BEGIN \
{ FS = "/" } ; \
{ printf "||[source:"$0" "NAME"]||[source:" } ; \
{ \
for (x=1; x<NF; x++) { \
printf "%s", $x ; \
if (x != NF-1) printf "/" \
} \
} ; \
{ printf " "$(NF-1)"]||[source:" } ; \
{ \
for (x=1; x<NF-1; x++) { \
printf "%s", $x ; \
if (x != NF-2) printf "/" \
} \
} ; \
{ printf " "$(NF-3)"]||||[[TicketQuery(port="NAME"&status=new|assigned|reopened)]]||\n" } ; \
' ;
done