aboutsummaryrefslogtreecommitdiffstats
path: root/cgi/maintainers.cgi
blob: 6bb22f0f9d4d2827eca52368cfce8da50607171a (plain)
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/usr/bin/perl
# $Id$

=head1 NAME

maintainers.cgi - youri CGI interface to maintainers list

=head1 VERSION

Version 1.0

=head1 DESCRIPTION

This script allows to get package maintainers list through CGI interface.

=head1 SYNOPSIS

=head1 COPYRIGHT AND LICENSE

Copyright (C) 2004-2005, YOURI project

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

=head1 AUTHORS

Guillaume Rousse <guillomovitch@zarb.org>,

=cut

use Youri::Bugzilla;
use CGI;
use AppConfig qw/:argcount :expand/;
use strict;
use warnings;

my $config = AppConfig->new(
    {
        GLOBAL => {
           DEFAULT  => undef,
           EXPAND   => EXPAND_ALL,
           ARGCOUNT => ARGCOUNT_ONE,
       }
    },
    host => { ARGCOUNT => ARGCOUNT_ONE },
    base => { ARGCOUNT => ARGCOUNT_ONE },
    user => { ARGCOUNT => ARGCOUNT_ONE },
    pass => { ARGCOUNT => ARGCOUNT_ONE },
);

my $home = (getpwnam($ENV{PROJECT}))[7];
foreach my $file ("/etc/youri/maintainers.conf", "$home/.youri/maintainers.conf") {
    $config->file($file) if -f $file && -r $file;
}

my $bugzilla = Bugzilla->new(
    $config->host(),
    $config->base(),
    $config->user(),
    $config->pass(),
);

my $cgi = CGI->new();
print $cgi->header(-type=>'text/plain');

$bugzilla->browse_packages(sub { print "$_[0]\t$_[2]\n"; });