| 1 | #!/bin/sh |
| 2 | |
| 3 | if [ -z "$RTUSER" ]; then |
| 4 | echo "You need to set the environment variable RTUSER to your rt.perl.org username" |
| 5 | exit |
| 6 | fi |
| 7 | |
| 8 | if [ -z "$RTPASSWD" ]; then |
| 9 | echo "You need to set the environment variable RTPASSWD to your rt.perl.org password" |
| 10 | exit |
| 11 | fi |
| 12 | |
| 13 | |
| 14 | export RTSERVER=https://rt.perl.org/ |
| 15 | |
| 16 | |
| 17 | |
| 18 | if [ -z "$1" ]; then |
| 19 | echo "$0 ticketid [patchid]" |
| 20 | exit |
| 21 | fi |
| 22 | |
| 23 | if [ "$1" = "list" ]; then |
| 24 | rt ls "Queue = 'perl5' AND (Status = 'new' OR Status = 'open') AND (Type = 'patch' OR Subject LIKE 'patch')" |
| 25 | exit; |
| 26 | fi |
| 27 | |
| 28 | if [ -z "$2" ]; then |
| 29 | rt show ticket/$1/attachments |grep -v "^id" |grep -v multipart\/ |
| 30 | exit |
| 31 | fi |
| 32 | |
| 33 | rt show ticket/$1/attachments/$2/content |