ソースを参照

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 年 前
コミット
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());
 $fields->{'Binary'} = join(' ', map { $_->{'Package'} } $control->get_packages());
 # Avoid overly long line (>~1000 chars) by splitting over multiple lines
 # 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;
 unshift(@archvalues,'source') unless is_binaryonly;
 @archvalues = ('all') if $include == ARCH_INDEP;
 @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);
     $fields->{'Binary'} = join(', ', @binarypackages);
     # Avoid overly long line (>~1000 chars) by splitting over multiple lines
     # 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
     # Generate list of formats to try
     my @try_formats = (@cmdline_formats);
     my @try_formats = (@cmdline_formats);