macportstrac.sh

Bradley Giesbrecht brad at pixilla.com
Thu Oct 14 10:40:41 PDT 2010


I was interested in a simple and quick way to see if a port has any  
tickets in trac. I wrote a simple shell script as a starting point.  
Maybe there is already a command line svn-trac integration tool? I  
think this might be a nice feature to add to port itself.

These are the types of uses I am interested in:

port -q installed requested | awk '{print $1}' | xargs macportstrac.sh  
query

port -q echo maintainer:pixilla.com:brad | awk '{print $1}' | xargs  
macportstrac.sh query


Regards,
Bradley Giesbrecht


macportstrac.sh
#!/bin/bash

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/search?q=$ 
{PORT}&noquickjump=1&portsummarysearch=on" | grep -e '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



More information about the macports-dev mailing list