From 6c85bb4bda209e3e08c8e85c57b84a04edf68fa2 Mon Sep 17 00:00:00 2001 From: cjwatson <> Date: Sun, 17 Nov 2002 22:45:16 -0800 Subject: [PATCH] [project @ 2002-11-17 22:45:15 by cjwatson] Fix hardcoding of bugs.debian.org, /org/bugs.debian.org, and packages.qa.debian.org throughout. Touch index.{archive,db}.realtime on upgrade. --- UPGRADE | 3 +++ cgi/bugreport.cgi | 4 ++-- debian/debbugsconfig | 11 +++++++++++ scripts/config.debian | 3 ++- scripts/config.in | 3 ++- scripts/db2html.in | 6 +++--- scripts/errorlib.in | 8 ++++---- scripts/expire.in | 6 +++--- scripts/html-control.in | 6 +++--- scripts/html-install.in | 4 ++-- scripts/mailsummary.in | 6 +++--- scripts/process.in | 16 +++++++++------- scripts/processall.in | 6 +++--- scripts/rebuild.in | 6 +++--- scripts/receive.in | 8 ++++---- scripts/service.in | 16 +++++++++------- scripts/summary.in | 6 +++--- 17 files changed, 69 insertions(+), 49 deletions(-) diff --git a/UPGRADE b/UPGRADE index 4b466d38..ff61fd0b 100644 --- a/UPGRADE +++ b/UPGRADE @@ -13,12 +13,15 @@ $gWebHostBugDir = "Bugs"; # e.g. Bugs $gWebDomain = "$gWebHost/$gWebHostBugDir"; $gCGIDomain = "$gWebDomain/Bugs/cgi"; # e.g. cgi.debian.org $gPackagePages = "packages.debian.org"; # e.g. packages.debian.org +$gSubscriptionDomain = "packages.something"; # e.g. packages.qa.debian.org $gMaintainerFileOverride = "$gConfigDir/Maintainers.override"; $gUnknownMaintainerEmail = "$gMaintainerEmail"; $gPackageSource = "$gConfigDir/indices/sources"; $gWebDomain will probably exist already; change it as shown above. +$gSubscriptionDomain is optional. + $gMaintainerFileOverride is the name of a file used to manually override the Maintainers file (which is often automatically generated). diff --git a/cgi/bugreport.cgi b/cgi/bugreport.cgi index 7719933a..148b0002 100755 --- a/cgi/bugreport.cgi +++ b/cgi/bugreport.cgi @@ -14,7 +14,7 @@ require './common.pl'; require '/etc/debbugs/config'; require '/etc/debbugs/text'; -use vars(qw($gHTMLTail $gSpoolDir)); +use vars(qw($gEmailDomain $gHTMLTail $gSpoolDir)); my %param = readparse(); @@ -327,7 +327,7 @@ print "\n" . "\n" . '' . "\n"; -print "

" . "$debbugs::gProject $debbugs::gBug report logs - $short" . +print "

" . "$debbugs::gProject $debbugs::gBug report logs - $short" . "
" . htmlsanit($status{subject}) . "

\n"; print "$descriptivehead\n"; diff --git a/debian/debbugsconfig b/debian/debbugsconfig index 135df92c..aebd4402 100755 --- a/debian/debbugsconfig +++ b/debian/debbugsconfig @@ -31,6 +31,8 @@ require "text"; &template("sources", "$gConfigDir/indices"); &template("nextnumber", $gSpoolDir); +&touch("$gSpoolDir/index.archive.realtime"); +&touch("$gSpoolDir/index.db.realtime"); # stuff used when testing (comment out the above) #unshift @INC, "../"; @@ -72,6 +74,15 @@ sub template { } } +sub touch { + my $name = shift; + unless (-f $name) { + open TOUCH, ">> $name" or die "open $name: $!"; + close TOUCH; + print "created empty $name.\n"; + } +} + sub writefiles { local ($html, $text, $name) = @_; # first HTML diff --git a/scripts/config.debian b/scripts/config.debian index 4db27fd6..19b4ccd9 100644 --- a/scripts/config.debian +++ b/scripts/config.debian @@ -1,5 +1,5 @@ # This is the bugs.debian.org debbugs configuration file. -# $Id: config.debian,v 1.14 2002/10/03 12:49:43 cjwatson Exp $ +# $Id: config.debian,v 1.15 2002/11/17 22:45:16 cjwatson Exp $ # Domains $gEmailDomain = "bugs.debian.org"; @@ -10,6 +10,7 @@ $gCGIHost = "bugs.debian.org"; $gCGIPath = "/cgi-bin/"; $gCGIDomain = "http://$gCGIHost$gCGIPath"; $gMirrors = ""; # comma separated list +$gSubscriptionDomain = "packages.qa.debian.org"; # Project identification $gProject = "Debian"; diff --git a/scripts/config.in b/scripts/config.in index 6089ba3c..1371059a 100644 --- a/scripts/config.in +++ b/scripts/config.in @@ -1,6 +1,6 @@ # This is the template debbugs configuration file. # You *must* edit it in order for debbugs to work. -# $Id: config.in,v 1.15 2002/11/17 16:00:54 cjwatson Exp $ +# $Id: config.in,v 1.16 2002/11/17 22:45:16 cjwatson Exp $ # Domains $gEmailDomain = "bugs.something"; # e.g. bugs.debian.org @@ -12,6 +12,7 @@ $gWebDomain = "$gWebHost/$gWebHostBugDir"; $gCGIDomain = "$gWebDomain/Bugs/cgi"; # e.g. cgi.debian.org $gMirrors = ""; # comma separated list $gPackagePages = "packages.debian.org"; # e.g. packages.debian.org +$gSubscriptionDomain = "packages.something"; # e.g. packages.qa.debian.org # Project identification $gProject = "Something"; # e.g. Debian diff --git a/scripts/db2html.in b/scripts/db2html.in index 806f28fa..7b50c2b5 100755 --- a/scripts/db2html.in +++ b/scripts/db2html.in @@ -1,10 +1,10 @@ #!/usr/bin/perl -# $Id: db2html.in,v 1.10 2002/10/15 23:33:37 cjwatson Exp $ +# $Id: db2html.in,v 1.11 2002/11/17 22:45:16 cjwatson Exp $ # usage: db2html [-diff] [-stampfile=] [-lastrun=] #load the necessary libraries/configuration -$config_path = '/org/bugs.debian.org/etc'; -$lib_path = '/org/bugs.debian.org/scripts'; +$config_path = '/etc/debbugs'; +$lib_path = '/usr/lib/debbugs'; require("$config_path/config"); require("$config_path/text"); diff --git a/scripts/errorlib.in b/scripts/errorlib.in index c80a3abf..e424d2f6 100755 --- a/scripts/errorlib.in +++ b/scripts/errorlib.in @@ -1,5 +1,5 @@ # -*- perl -*- -# $Id: errorlib.in,v 1.16 2002/11/17 21:04:34 cjwatson Exp $ +# $Id: errorlib.in,v 1.17 2002/11/17 22:45:16 cjwatson Exp $ sub F_SETLK { 6; } sub F_WRLCK{ 1; } $flockstruct= 'sslll'; # And there ought to be something for this too. @@ -143,10 +143,10 @@ sub bughook_archive { &filelock("debbugs.trace.lock"); &appendfile("debbugs.trace","archive $ref\n"); my $line = update_realtime( - "/org/bugs.debian.org/spool/index.db.realtime", + "$gSpoolDir/index.db.realtime", $ref, "REMOVE"); - update_realtime("/org/bugs.debian.org/spool/index.archive.realtime", + update_realtime("$gSpoolDir/index.archive.realtime", $ref, $line); &unfilelock; } @@ -171,7 +171,7 @@ sub bughook { $firstpkg, $ref, $stuff[1], $whendone, $stuff[0], $severity, $stuff[5]; - update_realtime("/org/bugs.debian.org/spool/index.db.realtime", $ref, $k); + update_realtime("$gSpoolDir/index.db.realtime", $ref, $k); &unfilelock; } diff --git a/scripts/expire.in b/scripts/expire.in index 4c004eef..3bf368b5 100755 --- a/scripts/expire.in +++ b/scripts/expire.in @@ -1,10 +1,10 @@ #!/usr/bin/perl -# $Id: expire.in,v 1.13 2002/11/17 21:04:34 cjwatson Exp $ +# $Id: expire.in,v 1.14 2002/11/17 22:45:16 cjwatson Exp $ # Load modules and set envirnment use File::Copy; -$config_path = '/org/bugs.debian.org/etc'; -$lib_path = '/org/bugs.debian.org/scripts'; +$config_path = '/etc/debbugs'; +$lib_path = '/usr/lib/debbugs'; require("$config_path/config"); require("$config_path/text"); diff --git a/scripts/html-control.in b/scripts/html-control.in index ff53dc43..697fbb0f 100755 --- a/scripts/html-control.in +++ b/scripts/html-control.in @@ -1,10 +1,10 @@ #!/usr/bin/perl -# $Id: html-control.in,v 1.7 2001/08/16 17:43:45 doogie Exp $ +# $Id: html-control.in,v 1.8 2002/11/17 22:45:16 cjwatson Exp $ use POSIX; -$config_path = '/org/bugs.debian.org/etc'; -$lib_path = '/org/bugs.debian.org/scripts'; +$config_path = '/etc/debbugs'; +$lib_path = '/usr/lib/debbugs'; require("$config_path/config"); require("$lib_path/errorlib"); diff --git a/scripts/html-install.in b/scripts/html-install.in index 6d5d9892..bb6b04de 100755 --- a/scripts/html-install.in +++ b/scripts/html-install.in @@ -1,10 +1,10 @@ #!/usr/bin/perl -# $Id: html-install.in,v 1.3 2001/08/16 17:46:00 doogie Exp $ +# $Id: html-install.in,v 1.4 2002/11/17 22:45:16 cjwatson Exp $ # Takes 1 argument - directory tree to install into # Tree _must_ be synch'd with one used by db2html to generate file use POSIX; -$config_path = '/org/bugs.debian.org/etc'; +$config_path = '/etc/debbugs'; require("$config_path/config"); $ENV{'PATH'} = $lib_path.':'.$ENV{'PATH'}; diff --git a/scripts/mailsummary.in b/scripts/mailsummary.in index ee74bce4..294d0e45 100755 --- a/scripts/mailsummary.in +++ b/scripts/mailsummary.in @@ -1,8 +1,8 @@ #!/usr/bin/perl -# $Id: mailsummary.in,v 1.9 2002/09/22 15:20:08 cjwatson Exp $ +# $Id: mailsummary.in,v 1.10 2002/11/17 22:45:16 cjwatson Exp $ -$config_path = '/org/bugs.debian.org/etc'; -$lib_path = '/org/bugs.debian.org/scripts'; +$config_path = '/etc/debbugs'; +$lib_path = '/usr/lib/debbugs'; require("$config_path/config"); require("$lib_path/errorlib"); diff --git a/scripts/process.in b/scripts/process.in index 64af4c4e..8d9d2827 100755 --- a/scripts/process.in +++ b/scripts/process.in @@ -1,5 +1,5 @@ #!/usr/bin/perl -# $Id: process.in,v 1.56 2002/11/11 10:19:44 joy Exp $ +# $Id: process.in,v 1.57 2002/11/17 22:45:16 cjwatson Exp $ # # Usage: process nn # Temps: incoming/Pnn @@ -7,8 +7,8 @@ use Mail::Address; use MIME::Parser; -$config_path = '/org/bugs.debian.org/etc'; -$lib_path = '/org/bugs.debian.org/scripts'; +$config_path = '/etc/debbugs'; +$lib_path = '/usr/lib/debbugs'; require "$config_path/config"; require "$lib_path/errorlib"; @@ -1000,10 +1000,12 @@ sub checkmaintainers { $anymaintfound=0; $anymaintnotfound=0; for $p (split(m/[ \t?,()]+/,$s_package)) { $p =~ y/A-Z/a-z/; - if (defined($pkgsrc{$p})) { - push @addsrcaddrs, "$pkgsrc{$p}\@packages.qa.debian.org"; - } else { - push @addsrcaddrs, "$p\@packages.qa.debian.org"; + if (defined $gSubscriptionDomain) { + if (defined($pkgsrc{$p})) { + push @addsrcaddrs, "$pkgsrc{$p}\@$gSubscriptionDomain"; + } else { + push @addsrcaddrs, "$p\@$gSubscriptionDomain"; + } } if (defined($maintainerof{$p})) { print DEBUG "maintainer add >$p|$maintainerof{$p}<\n"; diff --git a/scripts/processall.in b/scripts/processall.in index 745ad502..e62a5ed4 100755 --- a/scripts/processall.in +++ b/scripts/processall.in @@ -1,5 +1,5 @@ #!/usr/bin/perl -# $Id: processall.in,v 1.8 2002/10/06 22:54:48 cjwatson Exp $ +# $Id: processall.in,v 1.9 2002/11/17 22:45:16 cjwatson Exp $ # # Usage: processall # @@ -8,8 +8,8 @@ # Creates: incoming/E.nn # Stop; process/stop -$config_path = '/org/bugs.debian.org/etc'; -$lib_path = '/org/bugs.debian.org/scripts'; +$config_path = '/etc/debbugs'; +$lib_path = '/usr/lib/debbugs'; require "$config_path/config"; require "$lib_path/errorlib"; diff --git a/scripts/rebuild.in b/scripts/rebuild.in index 57ca1ed3..4ea2e9c0 100755 --- a/scripts/rebuild.in +++ b/scripts/rebuild.in @@ -1,10 +1,10 @@ #!/usr/bin/perl -w -# $Id: rebuild.in,v 1.4 2001/08/16 17:51:33 doogie Exp $ +# $Id: rebuild.in,v 1.5 2002/11/17 22:45:16 cjwatson Exp $ # Load modules and set envirnment use File::Copy; -$config_path = '/org/bugs.debian.org/etc'; -$lib_path = '/org/bugs.debian.org/scripts'; +$config_path = '/etc/debbugs'; +$lib_path = '/usr/lib/debbugs'; require("$config_path/config"); require("$lib_path/errorlib"); diff --git a/scripts/receive.in b/scripts/receive.in index 92427913..2fe600fe 100755 --- a/scripts/receive.in +++ b/scripts/receive.in @@ -1,16 +1,16 @@ #!/usr/bin/perl -# $Id: receive.in,v 1.13 2002/11/04 16:32:02 cjwatson Exp $ +# $Id: receive.in,v 1.14 2002/11/17 22:45:16 cjwatson Exp $ # usage: mail is piped directly into program #set umask in order to have group-writable incoming/* #umask(002); #load configuration file -$config_path = '/org/bugs.debian.org/etc'; -#$lib_path = '/org/bugs.debian.org/scripts'; +$config_path = '/etc/debbugs'; +#$lib_path = '/usr/lib/debbugs'; require "$config_path/config"; -$ENV{'PATH'} = '/org/bugs.debian.org/scripts:'.$ENV{'PATH'}; +$ENV{'PATH'} = '/usr/lib/debbugs:'.$ENV{'PATH'}; #set source of mail delivery #sets any prefix needed to get mailer to add it to error mail diff --git a/scripts/service.in b/scripts/service.in index 4c116738..f01450d5 100755 --- a/scripts/service.in +++ b/scripts/service.in @@ -1,5 +1,5 @@ #!/usr/bin/perl -# $Id: service.in,v 1.61 2002/11/08 14:01:33 ajt Exp $ +# $Id: service.in,v 1.62 2002/11/17 22:45:16 cjwatson Exp $ # ^ more or less ^ # # Usage: service .nn @@ -9,8 +9,8 @@ use Mail::Address; use File::Copy; use MIME::Parser; -$config_path = '/org/bugs.debian.org/etc'; -$lib_path = '/org/bugs.debian.org/scripts'; +$config_path = '/etc/debbugs'; +$lib_path = '/usr/lib/debbugs'; require "$config_path/config"; require "$lib_path/errorlib"; @@ -962,10 +962,12 @@ sub addmaintainers { for $p (split(m/[ \t?,()]+/,$_[0])) { $p =~ y/A-Z/a-z/; $pshow= ($p =~ m/[-+.a-z0-9]+/ ? $& : ''); - if (defined($pkgsrc{$p})) { - push @bcc, "$pkgsrc{$p}\@packages.qa.debian.org"; - } else { - push @bcc, "$p\@packages.qa.debian.org"; + if (defined $gSubscriptionDomain) { + if (defined($pkgsrc{$p})) { + push @bcc, "$pkgsrc{$p}\@$gSubscriptionDomain"; + } else { + push @bcc, "$p\@$gSubscriptionDomain"; + } } if (defined($maintainerof{$p})) { $addmaint= $maintainerof{$p}; diff --git a/scripts/summary.in b/scripts/summary.in index bac741f3..29e607dd 100755 --- a/scripts/summary.in +++ b/scripts/summary.in @@ -1,8 +1,8 @@ #!/usr/bin/perl -# $Id: summary.in,v 1.5 2001/08/19 02:09:18 doogie Exp $ +# $Id: summary.in,v 1.6 2002/11/17 22:45:16 cjwatson Exp $ -$config_path = '/org/bugs.debian.org/etc'; -$lib_path = '/org/bugs.debian.org/scripts'; +$config_path = '/etc/debbugs'; +$lib_path = '/usr/lib/debbugs'; require("$config_path/config"); require("$lib_path/errorlib"); -- 2.39.5