forked from derphilipp/macportsscripts
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmacportstrac.sh
More file actions
executable file
·26 lines (22 loc) · 631 Bytes
/
macportstrac.sh
File metadata and controls
executable file
·26 lines (22 loc) · 631 Bytes
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
#!/bin/bash
# TODO: remember where this came from
if [ $# -lt 2 ]; then
echo "Usage:"
echo "macportstrac.sh query 'port name'"
echo "macportstrac.sh viewticket 'ticket number'"
exit
fi
INPUT=($@)
unset INPUT[0]
if [ $1 == "query" ]; then
for PORT in ${INPUT[*]}; do
echo "Port: ${PORT}"
curl -s "http://trac.macports.org/query?status=!closed&port=~${PORT}" | grep ' assigned\| closed\| new\| reopened\|href.*/ticket/' | sed -e 's|<[^>]*>||g'
done
fi
if [ $1 == "viewticket" ]; then
for TICKET in ${INPUT[*]}; do
echo "Ticket: #${TICKET}"
open "http://trac.macports.org/ticket/${TICKET}"
done
fi