Просмотр исходного кода

Dpkg::Source::Package::V2: Preset Last-Update field with current time

We know the current date, so let's make it easier on maintainers by
presetting the field value when generating the patch header template.

Closes: #828146
Based-on-patch-by: Daniel Shahaf <danielsh@apache.org>
Guillem Jover лет назад: 10
Родитель
Сommit
0c945f0c9b
2 измененных файлов с 6 добавлено и 1 удалено
  1. 3 0
      debian/changelog
  2. 3 1
      scripts/Dpkg/Source/Package/V2.pm

+ 3 - 0
debian/changelog

@@ -77,6 +77,9 @@ dpkg (1.18.8) UNRELEASED; urgency=medium
     - Disable upstream tar signature when building format 1.0 source packages
       in Dpkg::Source::Package::V1, as the current stable dpkg series do not
       support extracting them.
+    - Preset Last-Update field in patch header template with current time in
+      Dpkg::Source::Package::V2. Thanks to Daniel Shahaf <danielsh@apache.org>.
+      Closes: #828146
   * Test suite:
     - Bump perlcritic ValuesAndExpressions::RequireNumberSeparators minimum
       to 99999.

+ 3 - 1
scripts/Dpkg/Source/Package/V2.pm

@@ -634,6 +634,8 @@ information below has been extracted from the changelog. Adjust it or drop
 it.\n";
     $header->{'Description'} .= $ch_info->{'Changes'} . "\n";
     $header->{'Author'} = $ch_info->{'Maintainer'};
+    my $yyyy_mm_dd = POSIX::strftime('%Y-%m-%d', gmtime);
+
     $text = "$header";
     run_vendor_hook('extend-patch-header', \$text, $ch_info);
     $text .= "\n---
@@ -647,7 +649,7 @@ Bug-Debian: https://bugs.debian.org/<bugnumber>
 Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
 Forwarded: <no|not-needed|url proving that it has been forwarded>
 Reviewed-By: <name and email of someone who approved the patch>
-Last-Update: <YYYY-MM-DD>\n\n";
+Last-Update: $yyyy_mm_dd\n\n";
     return $text;
 }