ソースを参照

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:

Signed-off-by: Raphaël Hertzog <hertzog@debian.org>
Cyril Brulebois 15 年 前
コミット
bbe54d836c
共有2 個のファイルを変更した4 個の追加2 個の削除を含む
  1. 2 0
      debian/changelog
  2. 2 2
      scripts/Dpkg/Shlibs/SymbolFile.pm

+ 2 - 0
debian/changelog

@@ -45,6 +45,8 @@ dpkg (1.16.1) UNRELEASED; urgency=low
   * Add some supplementary checks to ensure debian/control has the required
     fields. Closes: #631439
   * dpkg-gensymbols(1): document syntax of comments. Closes: #630996
+  * Allow empty lines in symbols files to better delimit multiple libraries.
+    Thanks to Cyril Brulebois <kibi@debian.org> for the patch.
 
   [ Guillem Jover ]
   * Install deb-src-control(5) man pages in dpkg-dev. Closes: #620520

+ 2 - 2
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";