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

dpkg-source, dpkg-genchanges: split Binary lines at less than 980 chars

Splitting on the first space after 980 characters was not enough as
package names can be quite long and the real limit is not 1024 chars
but rather 992 chars for email exchange.

Example of problematic changes:
http://lists.debian.org/debian-devel-changes/2010/02/msg01090.html

We now split on the last space before the 980 chars limit.
Raphaël Hertzog лет назад: 16
Родитель
Сommit
18169a3eca
2 измененных файлов с 2 добавлено и 2 удалено
  1. 1 1
      scripts/dpkg-genchanges.pl
  2. 1 1
      scripts/dpkg-source.pl

+ 1 - 1
scripts/dpkg-genchanges.pl

@@ -470,7 +470,7 @@ if (!defined($fields->{'Date'})) {
 
 $fields->{'Binary'} = join(' ', map { $_->{'Package'} } $control->get_packages());
 # Avoid overly long line (>~1000 chars) by splitting over multiple lines
-$fields->{'Binary'} =~ s/(.{980,}?) /$1\n/g;
+$fields->{'Binary'} =~ s/(.{0,980}) /$1\n/g;
 
 unshift(@archvalues,'source') unless is_binaryonly;
 @archvalues = ('all') if $include == ARCH_INDEP;

+ 1 - 1
scripts/dpkg-source.pl

@@ -288,7 +288,7 @@ if ($options{'opmode'} =~ /^(-b|--print-format)$/) {
     
     $fields->{'Binary'} = join(', ', @binarypackages);
     # Avoid overly long line (>~1000 chars) by splitting over multiple lines
-    $fields->{'Binary'} =~ s/(.{980,}?), ?/$1,\n/g;
+    $fields->{'Binary'} =~ s/(.{0,980}), ?/$1,\n/g;
 
     # Generate list of formats to try
     my @try_formats = (@cmdline_formats);