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

[PATCH] dpkg-gensymbols: Cope with empty lines.



Empty lines are quite useful as (visual) delimiters between sections in
symbols files, for example when libfoo0 contains libfoo-bar.so.0 and
libfoo-baz.so.0. Consider them like comments: ignore them. This gets us
rid of such warnings (which by the way are missing line numbers):
| dpkg-gensymbols: warning: Failed to parse a line in debian/libfoo0.symbols:
| dpkg-gensymbols: warning: Failed to parse a line in debian/libfoo0.symbols:
---
 scripts/Dpkg/Shlibs/SymbolFile.pm |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Not sure whether you'll like that. Docs might need an update, ditto for
tests, which I didn't run (sorry).

diff --git a/scripts/Dpkg/Shlibs/SymbolFile.pm b/scripts/Dpkg/Shlibs/SymbolFile.pm
index fa079b2..108fc07 100644
--- a/scripts/Dpkg/Shlibs/SymbolFile.pm
+++ b/scripts/Dpkg/Shlibs/SymbolFile.pm
@@ -236,8 +236,8 @@ sub parse {
 	    }
 	    $dir =~ s{[^/]+$}{}; # Strip filename
 	    $self->load("$dir$filename", $seen, $obj_ref, $new_base_symbol);
-	} elsif (/^#/) {
-	    # Skip possible comments
+	} elsif (/^#|^$/) {
+	    # Skip possible comments and empty lines
 	} elsif (/^\|\s*(.*)$/) {
 	    # Alternative dependency template
 	    push @{$self->{objects}{$$obj_ref}{deps}}, "$1";
-- 
1.7.5.4


Reply to: