Author: adsb Date: 2008-12-17 21:48:00 +0000 (Wed, 17 Dec 2008) New Revision: 1766
Modified: trunk/Devscripts/Debbugs.pm trunk/conf.default.in trunk/debian/changelog trunk/debian/postinst trunk/scripts/bts.pl Log: * bts: Allow an alternative debbugs server to be specified. (Closes: #508676) * Debbugs.pm: Allow the address of the debbugs server to be specified rather than hard-coding bugs.debian.org. * conf.default.in: + Add BTS_SERVER. Modified: trunk/Devscripts/Debbugs.pm =================================================================== --- trunk/Devscripts/Debbugs.pm 2008-12-14 14:01:10 UTC (rev 1765) +++ trunk/Devscripts/Debbugs.pm 2008-12-17 21:48:00 UTC (rev 1766) @@ -90,10 +90,18 @@ use warnings; my $soapurl='Debbugs/SOAP/1'; -my $soapproxyurl='http://bugs.debian.org/cgi-bin/soap.cgi'; +our $btsurl='http://bugs.debian.org/'; my @errors; sub init_soap { + my $soapproxyurl; + if ($btsurl =~ m%^https?://(.*)/?$%) { + $soapproxyurl = $btsurl . '/'; + } else { + $soapproxyurl = 'http://' . $btsurl . '/'; + } + $soapproxyurl =~ s%//$%/%; + $soapproxyurl .= 'cgi-bin/soap.cgi'; my $soap = SOAP::Lite->uri($soapurl)->proxy($soapproxyurl); $soap->transport->env_proxy(); Modified: trunk/conf.default.in =================================================================== --- trunk/conf.default.in 2008-12-14 14:01:10 UTC (rev 1765) +++ trunk/conf.default.in 2008-12-17 21:48:00 UTC (rev 1766) @@ -111,6 +111,9 @@ # Specify a list of e-mail addresses to which a carbon copy of the # generated e-mail to the control bot should automatically be sent. # [email protected] +# +# Which debbugs server should be used? +# BTS_SERVER=bugs.debian.org ##### chdist # Modified: trunk/debian/changelog =================================================================== --- trunk/debian/changelog 2008-12-14 14:01:10 UTC (rev 1765) +++ trunk/debian/changelog 2008-12-17 21:48:00 UTC (rev 1766) @@ -1,5 +1,9 @@ devscripts (2.10.44) UNRELEASED; urgency=low + * bts: Allow an alternative debbugs server to be specified. + (Closes: #508676) + * Debbugs.pm: Allow the address of the debbugs server to be specified + rather than hard-coding bugs.debian.org. * debdiff: + Fix a couple of formatting issues in the manpage. + Mention --{no-,}diffstat in the help message. @@ -7,8 +11,10 @@ settings. * licensecheck: Add .cs (C# source files) to the default list of files to check. (Closes: #508163) - * conf.default.in: Use the new reportbug.debian.org as an example SMTP host - for bts rather than bugs.debian.org. + * conf.default.in: + + Use the new reportbug.debian.org as an example SMTP host for bts + rather than bugs.debian.org. + + Add BTS_SERVER. -- Adam D. Barratt <[email protected]> Mon, 08 Dec 2008 06:49:32 +0000 Modified: trunk/debian/postinst =================================================================== --- trunk/debian/postinst 2008-12-14 14:01:10 UTC (rev 1765) +++ trunk/debian/postinst 2008-12-17 21:48:00 UTC (rev 1766) @@ -605,6 +605,17 @@ # USCAN_REPACK=no EOF fi + + if dpkg --compare-versions "$2" lt 2.10.44 + then + cat >> /etc/devscripts.conf << EOF +##### bts option added in 2.10.44 +# +# Which debbugs server should be used? +# BTS_SERVER=bugs.debian.org + +EOF + fi fi fi Modified: trunk/scripts/bts.pl =================================================================== --- trunk/scripts/bts.pl 2008-12-14 14:01:10 UTC (rev 1765) +++ trunk/scripts/bts.pl 2008-12-17 21:48:00 UTC (rev 1766) @@ -134,14 +134,6 @@ spamreport usertags); my $browser; # Will set if necessary -my $btsserver='bugs.debian.org'; -my $btsurl='http://bugs.debian.org/'; -my $btscgiurl='http://bugs.debian.org/cgi-bin/'; -my $btscgipkgurl='http://bugs.debian.org/cgi-bin/pkgreport.cgi'; -my $btscgibugurl='http://bugs.debian.org/cgi-bin/bugreport.cgi'; -my $btscgispamurl='http://bugs.debian.org/cgi-bin/bugspam.cgi'; -my $btsemail='[email protected]'; -my $packagesserver='packages.debian.org'; my $cachedir=$ENV{'HOME'}."/.devscripts_cache/bts/"; my $timestampdb=$cachedir."bts_timestamps.db"; @@ -322,6 +314,10 @@ Note that some SMTP servers may reject the use of a HELO which either does not resolve or does not appear to belong to the host using it. +=item --bts-server + +Use a debbugs server other than bugs.debian.org. + =item -f, --force-refresh Download a bug report again, even if it does not appear to have @@ -410,6 +406,7 @@ my $forceinteractive=0; my $ccemail=""; my $toolname=""; +my $btsserver='bugs.debian.org'; # Next, read read configuration files and then command line # The next stuff is boilerplate @@ -435,6 +432,7 @@ 'BTS_SUPPRESS_ACKS' => 'no', 'BTS_INTERACTIVE' => 'no', 'BTS_DEFAULT_CC' => '', + 'BTS_SERVER' => 'bugs.debian.org', ); my %config_default = %config_vars; @@ -508,6 +506,7 @@ $interactive = $config_vars{'BTS_INTERACTIVE'} eq 'no' ? 0 : 1; $forceinteractive = $config_vars{'BTS_INTERACTIVE'} eq 'force' ? 1 : 0; $ccemail = $config_vars{'BTS_DEFAULT_CC'}; + $btsserver = $config_vars{'BTS_SERVER'}; } if (exists $ENV{'BUGSOFFLINE'}) { @@ -554,6 +553,7 @@ "force-interactive" => sub { $interactive = 1; $forceinteractive = 1; }, "use-default-cc!" => \$use_default_cc, "toolname=s" => \$toolname, + "bts-server=s" => \$btsserver, ) or die "Usage: bts [options]\nRun $progname --help for more details\n"; @@ -632,6 +632,27 @@ $toolname =" (using $toolname)"; } +my $btsurl; +if ($btsserver =~ m%^https?://(.*)/?$%) { + $btsurl = $btsserver . '/'; + $btsserver=$1; +} else { + $btsurl = "http://$btsserver/"; +} +$btsurl =~ s%//$%/%; +my $btscgiurl=$btsurl . 'cgi-bin/'; +my $btscgipkgurl=$btscgiurl . 'pkgreport.cgi'; +my $btscgibugurl=$btscgiurl . 'bugreport.cgi'; +my $btscgispamurl=$btscgiurl . 'bugspam.cgi'; +my $btsemail='control@' . $btsserver; +my $packagesserver=''; +if ($btsserver =~ /bugs(-[\w-]+)?\.debian\.org/i) { + $packagesserver = 'packages.debian.org'; +} +no warnings 'once'; +$Devscripts::Debbugs::btsurl=$btsurl; +use warnings 'once'; + if (@ARGV == 0) { bts_help(); exit 0; @@ -1098,9 +1119,9 @@ warn <<"EOT"; bts: Closing $bug as you requested. Please note that the "bts close" command is deprecated! -It is usually better to email [email protected] with +It is usually better to email nnnnnn-do...@$btsserver with an informative mail. -Please remember to email [email protected] with +Please remember to email $bug-submitt...@$btsserver with an explanation of why you have closed this bug. Thank you! EOT } @@ -2038,6 +2059,8 @@ --smtp-password=pass } server which requires authentication --smtp-helo=helo HELO to use when connecting to the SMTP server; (defaults to the content of /etc/mailname) + --bts-server The name of the debbugs server to use + (default bugs.debian.org) --no-include-resolved Do not cache bugs marked as resolved --include-resolved Cache bugs marked as resolved (default) --no-ack Suppress BTS acknowledgment mails @@ -2851,8 +2874,8 @@ if ($thing =~ /^release-critical/) { @data = split /(?=<[Aa])/, $data; foreach (@data) { - s%<a href="(http://bugs.debian.org/cgi-bin/bugreport\.cgi.*bug=(\d+)[^\"]*)">(.+?)</a>%<a href="$2.html">$3</a> (<a href="$1">online</a>)%i; - s%<a href="(http://bugs.debian.org/cgi-bin/pkgreport\.cgi.*pkg=([^\"&;]+)[^\"]*)">(.+?)</a>%<a href="$2.html">$3</a> (<a href="$1">online</a>)%i; + s%<a href="(http://$btsserver/cgi-bin/bugreport\.cgi.*bug=(\d+)[^\"]*)">(.+?)</a>%<a href="$2.html">$3</a> (<a href="$1">online</a>)%i; + s%<a href="(http://$btsserver/cgi-bin/pkgreport\.cgi.*pkg=([^\"&;]+)[^\"]*)">(.+?)</a>%<a href="$2.html">$3</a> (<a href="$1">online</a>)%i; # References to other bug lists on bugs.d.o/release-critical if (m%<a href="((?:debian|other)[-a-z/]+\.html)"%i) { my $ref = 'release-critical/'.$1; @@ -2860,7 +2883,7 @@ s%<a href="((?:debian|other)[-a-z/]+\.html)">(.+?)</a>%<a href="$ref">$2</a> (<a href="${btsurl}release-critical/$1">online</a>)%i; } # Maintainer email address - YUCK!! - s%<a href="(http://bugs.debian.org/([^\"?...@[^\"?]*))">(.+?)</a>>%<a href="$2.html">$3</a>> (<a href="$1">online</a>)%i; + s%<a href="(http://$btsserver/([^\"?...@[^\"?]*))">(.+?)</a>>%<a href="$2.html">$3</a>> (<a href="$1">online</a>)%i; # Graph - we don't download s%<img src="graph.png" alt="Graph of RC bugs">%<img src="${btsurl}release-critical/graph.png" alt="Graph of RC bugs (online)">% } @@ -3676,6 +3699,11 @@ Specify a list of e-mail addresses to which a carbon copy of the generated e-mail to the control bot should automatically be sent. +=item BTS_SERVER + +Specify the name of a debbugs server which should be used instead of +bugs.debian.org. + =back =head1 SEE ALSO -- To unsubscribe, send mail to [email protected].
