On Tue, 11 Jul 2006, Raphael Hertzog wrote: > > +use Debbugs::SOAP::Usertag; > > + > > +SOAP::Transport::HTTP::CGI > > + -> dispatch_to('Debbugs::SOAP::Usertag', 'Debbugs::SOAP::Hello') > > + -> handle; > > +
Obviously the "Debbugs::SOAP::Hello" was only a test of mine. It should be removed (updated patch attached). Another remark about this script. The first version used "Dynamic loading" of modules from a given directory... it avoided to harcode the list of SOAP modules in this script. However it required the addition of $gSoapDir. Since the number of SOAP modules is going to be very limited, it doesn't hurt to list them all here. That's why $gSoapDir disappeared. Cheers, -- Raphaël Hertzog Premier livre français sur Debian GNU/Linux : http://www.ouaza.com/livre/admin-debian/
=== added directory 'Debbugs/SOAP' === added file 'Debbugs/SOAP/Usertag.pm' --- /dev/null +++ Debbugs/SOAP/Usertag.pm @@ -0,0 +1,18 @@ +package Debbugs::SOAP::Usertag; + +use Debbugs::User; + +sub get_usertag { + my ($class, $email, $tag) = @_; + my %ut = (); + Debbugs::User::read_usertags(\%ut, $email); + if (defined($tag) and $tag ne "") { + # Remove unwanted tags + foreach (keys %ut) { + delete $ut{$_} unless $_ eq $tag; + } + } + return \%ut; +} + +1; === added file 'cgi/soap.cgi' --- /dev/null +++ cgi/soap.cgi @@ -0,0 +1,18 @@ +#!/usr/bin/perl -wT + +package debbugs; + +use SOAP::Transport::HTTP; + +BEGIN { + # Needed so that other modules have access to the variables + # when included with use + require '/etc/debbugs/config'; +} + +use Debbugs::SOAP::Usertag; + +SOAP::Transport::HTTP::CGI + -> dispatch_to('Debbugs::SOAP::Usertag') + -> handle; + === modified file 'Debbugs/User.pm' --- Debbugs/User.pm +++ Debbugs/User.pm @@ -53,7 +53,10 @@ $EXPORT_TAGS{all} = [EMAIL PROTECTED]; } -my $gSpoolPath = "/org/bugs.debian.org/spool"; +my $gSpoolDir = "/org/bugs.debian.org/spool"; +if (defined($debbugs::gSpoolDir)) { + $gSpoolDir = $debbugs::gSpoolDir; +} # Obsolete compatability functions @@ -83,7 +86,7 @@ sub filefromemail { my $e = shift; my $l = length($e) % 7; - return "$gSpoolPath/user/$l/" . join("", + return "$gSpoolDir/user/$l/" . join("", map { m/^[0-9a-zA-Z_+.-]$/ ? $_ : sprintf("%%%02X", ord($_)) } split //, $e); } === modified file 'cgi/bugreport.cgi' --- cgi/bugreport.cgi +++ cgi/bugreport.cgi @@ -9,11 +9,15 @@ use IO::Scalar; use IO::File; +BEGIN { + # Needed so that other modules have access to the variables + # when included with use + require '/etc/debbugs/config'; + require '/etc/debbugs/text'; +} + #require '/usr/lib/debbugs/errorlib'; require './common.pl'; - -require '/etc/debbugs/config'; -require '/etc/debbugs/text'; use vars(qw($gEmailDomain $gHTMLTail $gSpoolDir $gWebDomain)); === modified file 'cgi/pkgindex.cgi' --- cgi/pkgindex.cgi +++ cgi/pkgindex.cgi @@ -5,11 +5,15 @@ use strict; use POSIX qw(strftime tzset nice); +BEGIN { + # Needed so that other modules have access to the variables + # when included with use + require '/etc/debbugs/config'; + require '/etc/debbugs/text'; +} + #require '/usr/lib/debbugs/errorlib'; require './common.pl'; - -require '/etc/debbugs/config'; -require '/etc/debbugs/text'; nice(5); === modified file 'cgi/pkgreport.cgi' --- cgi/pkgreport.cgi +++ cgi/pkgreport.cgi @@ -5,11 +5,15 @@ use strict; use POSIX qw(strftime tzset nice); +BEGIN { + # Needed so that other modules have access to the variables + # when included with use + require '/etc/debbugs/config'; + require '/etc/debbugs/text'; +} + #require '/usr/lib/debbugs/errorlib'; require './common.pl'; - -require '/etc/debbugs/config'; -require '/etc/debbugs/text'; use Debbugs::User; === modified file 'debian/control' --- debian/control +++ debian/control @@ -8,7 +8,7 @@ Package: debbugs Architecture: all -Depends: perl5 | perl, exim4 | mail-transport-agent, libmailtools-perl, ed, libmime-perl, libio-stringy-perl, libmldbm-perl, liburi-perl +Depends: perl5 | perl, exim4 | mail-transport-agent, libmailtools-perl, ed, libmime-perl, libio-stringy-perl, libmldbm-perl, liburi-perl, libsoap-lite-perl Recommends: httpd, links | lynx Suggests: spamassassin (>= 3.0) Description: The bug tracking system based on the active Debian BTS === modified file 'scripts/config.debian' --- scripts/config.debian +++ scripts/config.debian @@ -4,6 +4,7 @@ # Domains $gEmailDomain = "bugs.debian.org"; $gListDomain = "lists.debian.org"; +$gWebHostBugDir = ""; $gWebDomain = "www.debian.org/Bugs"; $gHTMLSuffix = ""; $gPackagePages = "packages.debian.org"; === modified file 'scripts/config.in.default' --- scripts/config.in.default +++ scripts/config.in.default @@ -2,6 +2,7 @@ #domains $gEmailDomain = "bugs.top.domain"; #bugs.debian.org $gListDomain = "lists.top.domain"; #lists.debian.org +$gWebHostBugDir = ""; $gWebDomain = "www.top.domain"; #www.debian.org/Bugs $gCGIDomain = "cgi.top.domain"; #cgi.debian.org