Author: rra
Date: 2008-01-03 03:56:27 +0100 (Thu, 03 Jan 2008)
New Revision: 1088

Added:
   trunk/testset/libbaz/debian/lib.symbols
Modified:
   trunk/checks/shared-libs
   trunk/checks/shared-libs.desc
   trunk/debian/changelog
   trunk/testset/libbaz/debian/changelog
   trunk/testset/libbaz/debian/lib.shlibs
   trunk/testset/libbaz/debian/rules
   trunk/testset/non-us/debian/rules
   trunk/testset/tags.libbaz
   trunk/testset/tags.non-us
Log:
* checks/shared-libs{.desc,}:
  + [RA] New check for version numbers in symbol files.  Based on a
    patch from Raphael Hertzog.  (Closes: #457067)

Modified: trunk/checks/shared-libs
===================================================================
--- trunk/checks/shared-libs    2008-01-03 02:54:35 UTC (rev 1087)
+++ trunk/checks/shared-libs    2008-01-03 02:56:27 UTC (rev 1088)
@@ -291,6 +291,12 @@
 }
 
 # 4th step: check shlibs control file
+my $version;
+if (open (VERSION, '<', 'fields/version')) {
+    $version = <VERSION>;
+    close VERSION;
+    chomp $version;
+}
 @shlibs = keys %SONAME;
 if ($#shlibs == -1) {
     # no shared libraries included in package, thus shlibs control file should
@@ -365,13 +371,7 @@
        #
        # Deduplicate the list of dependencies before warning so that we don't
        # dupliate warnings.
-       my $provides = $pkg;
-       if (open (VERSION, '<', 'fields/version')) {
-           my $version = <VERSION>;
-           close VERSION;
-           chomp $version;
-           $provides .= " (= $version)";
-       }
+       my $provides = $pkg . "( = $version)";
        if (open (PROVIDES, '<', 'fields/provides')) {
            my $line = <PROVIDES>;
            close PROVIDES;
@@ -389,7 +389,47 @@
     }
 }
 
-# 5th step: check pre- and post- control files
+# 5th step: check symbols control file
+if (open(IN, '<', 'control/symbols')) {
+    my $version_wo_rev = $version;
+    $version_wo_rev =~ s/^(.+)-([^-]+)$/$1/;
+    my ($full_version_count, $full_version_sym) = (0, undef);
+    my ($debian_revision_count, $debian_revision_sym) = (0, undef);
+    while (<IN>) {
+       next if not /^\s+(\S+)\s(\S+)(?:\s(\d+))?/;
+       my ($sym, $v, $dep_order) = ($1, $2, $3);
+       if (($v eq $version) and ($version =~ /-/)) {
+           $full_version_sym ||= $sym;
+           $full_version_count++;
+       }
+       if (($v =~ /-/) and (not $v =~ /~$/) and ($v ne $version_wo_rev)) {
+           $debian_revision_sym ||= $sym;
+           $debian_revision_count++;
+       }
+    }
+    close IN;
+    if ($full_version_count) {
+       $full_version_count--;
+       my $others = '';
+       if ($full_version_count > 0) {
+           $others = " and $full_version_count others";
+       }
+       tag "symbols-file-contains-current-version-with-debian-revision",
+           "on symbol $full_version_sym$others"
+    }
+    if ($debian_revision_count) {
+       $debian_revision_count--;
+       my $others = '';
+       if ($debian_revision_count > 0) {
+           $others = " and $debian_revision_count others";
+       }
+       tag "symbols-file-contains-debian-revision",
+           "on symbol $debian_revision_sym$others";
+    }
+}
+
+
+# 6th step: check pre- and post- control files
 if (-f $preinst) {
     local $_ = slurp_entire_file($preinst);
     if (/^[^\#]*\bldconfig\b/m) {
@@ -464,4 +504,8 @@
 
 1;
 
+# Local Variables:
+# indent-tabs-mode: t
+# cperl-indent-level: 4
+# End:
 # vim: syntax=perl sw=4 ts=8

Modified: trunk/checks/shared-libs.desc
===================================================================
--- trunk/checks/shared-libs.desc       2008-01-03 02:54:35 UTC (rev 1087)
+++ trunk/checks/shared-libs.desc       2008-01-03 02:56:27 UTC (rev 1088)
@@ -207,3 +207,26 @@
  from assembler files which don't define a proper .note.GNU-stack
  section.
 
+Tag: symbols-file-contains-current-version-with-debian-revision
+Type: error
+Info: Debian revisions should be stripped from versions in symbols files.
+ Not doing so leads to dependencies unsatisfiable by backports (1.0-1~bpo
+ &lt;&lt; 1.0-1 while 1.0-1~bpo &gt;= 1.0).  If the debian revision can't
+ be stripped because the symbol really appearead between two specific
+ Debian revisions, you should postfix the version with a single "~"
+ (example: 1.0-3~ if the symbol appeared in 1.0-3).
+ .
+ This problem normally means that the symbols were added automatically by
+ dpkg-gensymbols.  dpkg-gensymbols uses the full version number for the
+ dependency associated to any new symbol that it detects.  The maintainer
+ must update the <tt>debian/&lt;package&gt;.symbols</tt> file by adding
+ the new symbols with the corresponding upstream version.
+
+Tag: symbols-file-contains-debian-revision
+Type: warning
+Info: Debian revisions should be stripped from versions in symbols files.
+ Not doing so leads to dependencies unsatisfiable by backports (1.0-1~bpo
+ &lt;&lt; 1.0-1 while 1.0-1~bpo &gt;= 1.0).  If the debian revision can't
+ be stripped because the symbol really appearead between two specific
+ Debian revisions, you should postfix the version with a single "~"
+ (example: 1.0-3~ if the symbol appeared in 1.0-3).

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog      2008-01-03 02:54:35 UTC (rev 1087)
+++ trunk/debian/changelog      2008-01-03 02:56:27 UTC (rev 1088)
@@ -9,6 +9,9 @@
       Thanks, Joerg Jaspert.  (Closes: #458074)
   * checks/files.desc:
     + [RA] Remove a stray variable from the config-file-reserved tag.
+  * checks/shared-libs{.desc,}:
+    + [RA] New check for version numbers in symbol files.  Based on a
+      patch from Raphael Hertzog.  (Closes: #457067)
 
   * debian/control:
     + [RA] Suggest libtext-template-perl, needed for HTML reporting.

Modified: trunk/testset/libbaz/debian/changelog
===================================================================
--- trunk/testset/libbaz/debian/changelog       2008-01-03 02:54:35 UTC (rev 
1087)
+++ trunk/testset/libbaz/debian/changelog       2008-01-03 02:56:27 UTC (rev 
1088)
@@ -1,4 +1,4 @@
-libbaz (1) unstable; urgency=low
+libbaz (1-1) unstable; urgency=low
 
   * Initial setup
 

Modified: trunk/testset/libbaz/debian/lib.shlibs
===================================================================
--- trunk/testset/libbaz/debian/lib.shlibs      2008-01-03 02:54:35 UTC (rev 
1087)
+++ trunk/testset/libbaz/debian/lib.shlibs      2008-01-03 02:56:27 UTC (rev 
1088)
@@ -1,8 +1,8 @@
 libdoesntexist2 1.0 libbaz1
 libdoesntexist2 1.0 libbaz1
 libbaz2 1.1 libbaz
-libbaz3 1 libbaz1 (>> 1)
-libbaz4 1 libbaz1 (= 1)
+libbaz3 1 libbaz1 (>> 1-1)
+libbaz4 1 libbaz1 (= 1-1)
 libbaz5 1 libbaz2
 udeb: libdoesntexist2 1.0 libbaz2
 udeb: libdoesntexist2 1.0 libbaz2

Added: trunk/testset/libbaz/debian/lib.symbols
===================================================================
--- trunk/testset/libbaz/debian/lib.symbols                             (rev 0)
+++ trunk/testset/libbaz/debian/lib.symbols     2008-01-03 02:56:27 UTC (rev 
1088)
@@ -0,0 +1,3 @@
+libbaz.so.2 libbaz1 #MINVER#
+ pw 1-1
+ foo 1.1-1

Modified: trunk/testset/libbaz/debian/rules
===================================================================
--- trunk/testset/libbaz/debian/rules   2008-01-03 02:54:35 UTC (rev 1087)
+++ trunk/testset/libbaz/debian/rules   2008-01-03 02:56:27 UTC (rev 1088)
@@ -20,12 +20,12 @@
        install -d debian/libbaz2-dev/usr/lib
        cp -a libbaz2.a libbaz2.so debian/libbaz2-dev/usr/lib
        # usually, I'd also include some .h files to /usr/include
-       
+
        # Now the correct libbaz2 package
        install -d debian/libbaz2/usr/lib
        cp -a libbaz2.so.* debian/libbaz2/usr/lib
        chmod a-x debian/libbaz2/usr/lib/*
-       
+
        # General stuff that is tested in other testsets:
        dh_installdocs -plibbaz2 -plibbaz2-dev -plibbaz2-dbg
        dh_compress -plibbaz2 -plibbaz2-dev -plibbaz2-dbg
@@ -61,8 +61,8 @@
        cp -a *.a $(lib_tmp)/usr/lib
        # And a wrong .so symlink (wrong, only in -dev, TODO)
        ln -s libfoo3.so.0.9 $(lib_tmp)/usr/lib/libfoo3.so
-       # And a wrong .so.X symlink (wrong, should point to a real existing 
shlib,
-       # TODO)
+       # And a wrong .so.X symlink (wrong, should point to a real existing
+       # shlib, TODO)
        ln -s libfoo.so.0.9.1 $(lib_tmp)/usr/lib/libfoo.so.0.9
        # And a plain .so (wrong, TODO)
        touch $(lib_tmp)/usr/lib/libbar2.so
@@ -77,6 +77,7 @@
        touch $(lib_tmp)/usr/share/doc/README.Debian
        #dpkg-shlibdeps $(lib_tmp)/usr/lib/libbaz.so.1.0
        install -m 755 debian/lib.shlibs $(lib_tmp)/DEBIAN/shlibs
+       install -m 755 debian/lib.symbols $(lib_tmp)/DEBIAN/symbols
        dpkg-gencontrol -isp -p$(LIB) -P$(lib_tmp)
        dpkg --build $(lib_tmp) ..
 

Modified: trunk/testset/non-us/debian/rules
===================================================================
--- trunk/testset/non-us/debian/rules   2008-01-03 02:54:35 UTC (rev 1087)
+++ trunk/testset/non-us/debian/rules   2008-01-03 02:56:27 UTC (rev 1088)
@@ -19,6 +19,8 @@
 
        # crypto-app
        install -d debian/$(CRYPTO)-tmp/DEBIAN
+       install -d debian/$(CRYPTO)-tmp/usr/share/doc/$(CRYPTO)
+       echo copyright >  debian/$(CRYPTO)-tmp/usr/share/doc/$(CRYPTO)/copyright
        dpkg-gencontrol -isp -p$(CRYPTO) -Pdebian/$(CRYPTO)-tmp
        dpkg --build debian/$(CRYPTO)-tmp ..
 

Modified: trunk/testset/tags.libbaz
===================================================================
--- trunk/testset/tags.libbaz   2008-01-03 02:54:35 UTC (rev 1087)
+++ trunk/testset/tags.libbaz   2008-01-03 02:56:27 UTC (rev 1088)
@@ -1,5 +1,7 @@
 E: libbaz source: not-binnmuable-any-depends-any libbaz1-dev -> libbaz1
 E: libbaz1: control-file-has-bad-permissions shlibs 0755 != 0644
+E: libbaz1: control-file-has-bad-permissions symbols 0755 != 0644
+E: libbaz1: debian-changelog-file-missing-or-wrong-name
 E: libbaz1: duplicate-entry-in-shlibs-control-file libdoesntexist2 1.0
 E: libbaz1: duplicate-entry-in-shlibs-control-file udeb: libdoesntexist2 1.0
 E: libbaz1: file-directly-in-usr-share-doc usr/share/doc/README.Debian
@@ -11,28 +13,34 @@
 E: libbaz1: shlib-missing-in-control-file libbaz2 1.0 for 
usr/lib/libfoo2.so.1.0.3b
 E: libbaz1: shlib-with-executable-bit usr/lib/libfoo2.so.1.0.3b 0755
 E: libbaz1: shlib-with-non-pic-code usr/lib/libbaz3.so.1.0.3b
+E: libbaz1: symbols-file-contains-current-version-with-debian-revision on 
symbol pw
 E: libbaz1: unstripped-binary-or-object ./usr/lib/libbaz1.so.1.0.3b
 E: libbaz1: unstripped-binary-or-object ./usr/lib/libbaz3.so.1.0.3b
 E: libbaz1: unstripped-binary-or-object ./usr/lib/libfoo2.so.1.0.3b
-E: libbaz2-dbg: changelog-file-missing-in-native-package
+E: libbaz2-dbg: debian-changelog-file-missing
+E: libbaz2-dev: debian-changelog-file-missing-or-wrong-name
+E: libbaz2: debian-changelog-file-missing-or-wrong-name
 I: libbaz source: package-lacks-versioned-build-depends-on-debhelper 5
 I: libbaz1: no-md5sums-control-file
 I: libbaz1: several-sonames-in-same-package libbaz2.so.1.0 libbaz3.so.1
 I: libbaz2-dbg: no-md5sums-control-file
 I: libbaz2-dev: no-md5sums-control-file
 I: libbaz2: no-md5sums-control-file
-N: libbaz_1.dsc overrode 4 warnings
+N: libbaz_1-1.dsc overrode 4 warnings
 W: libbaz source: ancient-standards-version 3.2.1 (current is 3.7.3)
 W: libbaz source: changelog-should-mention-nmu
-W: libbaz source: source-nmu-has-incorrect-version-number 1
+W: libbaz source: native-package-with-dash-version
+W: libbaz source: source-nmu-has-incorrect-version-number 1-1
 W: libbaz source: substvar-source-version-is-deprecated libbaz2-dev
 W: libbaz1-dev: dev-package-should-be-section-libdevel libbaz1-dev
 W: libbaz1-dev: package-contains-empty-directory usr/include/
 W: libbaz1: missing-depends-line
+W: libbaz1: new-package-should-close-itp-bug
 W: libbaz1: package-name-doesnt-match-sonames libbaz2-1.0 libbaz3-1
 W: libbaz1: postinst-should-not-set-usr-doc-link
-W: libbaz1: shlibs-declares-dependency-on-other-package libbaz1 (>> 1)
+W: libbaz1: shlibs-declares-dependency-on-other-package libbaz1 (>> 1-1)
 W: libbaz1: shlibs-declares-dependency-on-other-package libbaz2
+W: libbaz1: symbols-file-contains-debian-revision on symbol pw and 1 others
 W: libbaz1: unused-shlib-entry-in-control-file libbaz2 1.1
 W: libbaz1: unused-shlib-entry-in-control-file libbaz4 1
 W: libbaz1: unused-shlib-entry-in-control-file libbaz5 1
@@ -42,6 +50,7 @@
 W: libbaz2-dbg: debug-package-should-be-priority-extra libbaz2-dbg
 W: libbaz2-dev: changelog-file-not-compressed changelog
 W: libbaz2-dev: dev-package-should-be-section-libdevel libbaz2-dev
+W: libbaz2-dev: new-package-should-close-itp-bug
 W: libbaz2: debian-changelog-file-is-a-symlink
 W: libbaz2: package-name-doesnt-match-sonames libbaz2-1.0
 W: libbaz2: symlink-should-be-relative usr/share/doc/libbaz2/changelog.gz 
/usr/share/doc/lintian/changelog.gz

Modified: trunk/testset/tags.non-us
===================================================================
--- trunk/testset/tags.non-us   2008-01-03 02:54:35 UTC (rev 1087)
+++ trunk/testset/tags.non-us   2008-01-03 02:56:27 UTC (rev 1088)
@@ -1,9 +1,10 @@
 E: broken-crypto: no-copyright-file
-E: crypto-app: no-copyright-file
+E: crypto-app: changelog-file-missing-in-native-package
 E: non-us source: section-category-mismatch Package broken-crypto
 E: non-us source: section-category-mismatch Package nonfree-crypto-app
 E: nonfree-crypto-app: no-copyright-file
 E: patented-app: no-copyright-file
+I: crypto-app: no-md5sums-control-file
 I: patented-app: no-md5sums-control-file
 I: patented-app: non-us-spelling
 W: broken-crypto: unknown-section non-US/admin


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

Reply via email to