]> git.donarmstrong.com Git - debbugs.git/commitdiff
Don't make the logo; it's checked into git and isn't necessary master
authorDon Armstrong <don@donarmstrong.com>
Mon, 20 May 2024 03:59:10 +0000 (20:59 -0700)
committerDon Armstrong <don@donarmstrong.com>
Mon, 20 May 2024 03:59:10 +0000 (20:59 -0700)
Makefile
debian/changelog
debian/control
debian/docs
debian/salsa-ci.yml [new file with mode: 0644]
lib/Debbugs/MIME.pm
lib/Debbugs/Status.pm
scripts/process
t/01_mime.t
t/12_merge.t

index b3e46a6be7e1e88601d7ab3f56aba13ba981b099..5872d2fcab69ed040c59dffe892ca5352d99576d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -27,7 +27,8 @@ all: build
 build:
        $(PERL) Makefile.PL
        $(MAKE) -f Makefile.perl
 build:
        $(PERL) Makefile.PL
        $(MAKE) -f Makefile.perl
-       $(MAKE) -C html/logo
+# Don't bother to make the logo; it's not necessary
+#       $(MAKE) -C html/logo
 
 test:
        LC_ALL=$(UTF8_LOCALE) $(PERL) -MTest::Harness -Ilib -e 'runtests(glob(q(t/*.t)))'
 
 test:
        LC_ALL=$(UTF8_LOCALE) $(PERL) -MTest::Harness -Ilib -e 'runtests(glob(q(t/*.t)))'
index 60dfa6c721688d6b8c7226eb9a7c506008f773b9..a63920229df15ae337b89fe7ec60a2ad751b9537 100644 (file)
@@ -6,6 +6,8 @@ debbugs (3.0.0~alpha.1) unstable; urgency=medium
   * Fix unescaped From (closes: #983847)
   * Actually return message/rfc822 when there is a single message instead
     of mbox (closes: #1009181)
   * Fix unescaped From (closes: #983847)
   * Actually return message/rfc822 when there is a single message instead
     of mbox (closes: #1009181)
+  * Fix missing escaping of comma in address fields (closes: #1041638)
+  * Sort blocked-by (closes: 751808), thanks to Tim Landscheidt.
 
  -- Don Armstrong <don@debian.org>  Fri, 09 Mar 2018 11:17:10 -0800
 
 
  -- Don Armstrong <don@debian.org>  Fri, 09 Mar 2018 11:17:10 -0800
 
index 61bfceea5296393d47b03c1f027e3bc9f3c3fc43..a04a57503eaaa310ad44b0ab3a00bfbb898c62a1 100644 (file)
@@ -11,7 +11,7 @@ Build-Depends-Indep: 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,
  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, libuser-perl,
+ libmail-rfc822-address-perl, libuser-perl, libmail-message-perl,
  libconfig-simple-perl, libtest-pod-perl, liblist-allutils-perl,
  libfile-libmagic-perl, libgravatar-url-perl, libwww-perl, imagemagick,
  libdbix-class-perl, libdatetime-format-pg-perl, libtest-postgresql-perl,
  libconfig-simple-perl, libtest-pod-perl, liblist-allutils-perl,
  libfile-libmagic-perl, libgravatar-url-perl, libwww-perl, imagemagick,
  libdbix-class-perl, libdatetime-format-pg-perl, libtest-postgresql-perl,
@@ -21,7 +21,7 @@ Build-Depends-Indep: libparams-validate-perl,
  libdatetime-perl,
  libaliased-perl,
  postgresql,
  libdatetime-perl,
  libaliased-perl,
  postgresql,
- postgresql-9.6-debversion|postgresql-10-debversion|postgresql-11-debversion,
+ postgresql-13-debversion|postgresql-15-debversion|postgresql-16-debversion,
  libtext-xslate-perl, graphviz, libtext-iconv-perl, libnet-server-perl,
  libmouse-perl, libmousex-nativetraits-perl,
 # required for use strictures 2
  libtext-xslate-perl, graphviz, libtext-iconv-perl, libnet-server-perl,
  libmouse-perl, libmousex-nativetraits-perl,
 # required for use strictures 2
@@ -40,7 +40,7 @@ Depends:
  libdebbugs-perl
 Recommends: debbugs-web (>= 2.6~)
 Suggests: spamassassin (>= 3.0), libcgi-alert-perl, postgresql,
  libdebbugs-perl
 Recommends: debbugs-web (>= 2.6~)
 Suggests: spamassassin (>= 3.0), libcgi-alert-perl, postgresql,
- postgresql-9.6-debversion|postgresql-10-debversion|postgresql-11-debversion
+ postgresql-13-debversion|postgresql-15-debversion|postgresql-16-debversion
 Description: bug tracking system based on the active Debian BTS
  Debian has a bug tracking system which files details of bugs reported by
  users and developers. Each bug is given a number, and is kept on file until
 Description: bug tracking system based on the active Debian BTS
  Debian has a bug tracking system which files details of bugs reported by
  users and developers. Each bug is given a number, and is kept on file until
@@ -62,8 +62,8 @@ Depends:
  graphviz, libtext-iconv-perl, libuser-perl,
  libmouse-perl, libmousex-nativetraits-perl,
 # used by Debbugs::Libravatar and libravatar.cgi
  graphviz, libtext-iconv-perl, libuser-perl,
  libmouse-perl, libmousex-nativetraits-perl,
 # used by Debbugs::Libravatar and libravatar.cgi
- libfile-libmagic-perl, libgravatar-url-perl, libwww-perl, imagemagick
- # used by the database
+ libfile-libmagic-perl, libgravatar-url-perl, libwww-perl, imagemagick,
+# used by the database
  libdbix-class-timestamp-perl,
  libdbix-class-deploymenthandler-perl,
  libdatetime-perl,
  libdbix-class-timestamp-perl,
  libdbix-class-deploymenthandler-perl,
  libdatetime-perl,
@@ -104,7 +104,8 @@ Depends:
  ${perl:Depends},
  ${misc:Depends},
  libdebbugs-perl, debbugs-web, libconfig-simple-perl,
  ${perl:Depends},
  ${misc:Depends},
  libdebbugs-perl, debbugs-web, libconfig-simple-perl,
- libuser-perl, rsync, libhttp-server-simple-perl, libnet-server-perl
+ libuser-perl, rsync, libhttp-server-simple-perl, libnet-server-perl,
+ sensible-utils
 Description: Run and maintains a local mirror of the Debian BTS
  Debian has a bug tracking system which files details of bugs reported
  by users and developers. Each bug is given a number, and is kept on
 Description: Run and maintains a local mirror of the Debian BTS
  Debian has a bug tracking system which files details of bugs reported
  by users and developers. Each bug is given a number, and is kept on
index ef44632c487c7121c0424caa6041345436d25f31..64e62ee23a3905fc6ea5b90e856940d90a221088 100644 (file)
@@ -1 +1 @@
-UPGRADE debian/README.mail
+UPGRADE.md debian/README.mail
diff --git a/debian/salsa-ci.yml b/debian/salsa-ci.yml
new file mode 100644 (file)
index 0000000..60fbec3
--- /dev/null
@@ -0,0 +1,18 @@
+---
+include:
+  - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml
+  - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml
+
+# If Salsa-CI is not running at
+# https://salsa.debian.org/%{project_path}/-/pipelines, ensure that
+# https://salsa.debian.org/%{project_path}/-/settings/ci_cd has in field "CI/CD
+# configuration file" filename "debian/salsa-ci.yml"
+
+# The package does not have any debian/tests and thus autopkgtest will run
+# autodep8-perl which does not pass, and will need some work before enabled:
+#   autodep8-perl-build-deps FAIL non-zero exit status 253
+#   autodep8-perl        PASS (superficial)
+#   autodep8-perl-recommends FAIL non-zero exit status 1
+autopkgtest:
+  extends: .test-autopkgtest
+  allow_failure: true
index fec3b6e2dc4e1dd43d8d31c020c27343407d0e30..579f3329ffd73ee27598b6d806e41bc8a8bdad1e 100644 (file)
@@ -44,7 +44,7 @@ BEGIN {
     %EXPORT_TAGS = (mime => [qw(parse create_mime_message getmailbody),
                             qw(parse_to_mime_entity),
                            ],
     %EXPORT_TAGS = (mime => [qw(parse create_mime_message getmailbody),
                             qw(parse_to_mime_entity),
                            ],
-                   rfc1522 => [qw(decode_rfc1522 encode_rfc1522)],
+                   rfc1522 => [qw(decode_rfc1522 encode_rfc1522 handle_escaped_commas)],
                   );
     @EXPORT_OK=();
     Exporter::export_ok_tags(keys %EXPORT_TAGS);
                   );
     @EXPORT_OK=();
     Exporter::export_ok_tags(keys %EXPORT_TAGS);
@@ -54,6 +54,7 @@ BEGIN {
 use File::Path qw(remove_tree);
 use File::Temp qw(tempdir);
 use MIME::Parser;
 use File::Path qw(remove_tree);
 use File::Temp qw(tempdir);
 use MIME::Parser;
+use Mail::Message::Field;
 
 use POSIX qw(strftime);
 use List::AllUtils qw(apply);
 
 use POSIX qw(strftime);
 use List::AllUtils qw(apply);
@@ -396,4 +397,36 @@ sub encode_rfc1522 {
      return $string;
 }
 
      return $string;
 }
 
+=head2
+
+    $header = handle_escaped_commas('','From: ')
+
+Handle commas in addresses which have been RFC1522 escaped and now need to be
+quoted to avoid parsing as a record separator.
+
+=cut
+
+sub handle_escaped_commas {
+    my ($modified_hdr, $orig_hdr) = @_;
+
+    my $field = Mail::Message::Field->new($orig_hdr);
+    # if the header isn't structured, it can't contain an address
+    if (not $field->isStructured()) {
+       return $modified_hdr
+    }
+    if ($field->name() !~ m/^(?:to|from|reply-to)$/) {
+       return $modified_hdr
+    }
+    my @addresses = $field->addresses();
+    if (not @addresses) {
+       return $modified_hdr
+    }
+    my @return_addresses;
+    for my $address (@addresses) {
+       $address->phrase(decode_rfc1522($address->phrase()));
+       push @return_addresses, $address->format();
+    }
+    return join(', ',@return_addresses)
+}
+
 1;
 1;
index f539781495c297c64a54239823411da2a0c328b1..dcc83b19b296206604255a3aa2e635a88dd3a745 100644 (file)
@@ -299,6 +299,17 @@ sub read_bug{
     $data{archived} = (defined($location) and ($location eq 'archive'))?1:0;
     $data{bug_num} = $param{bug};
 
     $data{archived} = (defined($location) and ($location eq 'archive'))?1:0;
     $data{bug_num} = $param{bug};
 
+    # Sort blockedby numerically so that bugs with identical blockers have
+    # identical lists.
+    if (defined $data{blockedby} and
+       $data{blockedby}) {
+       $data{blockedby} =
+           join(' ',
+                 sort { $a <=> $b }
+                split / /, $data{blockedby}
+               );
+    }
+
     # mergedwith occasionally is sorted badly. Fix it to always be sorted by <=>
     # and not include this bug
     if (defined $data{mergedwith} and
     # mergedwith occasionally is sorted badly. Fix it to always be sorted by <=>
     # and not include this bug
     if (defined $data{mergedwith} and
index 4e4d97afbe816f002b0adb941aa2282733221ccd..831099867c0dce57e5f60932c4c5b86c70500564 100755 (executable)
@@ -184,7 +184,7 @@ for my $hdr (@headerlines) {
                         mail-followup-to|
                         references):
                 |From\s|X-Debbugs-)/xi;
                         mail-followup-to|
                         references):
                 |From\s|X-Debbugs-)/xi;
-    $fwd .= encode_utf8($hdr)."\n" if $ins;
+    $fwd .= $orig_hdr."\n" if $ins;
     # print {$debugfh} ">$_<\n";
     if (s/^(\S+):\s*//) {
        my $v = lc $1;
     # print {$debugfh} ">$_<\n";
     if (s/^(\S+):\s*//) {
        my $v = lc $1;
@@ -192,7 +192,13 @@ for my $hdr (@headerlines) {
            push @common_headers, 'X-Loop',$_;
        }
        print {$debugfh} ">$v=$_<\n";
            push @common_headers, 'X-Loop',$_;
        }
        print {$debugfh} ">$v=$_<\n";
-       $header{$v} = $_;
+       # Handle a comma which is escaped being passed through un-escaped. See
+       # https://bugs.debian.org/1041638
+       if ($_ =~ m/,/ and not $orig_hdr =~ m/,/) {
+           $header{$v} = handle_escaped_commas($_,$orig_hdr);
+       } else {
+           $header{$v} = $_;
+       }
     } else {
        print {$debugfh} "!>$_<\n";
     }
     } else {
        print {$debugfh} "!>$_<\n";
     }
@@ -718,7 +724,7 @@ if ($ref<0) { # new bug report
                                             );
             }
         }
                                             );
             }
         }
-        if ($name eq 'usertags'){
+        if ($name eq 'usertags' and defined $current_user){
             my %user_tags;
             read_usertags(\%user_tags, $current_user);
             $value =~ s/(?:^\s+|\s+$)//g;
             my %user_tags;
             read_usertags(\%user_tags, $current_user);
             $value =~ s/(?:^\s+|\s+$)//g;
index dcd3b7608f869c41d6f1eed8d666d8ba55832393..ecad37ba6bb08b21d5845ea18534e5b713783d0d 100644 (file)
@@ -1,7 +1,7 @@
 # -*- mode: cperl;-*-
 # $Id: 01_mime.t,v 1.1 2005/08/17 21:46:17 don Exp $
 
 # -*- mode: cperl;-*-
 # $Id: 01_mime.t,v 1.1 2005/08/17 21:46:17 don Exp $
 
-use Test::More tests => 6;
+use Test::More tests => 7;
 
 use warnings;
 use strict;
 
 use warnings;
 use strict;
@@ -36,7 +36,8 @@ ok(Debbugs::MIME::decode_rfc1522(Debbugs::MIME::encode_rfc1522(encode_utf8($test
   "encode_rfc1522 encodes strings that decode_rfc1522 can decode");
 ok(Debbugs::MIME::decode_rfc1522(Debbugs::MIME::encode_rfc1522(encode_utf8($test_str3))) eq $test_str3,
   "encode_rfc1522 properly handles parenthesis and \"");
   "encode_rfc1522 encodes strings that decode_rfc1522 can decode");
 ok(Debbugs::MIME::decode_rfc1522(Debbugs::MIME::encode_rfc1522(encode_utf8($test_str3))) eq $test_str3,
   "encode_rfc1522 properly handles parenthesis and \"");
-
+ok(Debbugs::MIME::handle_escaped_commas(q(),q(From: =?UTF-8?Q?Armstrong=2C?= Don <don@donarmstrong.com>)) eq q("Armstrong, Don" <don@donarmstrong.com>),
+  "handle_escaped_commas properly handles commas in RFC1522 encoded strings");
 
 # Make sure that create_mime_message has encoded headers and doesn't enclude any 8-bit characters
 
 
 # Make sure that create_mime_message has encoded headers and doesn't enclude any 8-bit characters
 
index a20b3979364b9d16a4fdcd5c3d35eb9fbd74dbb5..901b883465f14cd65f40f27349564894ed6dc893 100644 (file)
@@ -142,7 +142,7 @@ send_message(to => 'control@bugs.something',
                        ],
             body => <<'EOF') or fail 'message to control@bugs.something failed';
 debug 10
                        ],
             body => <<'EOF') or fail 'message to control@bugs.something failed';
 debug 10
-clone 2 -1 -2 -3 -4 -5 -6
+clone 2 -1 -2 -3 -4 -5 -6 -7 -8
 retitle 2 foo
 owner 2 bar@baz.com
 submitter 2 fleb@bleh.com
 retitle 2 foo
 owner 2 bar@baz.com
 submitter 2 fleb@bleh.com
@@ -159,9 +159,21 @@ fixed -4 1.2-3
 found -4 1.2-1
 found -5 1.2-5
 fixed -5 1.2-6
 found -4 1.2-1
 found -5 1.2-5
 fixed -5 1.2-6
+block -7 by -1
+block -7 by -2
+block -8 by -2
+block -8 by -1
 thanks
 EOF
 
 thanks
 EOF
 
+# The order of "Blocked-By:" in *.summary is not deterministic, so
+# these tests assert that the blockers of bugs #9 and #10 are sorted
+# differently.
+ok(system('perl', '-i', '-pwe', 's/^Blocked-By: 4 3\n/Blocked-By: 3 4\n/;', $spool_dir . '/db-h/09/9.summary') == 0, 'Changed bug #9');
+ok(system('perl', '-i', '-pwe', 's/^Blocked-By: 3 4\n/Blocked-By: 4 3\n/;', $spool_dir . '/db-h/10/10.summary') == 0, 'Changed bug #10');
+ok(system('grep','-q','^Blocked-By: 3 4',"$spool_dir/db-h/09/9.summary") == 0,'Bug #9 has "Blocked-By: 3 4"');
+ok(system('grep','-q','^Blocked-By: 4 3',"$spool_dir/db-h/10/10.summary") == 0,'Bug #10 has "Blocked-By: 4 3"');
+
 test_control_commands(\%config,
                      forcemerge   => {command => 'forcemerge',
                                       value   => "2 3\nseverity 2 minor",
 test_control_commands(\%config,
                      forcemerge   => {command => 'forcemerge',
                                       value   => "2 3\nseverity 2 minor",
@@ -191,6 +203,12 @@ test_control_commands(\%config,
                                       status_value => '8',
                                       bug => '7',
                                      },
                                       status_value => '8',
                                       bug => '7',
                                      },
+                     merge        => {command => 'merge',
+                                      value   => '9 10',
+                                      status_key => 'mergedwith',
+                                      status_value => '10',
+                                      bug => '9',
+                                     },
                     );
 
 done_testing();
                     );
 
 done_testing();