]> git.donarmstrong.com Git - debbugs.git/commitdiff
Salsa-CI: Allow autopkgtest to fail for now release_2.6
authorOtto Kekäläinen <otto@debian.org>
Sun, 19 May 2024 01:34:58 +0000 (18:34 -0700)
committerDon Armstrong <don@donarmstrong.com>
Mon, 20 May 2024 03:55:53 +0000 (20:55 -0700)
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

Allowing failure in GitLab CI will still show the job as yellow, and
hopefully attract the attention of developers to later fix is too.

Debbugs/MIME.pm
Debbugs/Status.pm
debian/changelog
debian/docs
debian/salsa-ci.yml [new file with mode: 0644]
examples/debbugs-debian.wsdl [new file with mode: 0644]
scripts/process
t/01_mime.t
t/12_merge.t

index 1d8fcb57e2a3c633e8cf86d2bab484ca9c0e5f04..3033f30e8afcc20500300ce0893dccf5bf665db3 100644 (file)
@@ -42,7 +42,7 @@ BEGIN {
     @EXPORT = ();
 
     %EXPORT_TAGS = (mime => [qw(parse create_mime_message getmailbody)],
-                   rfc1522 => [qw(decode_rfc1522 encode_rfc1522)],
+                   rfc1522 => [qw(decode_rfc1522 encode_rfc1522 handle_escaped_commas)],
                   );
     @EXPORT_OK=();
     Exporter::export_ok_tags(keys %EXPORT_TAGS);
@@ -52,6 +52,7 @@ BEGIN {
 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);
@@ -357,4 +358,36 @@ sub encode_rfc1522 {
      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;
index 197b188a6d02c393b084631143c5307e44f589b3..897a4f9ae0eef95c93c39c80d2838e6df116136a 100644 (file)
@@ -282,6 +282,17 @@ sub read_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
index 16d26c1a8010d80db5a2eb4d59a945b93e993ec2..e5d9aa0600cab82fd88bb3e3525145ef34e5963d 100644 (file)
@@ -4,6 +4,8 @@ debbugs (2.6.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 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
 
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
diff --git a/examples/debbugs-debian.wsdl b/examples/debbugs-debian.wsdl
new file mode 100644 (file)
index 0000000..db9fe34
--- /dev/null
@@ -0,0 +1,415 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- Copyright (C) 2011-2024  Free Software Foundation, Inc.
+
+Copyright 2024 Don Armstrong <don@donarmstrong.com>
+
+This file is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This file is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>. -->
+
+<!-- This file describes the bindings of the debbugs SOAP interface
+(see <https://wiki.debian.org/DebbugsSoapInterface>). -->
+
+<wsdl:definitions
+    name="Debbugs/SOAP"
+    targetNamespace="urn:Debbugs/SOAP"
+    xmlns:tns="urn:Debbugs/SOAP"
+    xmlns:types="urn:Debbugs/SOAP/TYPES"
+    xmlns:apachens="http://xml.apache.org/xml-soap"
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
+    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+    xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
+    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
+    soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
+
+  <wsdl:types>
+    <schema targetNamespace="urn:Debbugs/SOAP/TYPES"
+           xmlns="http://www.w3.org/2001/XMLSchema">
+      <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
+
+      <complexType name="ArrayOfBugNumber">
+        <complexContent>
+          <restriction base="soapenc:Array">
+            <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:int[]"/>
+          </restriction>
+        </complexContent>
+       </complexType>
+
+      <complexType name="ArrayOfAnyType">
+        <complexContent>
+          <restriction base="soapenc:Array">
+            <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:anyType[]"/>
+          </restriction>
+        </complexContent>
+       </complexType>
+
+      <complexType name="ArrayOfArrayOfAnyType">
+        <complexContent>
+          <restriction base="soapenc:Array">
+            <attribute ref="soapenc:arrayType"
+                      wsdl:arrayType="types:ArrayOfAnyType[]"/>
+          </restriction>
+        </complexContent>
+       </complexType>
+
+      <complexType name="ArrayOfArrayOfArrayOfAnyType">
+        <complexContent>
+          <restriction base="soapenc:Array">
+            <attribute ref="soapenc:arrayType"
+                      wsdl:arrayType="types:ArrayOfArrayOfAnyType[]"/>
+          </restriction>
+        </complexContent>
+       </complexType>
+    </schema>
+
+    <schema targetNamespace="http://xml.apache.org/xml-soap"
+           xmlns="http://www.w3.org/2001/XMLSchema">
+      <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
+
+      <complexType name="mapItem">
+        <sequence>
+          <element name="key" nillable="true" type="xsd:int"/>
+          <element name="value" nillable="true" type="xsd:anyType"/>
+        </sequence>
+      </complexType>
+
+      <complexType name="Map">
+        <sequence>
+          <element maxOccurs="unbounded" minOccurs="0"
+                  name="item" type="apachens:mapItem"/>
+        </sequence>
+      </complexType>
+    </schema>
+  </wsdl:types>
+
+  <wsdl:message name="get_statusRequest">
+    <wsdl:part name="bugs" type="types:ArrayOfBugNumber"/>
+  </wsdl:message>
+  <wsdl:message name="get_statusResponse">
+    <wsdl:part name="s-gensym3" type="apachens:Map"/>
+  </wsdl:message>
+
+  <wsdl:message name="get_bug_logRequest">
+    <wsdl:part name="bugnumber" type="xsd:int"/>
+  </wsdl:message>
+  <wsdl:message name="get_bug_logResponse">
+    <wsdl:part name="soapenc:Array" type="types:ArrayOfAnyType"/>
+  </wsdl:message>
+
+  <wsdl:message name="get_bugsRequest">
+    <wsdl:part name="query" type="types:ArrayOfAnyType"/>
+  </wsdl:message>
+  <wsdl:message name="get_bugsResponse">
+    <wsdl:part name="soapenc:Array" type="types:ArrayOfBugNumber"/>
+  </wsdl:message>
+
+  <wsdl:message name="get_usertagRequest">
+    <wsdl:part name="user" type="xsd:string"/>
+    <!-- We do not support tags -->
+  </wsdl:message>
+  <wsdl:message name="get_usertagResponse">
+    <wsdl:part name="s-gensym3" type="xsd:anyType"/>
+  </wsdl:message>
+
+  <wsdl:message name="newest_bugsRequest">
+    <wsdl:part name="amount" type="xsd:int"/>
+  </wsdl:message>
+  <wsdl:message name="newest_bugsResponse">
+    <wsdl:part name="soapenc:Array" type="types:ArrayOfBugNumber"/>
+  </wsdl:message>
+
+  <wsdl:message name="binary_to_sourceRequest">
+    <wsdl:part name="arguments" type="types:ArrayOfAnyType"/>
+  </wsdl:message>
+  <wsdl:message name="binary_to_sourceResponse">
+    <wsdl:part name="soapenc:Array" type="types:ArrayOfAnyType"/>
+  </wsdl:message>
+
+  <wsdl:message name="source_to_binaryRequest">
+    <wsdl:part name="source_name" type="xsd:string"/>
+    <wsdl:part name="source_version" type="xsd:string"/>
+  </wsdl:message>
+  <wsdl:message name="source_to_binaryResponse">
+    <wsdl:part name="soapenc:Array" type="types:ArrayOfAnyType"/>
+  </wsdl:message>
+
+  <wsdl:message name="get_versionsRequest">
+    <wsdl:part name="arguments" type="types:ArrayOfAnyType"/>
+  </wsdl:message>
+  <wsdl:message name="get_versionsResponse">
+    <wsdl:part name="soapenc:Array" type="types:ArrayOfAnyType"/>
+  </wsdl:message>
+
+  <wsdl:portType name="Debbugs/SOAP">
+    <wsdl:operation name="get_status" parameterOrder="bugs">
+      <wsdl:input message="tns:get_statusRequest">
+        <soap:body
+           encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+           namespace="urn:Debbugs/SOAP"
+           use="encoded"/>
+      </wsdl:input>
+      <wsdl:output message="tns:get_statusResponse">
+        <soap:body
+           encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+           namespace="urn:Debbugs/SOAP"
+           use="encoded"/>
+      </wsdl:output>
+    </wsdl:operation>
+
+    <wsdl:operation name="get_bug_log" parameterOrder="bugnumber">
+      <wsdl:input message="tns:get_bug_logRequest">
+        <soap:body
+           encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+           namespace="urn:Debbugs/SOAP"
+           use="encoded"/>
+      </wsdl:input>
+      <wsdl:output message="tns:get_bug_logResponse">
+        <soap:body
+           encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+           namespace="urn:Debbugs/SOAP"
+           use="encoded"/>
+      </wsdl:output>
+    </wsdl:operation>
+
+    <wsdl:operation name="get_bugs" parameterOrder="query">
+      <wsdl:input message="tns:get_bugsRequest">
+        <soap:body
+           encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+           namespace="urn:Debbugs/SOAP"
+           use="encoded"/>
+      </wsdl:input>
+      <wsdl:output message="tns:get_bugsResponse">
+        <soap:body
+           encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+           namespace="urn:Debbugs/SOAP"
+           use="encoded"/>
+      </wsdl:output>
+    </wsdl:operation>
+
+    <wsdl:operation name="get_usertag" parameterOrder="user">
+      <wsdl:input message="tns:get_usertagRequest">
+        <soap:body
+           encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+           namespace="urn:Debbugs/SOAP"
+           use="encoded"/>
+      </wsdl:input>
+      <wsdl:output message="tns:get_usertagResponse">
+        <soap:body
+           encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+           namespace="urn:Debbugs/SOAP"
+           use="encoded"/>
+      </wsdl:output>
+    </wsdl:operation>
+
+    <wsdl:operation name="newest_bugs" parameterOrder="amount">
+      <wsdl:input message="tns:newest_bugsRequest">
+        <soap:body
+           encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+           namespace="urn:Debbugs/SOAP"
+           use="encoded"/>
+      </wsdl:input>
+      <wsdl:output message="tns:newest_bugsResponse">
+        <soap:body
+           encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+           namespace="urn:Debbugs/SOAP"
+           use="encoded"/>
+      </wsdl:output>
+    </wsdl:operation>
+
+    <wsdl:operation name="binary_to_source" parameterOrder="arguments">
+      <wsdl:input message="tns:binary_to_sourceRequest">
+        <soap:body
+           encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+           namespace="urn:Debbugs/SOAP"
+           use="encoded"/>
+      </wsdl:input>
+      <wsdl:output message="tns:binary_to_sourceResponse">
+        <soap:body
+           encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+           namespace="urn:Debbugs/SOAP"
+           use="encoded"/>
+      </wsdl:output>
+    </wsdl:operation>
+
+    <wsdl:operation name="source_to_binary" parameterOrder="source_name source_version">
+      <wsdl:input message="tns:source_to_binaryRequest">
+        <soap:body
+           encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+           namespace="urn:Debbugs/SOAP"
+           use="encoded"/>
+      </wsdl:input>
+      <wsdl:output message="tns:source_to_binaryResponse">
+        <soap:body
+           encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+           namespace="urn:Debbugs/SOAP"
+           use="encoded"/>
+      </wsdl:output>
+    </wsdl:operation>
+
+    <wsdl:operation name="get_versions" parameterOrder="arguments">
+      <wsdl:input message="tns:get_versionsRequest">
+        <soap:body
+           encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+           namespace="urn:Debbugs/SOAP"
+           use="encoded"/>
+      </wsdl:input>
+      <wsdl:output message="tns:get_versionsResponse">
+        <soap:body
+           encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+           namespace="urn:Debbugs/SOAP"
+           use="encoded"/>
+      </wsdl:output>
+    </wsdl:operation>
+    
+  </wsdl:portType>
+
+  <wsdl:binding name="Debbugs/SOAP/BINDING" type="tns:Debbugs/SOAP">
+    <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+    <wsdl:operation name="get_status">
+      <wsdlsoap:operation soapAction="Debbugs/SOAP"/>
+      <wsdl:input name="get_statusRequest">
+        <wsdlsoap:body
+           encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+           namespace="urn:Debbugs/SOAP"
+           use="encoded"/>
+      </wsdl:input>
+      <wsdl:output name="get_statusResponse">
+        <wsdlsoap:body
+           encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+           namespace="urn:Debbugs/SOAP"
+           use="encoded"/>
+      </wsdl:output>
+    </wsdl:operation>
+
+    <wsdl:operation name="get_bug_log">
+      <wsdlsoap:operation soapAction="Debbugs/SOAP"/>
+      <wsdl:input name="get_bug_logRequest">
+        <wsdlsoap:body
+           encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+           namespace="urn:Debbugs/SOAP"
+           use="encoded"/>
+      </wsdl:input>
+      <wsdl:output name="get_bug_logResponse">
+        <wsdlsoap:body
+           encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+           namespace="urn:Debbugs/SOAP"
+           use="encoded"/>
+      </wsdl:output>
+    </wsdl:operation>
+
+    <wsdl:operation name="get_bugs">
+      <wsdlsoap:operation soapAction="Debbugs/SOAP"/>
+      <wsdl:input name="get_bugsRequest">
+        <wsdlsoap:body
+           encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+           namespace="urn:Debbugs/SOAP"
+           use="encoded"/>
+      </wsdl:input>
+      <wsdl:output name="get_bugsResponse">
+        <wsdlsoap:body
+           encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+           namespace="urn:Debbugs/SOAP"
+           use="encoded"/>
+      </wsdl:output>
+    </wsdl:operation>
+
+    <wsdl:operation name="get_usertag">
+      <wsdlsoap:operation soapAction="Debbugs/SOAP"/>
+      <wsdl:input name="get_tagRequest">
+        <wsdlsoap:body
+           encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+           namespace="urn:Debbugs/SOAP"
+           use="encoded"/>
+      </wsdl:input>
+      <wsdl:output name="get_tagResponse">
+        <wsdlsoap:body
+           encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+           namespace="urn:Debbugs/SOAP"
+           use="encoded"/>
+      </wsdl:output>
+    </wsdl:operation>
+
+    <wsdl:operation name="newest_bugs">
+      <wsdlsoap:operation soapAction="Debbugs/SOAP"/>
+      <wsdl:input name="newest_bugsRequest">
+        <wsdlsoap:body
+           encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+           namespace="urn:Debbugs/SOAP"
+           use="encoded"/>
+      </wsdl:input>
+      <wsdl:output name="newest_bugsResponse">
+        <wsdlsoap:body
+           encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+           namespace="urn:Debbugs/SOAP"
+           use="encoded"/>
+      </wsdl:output>
+    </wsdl:operation>
+
+    <wsdl:operation name="binary_to_source">
+      <wsdlsoap:operation soapAction="Debbugs/SOAP"/>
+      <wsdl:input name="binary_to_sourceRequest">
+        <wsdlsoap:body
+           encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+           namespace="urn:Debbugs/SOAP"
+           use="encoded"/>
+      </wsdl:input>
+      <wsdl:output name="binary_to_sourceResponse">
+        <wsdlsoap:body
+           encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+           namespace="urn:Debbugs/SOAP"
+           use="encoded"/>
+      </wsdl:output>
+    </wsdl:operation>
+
+    <wsdl:operation name="source_to_binary">
+      <wsdlsoap:operation soapAction="Debbugs/SOAP"/>
+      <wsdl:input name="source_to_binaryRequest">
+        <wsdlsoap:body
+           encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+           namespace="urn:Debbugs/SOAP"
+           use="encoded"/>
+      </wsdl:input>
+      <wsdl:output name="source_to_binaryResponse">
+        <wsdlsoap:body
+           encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+           namespace="urn:Debbugs/SOAP"
+           use="encoded"/>
+      </wsdl:output>
+    </wsdl:operation>
+
+    <wsdl:operation name="get_versions">
+      <wsdlsoap:operation soapAction="Debbugs/SOAP"/>
+      <wsdl:input name="get_versionsRequest">
+        <wsdlsoap:body
+           encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+           namespace="urn:Debbugs/SOAP"
+           use="encoded"/>
+      </wsdl:input>
+      <wsdl:output name="get_versionsResponse">
+        <wsdlsoap:body
+           encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+           namespace="urn:Debbugs/SOAP"
+           use="encoded"/>
+      </wsdl:output>
+    </wsdl:operation>
+
+  </wsdl:binding>
+
+  <wsdl:service name="Debbugs/SOAP/SERVICE">
+    <wsdl:port binding="tns:Debbugs/SOAP/BINDING" name="debian.org">
+      <wsdlsoap:address location="https://bugs.debian.org/cgi-bin/soap.cgi"/>
+    </wsdl:port>
+  </wsdl:service>
+</wsdl:definitions>
index b40360323cd77f8e805013ec9180ff59406811c7..6e0a247f958953cbf417afc57c0602887f216638 100755 (executable)
@@ -183,7 +183,7 @@ for my $hdr (@headerlines) {
                         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;
@@ -191,7 +191,13 @@ for my $hdr (@headerlines) {
            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";
     }
@@ -716,7 +722,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;
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 $
 
-use Test::More tests => 6;
+use Test::More tests => 7;
 
 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 \"");
-
+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
 
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
-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
@@ -159,9 +159,21 @@ fixed -4 1.2-3
 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
 
+# 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",
@@ -191,6 +203,12 @@ test_control_commands(\%config,
                                       status_value => '8',
                                       bug => '7',
                                      },
+                     merge        => {command => 'merge',
+                                      value   => '9 10',
+                                      status_key => 'mergedwith',
+                                      status_value => '10',
+                                      bug => '9',
+                                     },
                     );
 
 done_testing();