#!/bin/sh

POD=<<EOPOD
=head1 NAME

get-ubuntu-packages - returns the list of packages which are maintained by debian-perl team in Ubuntu

=head1 SYNOPSIS

 $ get-ubuntu-packages
 ack-grep
 alice
 ...
 
=head1 DESCRIPTION

This script will connect to alioth.d.o (ssh access is needed) and then query
the list of packages from udd which are originated from the B<debian-perl team>
and are in B<Ubuntu>.
One package per line. Its output can later piped to other scripts like
L<lp-mass-subscribe>.

=head1 COPYRIGHT & LICENSE

Nathan Handler <nhandler@ubuntu.com>                           
                                                                               
Permission to use, copy, modify, and/or distribute this software for any       
purpose with or without fee is hereby granted, provided that the above         
copyright notice and this permission notice appear in all copies.              
                                                                               
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH  
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY    
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,   
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM    
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR  
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR         
PERFORMANCE OF THIS SOFTWARE.

=cut
EOPOD

ssh alioth.debian.org psql -U guest -h udd.debian.org -p 5452 -t udd << EOF
SELECT source from ubuntu_packages
WHERE maintainer='Debian Perl Group <pkg-perl-maintainers@lists.alioth.debian.org>'
OR original_maintainer='Debian Perl Group <pkg-perl-maintainers@lists.alioth.debian.org>'
GROUP BY source
ORDER BY source;
EOF
