From: Don Armstrong Date: Fri, 9 Mar 2018 00:27:11 +0000 (-0800) Subject: Merge branch 'text_xslate_templates' X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=757b392b853d7bc16592b9431d5275ca943684e4;hp=4baf4cb97f558ec9ad524c891dc4e0790dbfded2;p=debbugs.git Merge branch 'text_xslate_templates' --- diff --git a/.bzrignore b/.bzrignore deleted file mode 100644 index 0b9634c..0000000 --- a/.bzrignore +++ /dev/null @@ -1,4 +0,0 @@ -Makefile.perl -Makefile.perl.old -build-stamp -install-stamp diff --git a/.travis.yml b/.travis.yml index 0fd2461..b6f1be8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,15 +2,9 @@ dist: trusty sudo: required before_install: - sudo apt-get -qq update - - > - sudo apt-get install -y libparams-validate-perl - libmailtools-perl libmime-tools-perl libio-stringy-perl - libmldbm-perl liburi-perl libsoap-lite-perl libcgi-simple-perl - libhttp-server-simple-perl libtest-www-mechanize-perl - libmail-rfc822-address-perl libsafe-hole-perl libuser-perl - libconfig-simple-perl libtest-pod-perl - liblist-allutils-perl libtext-template-perl graphviz - libfile-libmagic-perl libgravatar-url-perl libwww-perl imagemagick + - sudo apt-get install -y devscripts equivs + - dch -r -m '' + - mk-build-deps -s sudo -i debian/control script: - make; make test notifications: diff --git a/Debbugs/Control.pm b/Debbugs/Control.pm index 02bb07e..1f8b3aa 100644 --- a/Debbugs/Control.pm +++ b/Debbugs/Control.pm @@ -364,7 +364,7 @@ sub set_blocks { next if $ok_blockers{$blocker} or $bad_blockers{$blocker}; my $data = read_bug(bug=>$blocker, ); - if (defined $data and not $data->{archive}) { + if (defined $data and not $data->{archived}) { $data = split_status_fields($data); $ok_blockers{$blocker} = 1; my @merged_bugs; @@ -380,8 +380,8 @@ sub set_blocks { # blocker if (keys %bad_blockers and $mode eq 'set') { __end_control(%info); - croak "Unknown blocking bug(s):".join(', ',keys %bad_blockers). - keys %ok_blockers?'':" and no known blocking bug(s)"; + croak "Unknown/archived blocking bug(s):".join(', ',keys %bad_blockers). + keys %ok_blockers?'':" and no good blocking bug(s)"; } # if there are no ok blockers and we are not setting the blockers, # there's an error. @@ -389,7 +389,7 @@ sub set_blocks { print {$transcript} "No valid blocking bug(s) given; not doing anything\n"; if (keys %bad_blockers) { __end_control(%info); - croak "Unknown blocking bug(s):".join(', ',keys %bad_blockers); + croak "Unknown/archived blocking bug(s):".join(', ',keys %bad_blockers); } __end_control(%info); return; @@ -2791,7 +2791,8 @@ sub _summary { \#|reopen|close|(?:not|)(?:fixed|found)|clone| debug|(?:not|)forwarded|priority| (?:un|)block|limit|(?:un|)archive| - reassign|retitle|affects|wrongpackage + reassign|retitle|affects|package| + outlook| (?:un|force|)merge|user(?:category|tags?|) )\s+\S}xis) { if (not length $paragraph) { @@ -3245,6 +3246,15 @@ sub bug_unarchive { my @bugs = @{$info{bugs}}; my $action = "$config{bug} unarchived."; my @files_to_remove; + ## error out if we're unarchiving unarchived bugs + for my $data (@{$info{data}}) { + if (not defined $data->{archived} or + not $data->{archived} + ) { + __end_control(%info); + croak("Bug $data->{bug_num} was not archived; not unarchiving it."); + } + } for my $bug (@bugs) { print {$debug} "$param{bug} removing $bug\n"; my $dir = get_hashname($bug); diff --git a/Debbugs/SOAP.pm b/Debbugs/SOAP.pm index 9ed0249..a0c3cbf 100644 --- a/Debbugs/SOAP.pm +++ b/Debbugs/SOAP.pm @@ -127,6 +127,7 @@ sub get_status { @bugs = @{$bugs[0]}; } my %status; + my %binary_to_source_cache; for my $bug (@bugs) { my $bug_status; if (ref($bug)) { @@ -134,11 +135,14 @@ sub get_status { next unless defined $param{bug}; $bug = $param{bug}; $bug_status = get_bug_status(map {(exists $param{$_})?($_,$param{$_}):()} - qw(bug dist arch bugusertags sourceversions version indicatesource) + qw(bug dist arch bugusertags sourceversions version indicatesource), + binary_to_source_cache => \%binary_to_source_cache, ); } else { - $bug_status = get_bug_status(bug => $bug); + $bug_status = get_bug_status(bug => $bug, + binary_to_source_cache => \%binary_to_source_cache, + ); } if (defined $bug_status and keys %{$bug_status} > 0) { $status{$bug} = $bug_status; diff --git a/Debbugs/UTF8.pm b/Debbugs/UTF8.pm index 999fc8a..01351f3 100644 --- a/Debbugs/UTF8.pm +++ b/Debbugs/UTF8.pm @@ -154,6 +154,10 @@ sub convert_to_utf8 { if ($charset eq 'RAW') { croak("Charset must not be raw when calling convert_to_utf8"); } + ## if the charset is unknown or unknown 8 bit, assume that it's UTF-8. + if ($charset =~ /unknown/i) { + $charset = 'UTF-8' + } my $iconv_converter; eval { $iconv_converter = Text::Iconv->new($charset,"UTF-8") or diff --git a/Makefile b/Makefile index 8114d0b..a279aeb 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,6 @@ sbin_dir := $(DESTDIR)/usr/sbin etc_dir := $(DESTDIR)/etc/debbugs var_dir := $(DESTDIR)/var/lib/debbugs scripts_dir := $(DESTDIR)/usr/lib/debbugs -perl_dir := $(DESTDIR)/usr/share/perl5/Debbugs doc_dir := $(DESTDIR)/usr/share/doc/debbugs templates_dir := $(DESTDIR)/usr/share/debbugs/templates man_dir := $(DESTDIR)/usr/share/man @@ -14,11 +13,7 @@ examples_dir := $(doc_dir)/examples scripts_in = $(foreach script, $(filter-out scripts/config% scripts/errorlib scripts/text, $(wildcard scripts/*)),$(patsubst scripts/%,%,$(script))) htmls_in := $(wildcard html/*.html.in) -cgis := $(wildcard cgi/*.cgi cgi/*.pl) - -# We use the Makefile.PL to install these; not totally decided if we -# should switch entirely to this model. -#perls := $(shell find Debbugs -type f -iname '*.pm') +cgis := $(wildcard cgi/*.cgi) install_exec := install -m755 -p install_data := install -m644 -p @@ -32,6 +27,7 @@ all: build build: $(PERL) Makefile.PL $(MAKE) -f Makefile.perl + $(MAKE) -C html/logo test: LC_ALL=$(UTF8_LOCALE) $(PERL) -MTest::Harness -I. -e 'runtests(glob(q(t/*.t)))' @@ -49,7 +45,7 @@ clean: install: install_mostfiles # install basic debbugs documentation - $(install_data) COPYING UPGRADE README.md debian/README.mail $(doc_dir) + $(install_data) COPYING UPGRADE.md README.md debian/README.mail $(doc_dir) $(MAKE) -f Makefile.perl install DESTDIR=$(DESTDIR) install_mostfiles: @@ -60,12 +56,6 @@ $(var_dir)/www/css \ $(var_dir)/spool/lock $(var_dir)/spool/archive $(var_dir)/spool/incoming \ $(var_dir)/spool/db-h $(scripts_dir) $(examples_dir) $(man8_dir); \ do test -d $$dir || $(install_exec) -d $$dir; done -# we shouldn't ship db-h spool directories - # make db-h spool dirs if they don't exist -# cd $(var_dir)/spool/db-h; \ -# for dir in $(shell seq -w 00 99); \ -# do test -d $$dir || $(install_exec) -d $$dir; done - # install the scripts $(foreach script,$(scripts_in), $(install_exec) scripts/$(script) $(scripts_dir);) @@ -84,15 +74,10 @@ $(var_dir)/spool/db-h $(scripts_dir) $(examples_dir) $(man8_dir); \ $(foreach html, $(htmls_in), $(install_data) $(html) $(etc_dir)/html;) $(install_data) html/htaccess $(var_dir)/www/db/.htaccess $(install_data) html/bugs.css $(var_dir)/www/css/bugs.css + $(install_data) html/logo/debbugs_logo_icon.png $(var_dir)/www/favicon.png # install the CGIs for cgi in $(cgis); do $(install_exec) $$cgi $(var_dir)/www/cgi; done - $(install_exec) cgi/bugs-fetch2.pl $(var_dir)/www/cgi/bugs-fetch2.pl - -# # install Perl modules -# for perl in $(perls); do $(install_data) $$perl $(perl_dir); done - # Make documentation for the perl modules - # install debbugsconfig $(install_exec) debian/debbugsconfig $(sbin_dir) diff --git a/UPGRADE b/UPGRADE deleted file mode 100644 index b4ab626..0000000 --- a/UPGRADE +++ /dev/null @@ -1,170 +0,0 @@ - - Debbugs upgrade notes - +=====================+ - -From 2.4.1 to 2.4.2 -------------------- - -The file format used to store the status of a bug (package, severity, etc.) -has changed; it is now in an RFC822-like format in order to be more -extensible, and is written to .summary files rather than the old .status -files. Before accepting any mail with the new version of debbugs, you must -run the 'debbugs-upgradestatus' program over your bug spool. The old .status -files will be left intact, and will continue to be written in sync with the -.summary files for compatibility with external tools. - -There is a new standalone spam-scanning script called spamscan, which uses -the SpamAssassin modules. To use it, set the $gSpamScan variable in -/etc/debbugs/config to a true value and $gSpamMailbox to an mbox file to -which detected spam should be appended, add /usr/lib/debbugs/spamscan to -your crontab as per the example, and optionally set $gSpamRulesDir and -$gSpamLocalTestsOnly as desired. - -From 2.4 to 2.4.1 ------------------ - -Add the following variables to the /etc/debbugs/config file: - -$gHTMLSuffix = ".html"; - -The use of $gCGIDomain has been cleaned up; formerly, it needed to begin -with "http://", which was confusingly inconsistent with all the other domain -variables. If you worked around this in your configuration, you will need to -recheck it. - -From 2.3 to 2.4 ---------------- - -Add the following variables to the /etc/debbugs/config file: - -$gWebHost = "localhost"; # e.g. www.debian.org -$gWebHostBugDir = "Bugs"; # e.g. Bugs -# For now, don't change this one manually! -$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). - -$gUnknownMaintainerEmail is the address to mail when a bug report arrives -for a package with no maintainer in $gMaintainerFile or -$gMaintainerFileOverride. - -$gPackageSource is a file containing three tab-separated columns: package -name, component (e.g. main, contrib, non-free), and the corresponding source -package name. - -Add the following variable to the /etc/debbugs/text file: - -############################################################################ -# Description of the tags -############################################################################ -$gHTMLTagDesc = " -
patch -
A patch or some other easy procedure for fixing the $gBug is included in - the $gBug logs. If there\'s a patch, but it doesn\'t resolve the $gBug - adequately or causes some other problems, this tag should not be used. - -
wontfix -
This $gBug won\'t be fixed. Possibly because this is a choice between two - arbitrary ways of doing things and the maintainer and submitter prefer - different ways of doing things, possibly because changing the behaviour - will cause other, worse, problems for others, or possibly for other - reasons. - -
moreinfo -
This $gBug can\'t be addressed until more information is provided by the - submitter. The $gBug will be closed if the submitter doesn\'t provide ore - information in a reasonable (few months) timeframe. This is for $gBugs like - \"It doesn\'t work\". What doesn\'t work? - -
unreproducible -
This $gBug can\'t be reproduced on the maintainer\'s system. Assistance - from third parties is needed in diagnosing the cause of the problem. - -
fixed -
This $gBug is fixed or worked around, but there\'s still an issue that - needs to be resolved. (This will eventually replace the \"fixed\" severity) - -
stable -
This $gBug affects the stable distribution in particular. This is only - intended to be used for ease in identifying release critical $gBugs that - affect the stable distribution. It\'ll be replaced eventually with - something a little more flexible, probably. -"; - -The bug database is now stored in a hashed directory format (db-h). You -will need to migrate your database to this new format. The -/usr/sbin/debbugs-dbhash program is provided to help you perform this -migration. - -From 2.2 to 2.3 ---------------- - -There are three new scripts that have to be installed in CGI and the front -page (or any other search you have set up) needs to be changed to use these -scripts. They are: - * bugreport.cgi - * common.pl - * pkgreport.cgi - -Add the following variables to the /etc/debbugs/config file: -(the /usr/share/doc/debbugs/examples/config file can be used as a -reference) - -$gSummaryList = "summary.list"; #debian-bugs-report@lists -$gSaveOldBugs = 1; - -Make sure you do not have a double ,, as shown here if you're using the -default severities. Also, 'fixed' was added to the default severities: -- 'normal',"Normal $gBugs",, -+ 'normal',"Normal $gBugs", -+ 'fixed',"NMU Fixed $gBugs", - -These have been added to the /etc/debbugs/text file: -+############################################################################ -+# Here is a blurb to point people to ftp archive of directions. It is -+# used by the receive script when bouncing a badly formatted email -+# -+# $gTextInstructions = "$gBadEmailPrefix -+# $gBadEmailPrefix Instructions are available from ftp.debian.org in /debian -+# $gBadEmailPrefix and at all Debian mirror sites, in the files: -+# $gBadEmailPrefix doc/bug-reporting.txt -+# $gBadEmailPrefix doc/bug-log-access.txt -+# $gBadEmailPrefix doc/bug-maint-info.txt -+# $gBadEmailPrefix"; -+############################################################################ -+$gTextInstructions = "$gBadEmailPrefix"; -+ -+ - -$gHTMLStart = ""; #this is used by HTML generation to create the "uniform look" - -The following code was added to /etc/debbugs/text if you use the new fixed -severity - -
wishlist --
for any feature request, and also for any $gBugs that are very difficult -- to fix due to major design considerations."; -+
for any feature request, and also for any $gBugs that are very -+ difficult to fix due to major design considerations."; -+ -+
fixed -+
fixed in the current version in the unstable archive but the fix has -+ not been fixed by the person responsible. - - In All such entries in /etc/debbugs/text, if you replace with - $gHTMLStart, all html pages will have the same look (as specified in - $gHTMLStart): - - $gSummaryIndex = "$gProject $gBug report logs - summary index - $gPackageLog = "$gProject $gBug report logs - index by package diff --git a/UPGRADE.md b/UPGRADE.md new file mode 100644 index 0000000..62a7bd4 --- /dev/null +++ b/UPGRADE.md @@ -0,0 +1,184 @@ +# Debbugs upgrade notes # + +## From 2.4.2 to 2.6 ## + +Debbugs configuration file now sets default values for all configuration file +options, so if you're upgrading from earlier versions, you do not need to +specify values for the new configuration files. + +### Templates ### + +Debbugs now uses Text::Template for templates, and any of the existing templates +can be overridden by creating a new directory and setting `$gTemplateDir` to the +new directory. + +## From 2.4.1 to 2.4.2 ## + +The file format used to store the status of a bug (package, severity, etc.) +has changed; it is now in an RFC822-like format in order to be more +extensible, and is written to .summary files rather than the old .status +files. Before accepting any mail with the new version of debbugs, you must +run the 'debbugs-upgradestatus' program over your bug spool. The old .status +files will be left intact, and will continue to be written in sync with the +.summary files for compatibility with external tools. + +There is a new standalone spam-scanning script called spamscan, which uses +the SpamAssassin modules. To use it, set the `$gSpamScan` variable in +`/etc/debbugs/config` to a true value and `$gSpamMailbox` to an mbox file to +which detected spam should be appended, add /usr/lib/debbugs/spamscan to +your crontab as per the example, and optionally set `$gSpamRulesDir` and +`$gSpamLocalTestsOnly` as desired. + +## From 2.4 to 2.4.1 ## + +Add the following variables to the /etc/debbugs/config file: + +`$gHTMLSuffix = ".html";` + +The use of `$gCGIDomain` has been cleaned up; formerly, it needed to begin +with "http://", which was confusingly inconsistent with all the other domain +variables. If you worked around this in your configuration, you will need to +recheck it. + +## From 2.3 to 2.4 ## + +Add the following variables to the /etc/debbugs/config file: + +```perl +$gWebHost = "localhost"; # e.g. www.debian.org +$gWebHostBugDir = "Bugs"; # e.g. Bugs +# For now, don't change this one manually! +$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). + +`$gUnknownMaintainerEmail` is the address to mail when a bug report arrives +for a package with no maintainer in `$gMaintainerFile` or +`$gMaintainerFileOverride`. + +`$gPackageSource` is a file containing three tab-separated columns: package +name, component (e.g. main, contrib, non-free), and the corresponding source +package name. + +Add the following variable to the `/etc/debbugs/text` file: + +``` +############################################################################ +# Description of the tags +############################################################################ +`$gHTMLTagDesc = " +
patch +
A patch or some other easy procedure for fixing the `$gBug is included in + the `$gBug logs. If there\'s a patch, but it doesn\'t resolve the `$gBug + adequately or causes some other problems, this tag should not be used. + +
wontfix +
This `$gBug won\'t be fixed. Possibly because this is a choice between two + arbitrary ways of doing things and the maintainer and submitter prefer + different ways of doing things, possibly because changing the behaviour + will cause other, worse, problems for others, or possibly for other + reasons. + +
moreinfo +
This `$gBug can\'t be addressed until more information is provided by the + submitter. The `$gBug will be closed if the submitter doesn\'t provide ore + information in a reasonable (few months) timeframe. This is for `$gBugs like + \"It doesn\'t work\". What doesn\'t work? + +
unreproducible +
This `$gBug can\'t be reproduced on the maintainer\'s system. Assistance + from third parties is needed in diagnosing the cause of the problem. + +
fixed +
This `$gBug is fixed or worked around, but there\'s still an issue that + needs to be resolved. (This will eventually replace the \"fixed\" severity) + +
stable +
This `$gBug affects the stable distribution in particular. This is only + intended to be used for ease in identifying release critical `$gBugs that + affect the stable distribution. It\'ll be replaced eventually with + something a little more flexible, probably. +"; +``` + +The bug database is now stored in a hashed directory format (db-h). You +will need to migrate your database to this new format. The +`/usr/sbin/debbugs-dbhash` program is provided to help you perform this +migration. + +## From 2.2 to 2.3 ## + +There are three new scripts that have to be installed in CGI and the front +page (or any other search you have set up) needs to be changed to use these +scripts. They are: + * bugreport.cgi + * common.pl + * pkgreport.cgi + +Add the following variables to the /etc/debbugs/config file: +(the /usr/share/doc/debbugs/examples/config file can be used as a +reference) + +```perl +`$gSummaryList = "summary.list"; #debian-bugs-report@lists +`$gSaveOldBugs = 1; +``` + +Make sure you do not have a double ,, as shown here if you're using the +default severities. Also, 'fixed' was added to the default severities: +- 'normal',"Normal `$gBugs",, ++ 'normal',"Normal `$gBugs", ++ 'fixed',"NMU Fixed $gBugs", + +These have been added to the /etc/debbugs/text file: +``` ++############################################################################ ++# Here is a blurb to point people to ftp archive of directions. It is ++# used by the receive script when bouncing a badly formatted email ++# ++# $gTextInstructions = "$gBadEmailPrefix ++# $gBadEmailPrefix Instructions are available from ftp.debian.org in /debian ++# $gBadEmailPrefix and at all Debian mirror sites, in the files: ++# $gBadEmailPrefix doc/bug-reporting.txt ++# $gBadEmailPrefix doc/bug-log-access.txt ++# $gBadEmailPrefix doc/bug-maint-info.txt ++# $gBadEmailPrefix"; ++############################################################################ ++$gTextInstructions = "$gBadEmailPrefix"; ++ ++ +``` + +`$gHTMLStart = ""; #this is used by HTML generation to create the "uniform look"` + +The following code was added to /etc/debbugs/text if you use the new fixed +severity +``` +
wishlist +-
for any feature request, and also for any $gBugs that are very difficult +- to fix due to major design considerations."; ++
for any feature request, and also for any $gBugs that are very ++ difficult to fix due to major design considerations."; ++ ++
fixed ++
fixed in the current version in the unstable archive but the fix has ++ not been fixed by the person responsible. +``` + In All such entries in /etc/debbugs/text, if you replace with + `$gHTMLStart`, all html pages will have the same look (as specified in + `$gHTMLStart`): + + `$gSummaryIndex = "$gProject $gBug report logs - summary index` + `$gPackageLog = "$gProject $gBug report logs - index by package` diff --git a/bin/debbugs-spam b/bin/debbugs-spam index b172e97..09077e0 100755 --- a/bin/debbugs-spam +++ b/bin/debbugs-spam @@ -78,11 +78,25 @@ id Mark messages as ham if there is a regex match to subject or message id +=item B + +Learn from messages which are ham/spam + =back =head1 EXAMPLES +Start spamd: + + /usr/sbin/spamd --socketpath=/home/debbugs/spamd_socket \ + --nouser-config --cf='include /home/debbugs/.spamassassin/user_prefs' \ + --cf='allow_user_rules 1' --allow-tell; + +Then score bugs: + + debbugs-spam --spamc-opts '-U' --spamc-opts '/home/debbugs/spamd_socket' \ + score 859123; =cut @@ -130,6 +144,8 @@ my %subcommands = }, 'mark-ham' => {function => \&mark_ham, }, + 'learn' => {function => \&learn, + }, 'help' => {function => sub {pod2usage({verbose => 2});}} ); @@ -186,10 +202,10 @@ sub mark_it { my $body = $rec->{text}; my ($subject) = $body =~ /^Subject: *(.+)$/mi; my $is_match = 0; - if ($subject =~ /\Q$regex\E/) { + if ($subject =~ /$regex/) { $is_match = 1; } - if ($mid =~ /\Q$regex\E/) { + if ($mid =~ /$regex/) { $is_match = 1; } if ($is_match) { @@ -207,6 +223,40 @@ sub mark_it { } } +sub learn { + my ($options,$opts,$config,$argv) = @_; + for my $bug_num (@{$argv}) { + my $spam = Debbugs::Log::Spam->new(bug_num => $bug_num) or + die "Unable to open bug log spam for $bug_num"; + foreachmsg(sub { + my ($bn,$rec,$mid) = @_; + my $score; + if ($spam->is_spam($mid)) { + $score //= + spam_score($rec,$options->{spamc}, + [@{$options->{spamc_opts}}, + '-L','spam' + ] + ); + print STDERR "learning spam" if $DEBUG; + } elsif ($spam->is_ham($mid)) { + $score //= + spam_score($rec,$options->{spamc}, + [@{$options->{spamc_opts}}, + '-L','ham' + ] + ); + print STDERR "learning ham" if $DEBUG; + } else { + print STDERR "not learning" if $DEBUG; + } + print STDERR " from $mid" if $DEBUG; + }, + $bug_num + ); + } +} + sub score_bug { my ($options,$opts,$config,$argv) = @_; @@ -298,6 +348,9 @@ sub spam_score { my ($score,$threshold,$report); my $is_spam = 0; eval { + $report = ''; + $score = 0; + $threshold = 5; my ($spamc_in,$spamc_out); my $old_sig = $SIG{"PIPE"}; $SIG{"PIPE"} = sub { @@ -305,7 +358,7 @@ sub spam_score { }; my $childpid = open3($spamc_in,$spamc_out,0, - $spamc,'-E',@{$spamc_opts}) or + $spamc,'-E','--headers',@{$spamc_opts}) or die "Unable to fork spamc: $!"; if (not $childpid) { die "Unable to fork spamc"; @@ -313,19 +366,24 @@ sub spam_score { print {$spamc_in} $record->{text}; close($spamc_in) or die "Unable to close spamc_in: $!"; waitpid($childpid,0); - if ($? >> 8) { + my $exit_code = $? >> 8; + if ($exit_code) { $is_spam = 1; } - my ($first_line,@report) = <$spamc_out>; - if ($DEBUG) { - print STDERR "[$?;".($? >> 8)."] "; - print STDERR $first_line,@report; - print STDERR " "; + while (<$spamc_out>) { + if (/^X-Spam/) { + $report .= $_; + if (/^X-Spam-Status: (Yes|No), score=(-?[\d\.]+) required=(-?[\d\.]+)/) { + $threshold = $3; + $score = $2; + } + } + if (/^\s*$/) { + last; + } } - if (defined $first_line) { - chomp $first_line; - ($score,$threshold) = $first_line =~ m{^(-?[\d\.]+)/(-?[\d\.]+)$}; - $report = join('',@report); + if ($DEBUG) { + print STDERR "[$exit_code] [$score/$threshold]\n$report\n"; } close($spamc_out); $SIG{"PIPE"} = $old_sig; diff --git a/debian/changelog b/debian/changelog index 730a71c..edc361b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -debbugs (2.6.0~exp1) UNRELEASED; urgency=low +debbugs (2.6.0~exp1) unstable; urgency=medium [ Don Armstrong ] * Hack around elinks css bug (closes: #593804) @@ -63,6 +63,13 @@ debbugs (2.6.0~exp1) UNRELEASED; urgency=low #871784) Thanks to Ridier 'OdyX' Raboud * Use foo instead of bar@baz.com (foo) for From: (Closes: #881903). Thanks to Michael Stapelberg. + * Add rel="canonical" links to bug pages (Closes: #890338). Thanks to Chris + Lamb. + * Fix blocks/blockedby of archived bugs (Closes: #892060). Thanks to Laurent Bigonville. + * Provide informative error message when unarchive fails because the bug is + not archived. (Closes: #892135). Thanks to Dan Jacobson. + * Update standards version to 4.1.3; add Testsuite, fix Homepage and git repos + links, update priority. [ Niels Thykier ] * quitcgi() now returns 400/500 status codes instead of 200 (Closes: #584922) @@ -125,7 +132,7 @@ debbugs (2.6.0~exp1) UNRELEASED; urgency=low * Fix broken link in changed forwarded-to address (closes: #782740) * Fix package links in reassigned message (closes: #767327) - -- + -- Don Armstrong Mon, 26 Feb 2018 11:31:48 -0800 debbugs (2.4.2~exp1) experimental; urgency=low diff --git a/debian/control b/debian/control index 8bac723..34e186c 100644 --- a/debian/control +++ b/debian/control @@ -1,11 +1,11 @@ Source: debbugs Section: misc -Priority: extra +Priority: optional Maintainer: Debbugs developers Uploaders: Colin Watson , Don Armstrong -Standards-Version: 3.9.4 -Vcs-Browser: http://bugs.debian.org/debbugs-source/mainline -Vcs-Git: http://bugs.debian.org/debbugs-source/debbugs.git +Standards-Version: 4.1.3 +Vcs-Browser: https://salsa.debian.org/debbugs-team/debbugs +Vcs-Git: https://salsa.debian.org/debbugs-team/debbugs.git Build-Depends: debhelper (>= 9) Build-Depends-Indep: libparams-validate-perl, libmailtools-perl, libmime-tools-perl, libio-stringy-perl, libmldbm-perl, @@ -15,8 +15,11 @@ Build-Depends-Indep: libparams-validate-perl, libconfig-simple-perl, libtest-pod-perl, liblist-allutils-perl, # used by Debbugs::Libravatar and libravatar.cgi libfile-libmagic-perl, libgravatar-url-perl, libwww-perl, imagemagick, - libtext-xslate-perl, graphviz, libtext-iconv-perl, libnet-server-perl -Homepage: http://wiki.debian.org/Teams/Debbugs + libtext-xslate-perl, graphviz, libtext-iconv-perl, libnet-server-perl, +# used to make the logo + inkscape +Homepage: https://salsa.debian.org/debbugs-team +Testsuite: autopkgtest-pkg-perl Package: debbugs Architecture: all diff --git a/debian/copyright b/debian/copyright index 7ba7507..56f304b 100644 --- a/debian/copyright +++ b/debian/copyright @@ -14,7 +14,7 @@ Former developers have been: Darren Benham The sources can be obtained by: - bzr get http://bugs.debian.org/debbugs-source/mainline + git clone https://salsa.debian.org/debbugs-team/debbugs.git Copyright 1994-1997 Ian Jackson Copyright 1997,2003 nCipher Corporation Limited diff --git a/future_directions b/future_directions deleted file mode 100644 index 2aad806..0000000 --- a/future_directions +++ /dev/null @@ -1,49 +0,0 @@ -Here are outlined some of the future directions for the debbugs -codebase and things that should be done. - -PACKAGE CLEANUP - -* Stop doing the .in -> foo translation - - We no longer do this -* Use ExtUtils::Makemaker instead of a custom makefile - - We use Makemaker for the easy perl bits -* More testing of modules so it's not so easy to break things - - -GENERAL ORGANIZATIONAL CLEANUP - -* Modularization - * use of strict and warnings everywhere - * Split out errorlib and common.pl; stop requiring stuff - * Use CGI::Simple, URI, and Params::Validate instead of our own - versions - -* Configuration Module - * Allow for multiple debbugs configurations; easy overriding of values - * Possibly implemented using Config::General (maybe Config::Simple?) - with hack to allow for backwards compatibility - - The backwards compatibility hack is now fully implemented, a - decision on a configuration system just needs to be made. - -* Separation of Output forms from the code - * Use Text::Template to do this; it's simple, we don't lose - flexibility if we need it - -* Bring back all of the helper scripts into the bzr repository and - document the setup of Debian's bts - -FEATURES - -* Full text searching -- using Hyper Estraier (in progress on merkel) - * See Debbugs::Estraier - -* CGI Options enable/disable forms - -* Better display of bugs in bug lists - - Display subsidiary bugs: merged bugs, block bugs, etc. - -* Archiving [display of applicable bugs even if they are archived] - -BUG FIXING - -* ... \ No newline at end of file diff --git a/html/logo/.gitignore b/html/logo/.gitignore new file mode 100644 index 0000000..5cde14c --- /dev/null +++ b/html/logo/.gitignore @@ -0,0 +1 @@ +debbugs_logo_icon.png diff --git a/html/logo/Makefile b/html/logo/Makefile new file mode 100644 index 0000000..82ceaab --- /dev/null +++ b/html/logo/Makefile @@ -0,0 +1,16 @@ +#!/usr/bin/make -f + +all: debbugs_logo.svg debbugs_logo_icon.png + +## if you want to modify debbugs_logo.svg do the modifications to +## debbugs_logo_orig.svg, and then run make update_debbugs_logo and check the +## changes in. +update_debbugs_logo: debbugs_logo_orig.svg + inkscape --without-gui \ + --export-text-to-path --export-plain-svg debbugs_logo.svg $<; + +debbugs_logo_icon.png: debbugs_logo.svg + inkscape --without-gui \ + --export-width 32 --export-height 32 \ + --export-background=white \ + --export-png $@ $< diff --git a/html/logo/debbugs_logo.svg b/html/logo/debbugs_logo.svg new file mode 100644 index 0000000..022165a --- /dev/null +++ b/html/logo/debbugs_logo.svg @@ -0,0 +1,161 @@ + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/html/logo/debbugs_logo_orig.svg b/html/logo/debbugs_logo_orig.svg new file mode 100644 index 0000000..4b34e9e --- /dev/null +++ b/html/logo/debbugs_logo_orig.svg @@ -0,0 +1,175 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + Debbugs + 🐜🐛🐞 + + + diff --git a/templates/en_US/cgi/bugreport.tx b/templates/en_US/cgi/bugreport.tx index 21f7c4e..67f9c5e 100644 --- a/templates/en_US/cgi/bugreport.tx +++ b/templates/en_US/cgi/bugreport.tx @@ -1,4 +1,5 @@ <: include "html/pre_title.tx" :>#<: $bug_num :> - <: $status.subject :> - <: $config.project :> <: $config.bug :> report logs<: include "html/post_title.tx" :> +