diff options
author | Dave Cobbley <david.j.cobbley@linux.intel.com> | 2018-08-14 10:05:37 -0700 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-08-22 21:26:31 -0400 |
commit | eb8dc40360f0cfef56fb6947cc817a547d6d9bc6 (patch) | |
tree | de291a73dc37168da6370e2cf16c347d1eba9df8 /meta-openembedded/meta-perl/recipes-perl/libdb | |
parent | 9c3cf826d853102535ead04cebc2d6023eff3032 (diff) | |
download | blackbird-openbmc-eb8dc40360f0cfef56fb6947cc817a547d6d9bc6.tar.gz blackbird-openbmc-eb8dc40360f0cfef56fb6947cc817a547d6d9bc6.zip |
[Subtree] Removing import-layers directory
As part of the move to subtrees, need to bring all the import layers
content to the top level.
Change-Id: I4a163d10898cbc6e11c27f776f60e1a470049d8f
Signed-off-by: Dave Cobbley <david.j.cobbley@linux.intel.com>
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'meta-openembedded/meta-perl/recipes-perl/libdb')
-rwxr-xr-x | meta-openembedded/meta-perl/recipes-perl/libdb/libdbd-sqlite-perl/sqlite-perl-test.pl | 69 | ||||
-rw-r--r-- | meta-openembedded/meta-perl/recipes-perl/libdb/libdbd-sqlite-perl_1.54.bb | 41 |
2 files changed, 110 insertions, 0 deletions
diff --git a/meta-openembedded/meta-perl/recipes-perl/libdb/libdbd-sqlite-perl/sqlite-perl-test.pl b/meta-openembedded/meta-perl/recipes-perl/libdb/libdbd-sqlite-perl/sqlite-perl-test.pl new file mode 100755 index 000000000..40f5916f5 --- /dev/null +++ b/meta-openembedded/meta-perl/recipes-perl/libdb/libdbd-sqlite-perl/sqlite-perl-test.pl @@ -0,0 +1,69 @@ +#! /usr/bin/env perl +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation. +# +# Copyright (C) 2013 Wind River Systems, Inc. +# +# - It tests DBI and DBD::SQLite could work correctly which means one could +# manipulate sqlite database in perl +# - The test includes create/insert/update/delete/select, the five important +# things one can do with a table +use DBI; + +sub execute_sql { + my $dbh = $_[0]; + my $sql = $_[1]; + my $sth = $dbh->prepare($sql) + or die "Couldn't prepare statement: " . $dbh->errstr; + $sth->execute(); + print "$sql\n"; + return $sth; +} + +sub select_all { + my $dbh = $_[0]; + my $table = $_[1]; + my $sth = &execute_sql($dbh, "Select * from $table"); + + print "-----------------------------------\n"; + while (@data = $sth->fetchrow_array()) { + my $name = $data[0]; + my $id = $data[1]; + print "$name: $id\n"; + } + print "\n"; + + $sth->finish; + return $sth; +} + +# A private, temporary in-memory database is created for the connection. +# This in-memory database will vanish when the database connection is +# closed. It is handy for your library tests. +my $dbfile = ":memory:"; +my $dbh = DBI->connect("DBI:SQLite:dbname=$dbfile","","") + or die "Couldn't connect to database: " . DBI->errstr; +print "Connect to SQLite's in-memory database\n"; + +&execute_sql($dbh, "Create table tbl1(name varchar(10), id smallint)"); +&execute_sql($dbh, "Insert into tbl1 values('yocto',10)"); +&execute_sql($dbh, "Insert into tbl1 values('windriver', 20)"); +&select_all($dbh, "tbl1"); + +&execute_sql($dbh, "Update tbl1 set name = 'oe-core' where id = 10"); +&execute_sql($dbh, "Delete from tbl1 where id = 20"); +&select_all($dbh, "tbl1"); + +$dbh->disconnect; +print "Test Success\n" diff --git a/meta-openembedded/meta-perl/recipes-perl/libdb/libdbd-sqlite-perl_1.54.bb b/meta-openembedded/meta-perl/recipes-perl/libdb/libdbd-sqlite-perl_1.54.bb new file mode 100644 index 000000000..c72e536de --- /dev/null +++ b/meta-openembedded/meta-perl/recipes-perl/libdb/libdbd-sqlite-perl_1.54.bb @@ -0,0 +1,41 @@ +SUMMARY = "A Perl DBI driver for SQLite" +DESCRIPTION = "DBD::SQLite is a Perl DBI driver for SQLite, that includes the entire \ +thing in the distribution. So in order to get a fast transaction capable \ +RDBMS working for your perl project you simply have to install this \ +module, and nothing else. \ +" +HOMEPAGE = "http://search.cpan.org/~ishigaki/DBD-SQLite/" + +SECTION = "libs" +LICENSE = "Artistic-1.0 | GPL-1.0+" +DEPENDS += "libdbi-perl-native" +RDEPENDS_${PN} += "libdbi-perl \ + sqlite3 \ + perl-module-constant \ + perl-module-locale \ + perl-module-tie-hash \ +" + +LIC_FILES_CHKSUM = "file://LICENSE;md5=1726e2117494ba3e13e1c3d93f795360" + +SRC_URI = "http://search.cpan.org/CPAN/authors/id/I/IS/ISHIGAKI/DBD-SQLite-${PV}.tar.gz \ + file://sqlite-perl-test.pl \ +" + +SRC_URI[md5sum] = "8f835ddacb9a4a92a52bbe2d24d18a8e" +SRC_URI[sha256sum] = "3929a6dbd8d71630f0cb57f85dcef9588cd7ac4c9fa12db79df77b9d3a4d7269" + +UPSTREAM_CHECK_REGEX = "DBD\-SQLite\-(?P<pver>(\d+\.\d+))(?!_\d+).tar" + +S = "${WORKDIR}/DBD-SQLite-${PV}" + +inherit cpan + +BBCLASSEXTEND = "native" + +do_install_append() { + if [ ${PERL_DBM_TEST} = "1" ]; then + install -m 755 -D ${WORKDIR}/sqlite-perl-test.pl ${D}/${bindir}/sqlite-perl-test.pl + fi +} + |