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

[SCM] Debian package checker branch, master, updated. 2.4.3-161-g2d27e5d



The following commit has been merged in the master branch:
commit 7c6d621d85a434ce84e3c5c21a2caed57333c05a
Author: Raphael Geissert <atomo64@gmail.com>
Date:   Tue Jan 25 14:30:02 2011 -0600

    Check for embedded copies of sqlite/sqlite3

diff --git a/checks/binaries b/checks/binaries
index a4d2bb6..b15fceb 100644
--- a/checks/binaries
+++ b/checks/binaries
@@ -85,6 +85,7 @@ our %EMBEDDED_LIBRARIES = (
 	'libgd2'	=> qr'gd-(?:png|jpeg:) error:',
 	'ncurses'	=> qr'Not enough memory to create terminal structure',
 	'openssl'	=> qr'You need to read the OpenSSL FAQ',
+	'sqlite'	=> {source => qr'sqlite3?', match => qr'CREATE TABLE sqlite_master\('},
 );
 
 our $multiarch;
@@ -317,8 +318,14 @@ foreach my $file (@{$info->sorted_file_info}) {
     }
 
     while (my ($src, $regex) = each %EMBEDDED_LIBRARIES) {
-	if ($info->field('source') ne $src
-	    and $strings =~ /$regex/) {
+	if (ref $regex eq 'HASH') {
+	    next if ($info->field('source') =~ m/$regex->{'source'}/);
+
+	    $regex = $regex->{'match'};
+	} elsif ($info->field('source') eq $src) {
+	    next;
+	}
+	if ($strings =~ /$regex/) {
 	    tag "embedded-library", "$file: $src";
 	}
     }
diff --git a/t/tests/binaries-embedded-libs/debian/Makefile b/t/tests/binaries-embedded-libs/debian/Makefile
index 323aeb8..7149934 100644
--- a/t/tests/binaries-embedded-libs/debian/Makefile
+++ b/t/tests/binaries-embedded-libs/debian/Makefile
@@ -1,5 +1,5 @@
 BINARIES :=  zlib libpng libjpeg libopenjpeg libtiff libpcre3 libbz2 libxml2 \
-		libmagic libexpat
+		libmagic libexpat libsqlite
 MANPAGES := $(patsubst %,%.1,$(BINARIES))
 
 all: $(BINARIES) $(MANPAGES)
diff --git a/t/tests/binaries-embedded-libs/debian/libsqlite.c b/t/tests/binaries-embedded-libs/debian/libsqlite.c
new file mode 100644
index 0000000..1d2020c
--- /dev/null
+++ b/t/tests/binaries-embedded-libs/debian/libsqlite.c
@@ -0,0 +1,13 @@
+#include <stdio.h>
+
+/*
+ * the sqlite_master table is used by sqlite 2 and 3
+ */
+static const char sqlite_create[]
+    = "CREATE TABLE sqlite_master( foo bar moo)";
+
+int
+main(void)
+{
+    printf("%s\n", sqlite_create);
+}
diff --git a/t/tests/binaries-embedded-libs/tags b/t/tests/binaries-embedded-libs/tags
index 8d03637..1619d0a 100644
--- a/t/tests/binaries-embedded-libs/tags
+++ b/t/tests/binaries-embedded-libs/tags
@@ -5,6 +5,7 @@ E: binaries-embedded-libs: embedded-library usr/bin/libbz2: bzip2
 E: binaries-embedded-libs: embedded-library usr/bin/libexpat: expat
 E: binaries-embedded-libs: embedded-library usr/bin/libmagic: file
 E: binaries-embedded-libs: embedded-library usr/bin/libpcre3: pcre3
+E: binaries-embedded-libs: embedded-library usr/bin/libsqlite: sqlite
 E: binaries-embedded-libs: embedded-library usr/bin/libtiff: tiff
 E: binaries-embedded-libs: embedded-library usr/bin/libxml2: libxml2
 E: binaries-embedded-libs: embedded-zlib usr/bin/zlib

-- 
Debian package checker


Reply to: