Bug#45642: dpkg-dev: dpkg-source can't handle lines in .diff.gz beginning with \
Package: dpkg-dev
Version: 1.4.1.9
Severity: normal
Some diffs (for example, netbase 3.16-2) contain sections like this:
@@ -17,4 +21,5 @@
patch -p1 < ../ipautofw-2.0.0.diff
archive:
- cd ../.. && tar -cf - ipautofw/ | gzip -9 > /root/scootdir/rlynch.ftp/ip
autofw-`date +%y%m%d`.tar.gz
\ No newline at end of file
+ cd ../.. && tar -cf - ipautofw/ | gzip -9 > /root/scootdir/rlynch.ftp/ip
autofw-`date +%y%m%d`.tar.gz
+
dpkg-source chokes on the line that begins with a backslash. The
issue is in lines 535 to 551 of dpkg-source. The following diff is
one way to fix this (I assume that the "No newline" string doesn't
vary with the locale of the person building the source package)
--- dpkg-source.old Tue Sep 21 01:17:45 1999
+++ dpkg-source Tue Sep 21 01:18:53 1999
@@ -535,6 +535,7 @@
while (($_ = <GZIP>) && !/^--- /) {
# read hunk header (@@)
s/\n$// or &error("diff is missing trailing newline");
+ next if /^\\ No newline/;
/^@@ -\d+(,(\d+))? \+\d+(,(\d+))? @\@$/ or
&error("Expected ^@@ in line $. of diff");
my ($olines, $nlines) = ($1 ? $2 : 1, $3 ? $4 : 1);
@@ -543,6 +544,7 @@
while ($olines || $nlines) {
$_ = <GZIP> or &error("unexpected end of diff");
s/\n$// or &error("diff is missing trailing newline");
+ next if /^\\ No newline/;
if (/^ /) { --$olines; --$nlines; }
elsif (/^-/) { --$olines; }
elsif (/^\+/) { --$nlines; }
-- System Information
Debian Release: potato
Kernel Version: Linux cush 2.2.12 #1 Thu Sep 2 22:55:25 EDT 1999 i586 unknown
Versions of the packages dpkg-dev depends on:
ii perl-5.005-base 5.005.03-3 The Pathologically Eclectic Rubbish Lister
^^^ (Provides virtual package perl5)
Reply to: