This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch master
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=6ca15410852735d3d1eec7a89db2fa540023e3de

commit 6ca15410852735d3d1eec7a89db2fa540023e3de
Author: Guillem Jover <[email protected]>
AuthorDate: Mon Apr 20 00:14:56 2020 +0200

    dpkg-genchanges: Handle empty Date fields from parsed debian/changelog
    
    When dpkg-genchanges fails to parse the date in debian/changelog, it
    creates and empty field named Date. That field is then skipped on
    output, producing a policy non-compliant changes.
    
    We should change the check to handle not just undefined by also empty
    fields.
    
    Closes: #956321
    Based-on-patch-by: Baptiste BEAUPLAT <[email protected]>
---
 debian/changelog           | 2 ++
 scripts/dpkg-genchanges.pl | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 16df02876..29e3870fb 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -10,6 +10,8 @@ dpkg (1.20.1) UNRELEASED; urgency=medium
     about version of introduction.
   * Add new buildopts.mk Makefile fragment to support parsing DEB_BUILD_OPTIONS
     options with arguments, such as “parallel” as DEB_BUILD_OPTION_PARALLEL.
+  * dpkg-genchanges: Handle empty Date fields from parsed debian/changelog.
+    Based on a patch by Baptiste BEAUPLAT <[email protected]>. Closes: #956321
   * Perl modules:
     - Dpkg: Add a LICENSE section to the POD.
     - Dpkg::Source::Package: Add new get_upstream_signing_key() method.
diff --git a/scripts/dpkg-genchanges.pl b/scripts/dpkg-genchanges.pl
index e643fe664..4ddd0032c 100755
--- a/scripts/dpkg-genchanges.pl
+++ b/scripts/dpkg-genchanges.pl
@@ -460,7 +460,7 @@ info($origsrcmsg);
 
 $fields->{'Format'} = $substvars->get('Format');
 
-if (!defined($fields->{'Date'})) {
+if (length $fields->{'Date'} == 0) {
     setlocale(LC_TIME, 'C');
     $fields->{'Date'} = POSIX::strftime('%a, %d %b %Y %T %z', localtime);
     setlocale(LC_TIME, '');

-- 
Dpkg.Org's dpkg

Reply via email to