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