瀏覽代碼

Dpkg::Changelog::Entry::Debian: Remove non-functional timezone name support

The Debian changelog trailer regex intended to support a timezone name
inside parenthesis, like this:

 -- Name <mail@example.org>  Sat, 30 May 2015 03:18:43 +0200 (CEST)

is bogus, and it only accepts one character. As in:

 -- Name <mail@example.org>  Sat, 30 May 2015 03:18:43 +0200 (C)

which while also "valid", as per RFC822, they are pretty much useless
as per RFC5322. The implementation has kept that part unchanged since
its inception in dpkg 1.3.0, 1996-08.

So let's just drop it instead of fixing the regex, given that the
timezone name has never been accepted, many time-parsing functions
ignore it, it is redundant, declared obsolete by RFC5322 and Debian
policy dropped an explicit reference to it due to bug #569174.
Guillem Jover 11 年之前
父節點
當前提交
9849eff1e4
共有 2 個文件被更改,包括 4 次插入1 次删除
  1. 3 0
      debian/changelog
  2. 1 1
      scripts/Dpkg/Changelog/Entry/Debian.pm

+ 3 - 0
debian/changelog

@@ -2,6 +2,9 @@ dpkg (1.18.2) UNRELEASED; urgency=low
 
   [ Guillem Jover ]
   * Fix plural form translations for single plural languages. Closes: #790025
+  * Perl modules:
+    - Remove non-functional timezone name support from
+      Dpkg::Changelog::Entry::Debian.
   * Documentation:
     - Fix grammar in dpkg-architecture(1).
       Thanks to Chris Lamb <lamby@debian.org>. Closes: #787616

+ 1 - 1
scripts/Dpkg/Changelog/Entry/Debian.pm

@@ -64,7 +64,7 @@ our $regex_header = qr/^(\w$name_chars*) \(([^\(\) \t]+)\)((?:\s+$name_chars+)+)
 
 # The matched content is the maintainer name ($1), its email ($2),
 # some blanks ($3) and the timestamp ($4).
-our $regex_trailer = qr/^ \-\- (.*) <(.*)>(  ?)((\w+\,\s*)?\d{1,2}\s+\w+\s+\d{4}\s+\d{1,2}:\d\d:\d\d\s+[-+]\d{4}(\s+\([^\\\(\)]\))?)\s*$/o;
+our $regex_trailer = qr/^ \-\- (.*) <(.*)>(  ?)((\w+\,\s*)?\d{1,2}\s+\w+\s+\d{4}\s+\d{1,2}:\d\d:\d\d\s+[-+]\d{4})\s*$/o;
 
 ## use critic