[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#51888: have dpkg-scansources allow trailing blank lines



Package: dpkg-dev
Version: 1.6.1
Severity: normal

It seems that most of the tools allow a .dsc file to have trailing blank
lines, but dpkg-scansources doesn't.  The clue_19970309-6.dsc which is
currently in the archive is such a case, it isn't in he Sources file
because of this.

Should it be even more permissive than this?

Index: dpkg-scansources
===================================================================
RCS file: /usr/local/src/cvsroot/dpkg-scansources/dpkg-scansources,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- dpkg-scansources	1999/07/13 14:48:46	1.9
+++ dpkg-scansources	1999/12/04 03:33:11	1.10
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 use strict;
 
-# $Id: dpkg-scansources,v 1.9 1999/07/13 14:48:46 roderick Exp $
+# $Id: dpkg-scansources,v 1.10 1999/12/04 03:33:11 roderick Exp $
 
 # Copyright (C) 1999 Roderick Schertler
 #
@@ -30,7 +30,7 @@
 
 my $Exit = 0;
 (my $Me = $0) =~ s-.*/--;
-my $Version = q$Revision: 1.9 $ =~ /(\d\S+)/ ? $1 : '?';
+my $Version = q$Revision: 1.10 $ =~ /(\d\S+)/ ? $1 : '?';
 
 # %Override is a hash of lists.  The subs following describe what's in
 # the lists.
@@ -314,6 +314,10 @@
 	$dir, $dir_field, $dsc_field_start);
 
     my ($size, $md5, $contents) = read_dsc $file or return;
+
+    # Allow blank lines at the end of a file, because the other programs
+    # do.
+    $contents =~ s/\n\n+\z/\n/;
 
     if ($contents =~ /^\n/ || $contents =~ /\n\n/) {
     	xwarn_noerror "$file invalid (contains blank line)\n";

-- 
Roderick Schertler
roderick@argon.org


Reply to: