The following commit has been merged in the master branch:
commit d66ba7eb665a471869a31789a80f40510f54ce30
Author: Raphaël Hertzog <[email protected]>
Date:   Thu Feb 25 18:04:10 2010 +0100

    dpkg-genchanges, dpkg-source: only split Binary field when it's too long
    
    Applying the substitution on short lines will split them too even though
    they are not longer than 980 chars.

diff --git a/scripts/dpkg-genchanges.pl b/scripts/dpkg-genchanges.pl
index 2f182f8..4cfa864 100755
--- a/scripts/dpkg-genchanges.pl
+++ b/scripts/dpkg-genchanges.pl
@@ -447,8 +447,10 @@ 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/(.{0,980}) /$1\n/g;
+# Avoid overly long line by splitting over multiple lines
+if (length($fields->{'Binary'}) > 980) {
+    $fields->{'Binary'} =~ s/(.{0,980}) /$1\n/g;
+}
 
 unshift(@archvalues,'source') unless is_binaryonly;
 @archvalues = ('all') if $include == ARCH_INDEP;
diff --git a/scripts/dpkg-source.pl b/scripts/dpkg-source.pl
index 0ea8cc0..4c3dbc9 100755
--- a/scripts/dpkg-source.pl
+++ b/scripts/dpkg-source.pl
@@ -287,8 +287,10 @@ if ($options{'opmode'} =~ /^(-b|--print-format)$/) {
     }
     
     $fields->{'Binary'} = join(', ', @binarypackages);
-    # Avoid overly long line (>~1000 chars) by splitting over multiple lines
-    $fields->{'Binary'} =~ s/(.{0,980}), ?/$1,\n/g;
+    # Avoid overly long line by splitting over multiple lines
+    if (length($fields->{'Binary'}) > 980) {
+       $fields->{'Binary'} =~ s/(.{0,980}), ?/$1,\n/g;
+    }
 
     # Generate list of formats to try
     my @try_formats = (@cmdline_formats);

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to