[nodejs-sqlite3/f18] Update to 2.1.7 upstream release

Tom Hughes tomh at fedoraproject.org
Sun May 5 11:33:08 UTC 2013


commit b3ddff955a6d4d3d28072bbdb2280514c3125da6
Author: Tom Hughes <tom at compton.nu>
Date:   Sun May 5 11:37:03 2013 +0100

    Update to 2.1.7 upstream release

 .gitignore                 |    1 +
 nodejs-sqlite3-tests.patch |   80 +++++++++++++++++++++++++++++++++++++++++
 nodejs-sqlite3-uv.patch    |   85 --------------------------------------------
 nodejs-sqlite3.spec        |   47 ++++++++++++++----------
 sources                    |    2 +-
 5 files changed, 110 insertions(+), 105 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 34283d8..0493940 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
 /sqlite3-2.1.5.tgz
+/sqlite3-2.1.7.tgz
diff --git a/nodejs-sqlite3-tests.patch b/nodejs-sqlite3-tests.patch
new file mode 100644
index 0000000..d7db5b2
--- /dev/null
+++ b/nodejs-sqlite3-tests.patch
@@ -0,0 +1,80 @@
+commit bb918b47de4953557cfdb561c77391de5cc8adc2
+Author: Tom Hughes <tom at compton.nu>
+Date:   Thu Mar 21 00:48:22 2013 +0000
+
+    Make sure the INSERT completes before trying the SELECT
+
+diff --git a/test/other_objects.test.js b/test/other_objects.test.js
+index 136913a..1559517 100644
+--- a/test/other_objects.test.js
++++ b/test/other_objects.test.js
+@@ -17,21 +17,25 @@ describe('data types', function() {
+ 
+     it('should serialize Date()', function(done) {
+         var date = new Date();
+-        db.run("INSERT INTO int_table VALUES(?)", date);
+-        db.get("SELECT int FROM int_table", function(err, row) {
++        db.run("INSERT INTO int_table VALUES(?)", date, function (err) {
+             if (err) throw err;
+-            assert.equal(row.int, +date);
+-            done();
++            db.get("SELECT int FROM int_table", function(err, row) {
++                if (err) throw err;
++                assert.equal(row.int, +date);
++                done();
++            });
+         });
+     });
+ 
+     it('should serialize RegExp()', function(done) {
+         var regexp = /^f\noo/;
+-        db.run("INSERT INTO txt_table VALUES(?)", regexp);
+-        db.get("SELECT txt FROM txt_table", function(err, row) {
++        db.run("INSERT INTO txt_table VALUES(?)", regexp, function (err) {
+             if (err) throw err;
+-            assert.equal(row.txt, String(regexp));
+-            done();
++            db.get("SELECT txt FROM txt_table", function(err, row) {
++                if (err) throw err;
++                assert.equal(row.txt, String(regexp));
++                done();
++            });
+         });
+     });
+ 
+@@ -49,11 +53,13 @@ describe('data types', function() {
+         -Infinity
+     ].forEach(function(flt) {
+         it('should serialize float ' + flt, function(done) {
+-            db.run("INSERT INTO flt_table VALUES(?)", flt);
+-            db.get("SELECT flt FROM flt_table", function(err, row) {
++            db.run("INSERT INTO flt_table VALUES(?)", flt, function (err) {
+                 if (err) throw err;
+-                assert.equal(row.flt, flt);
+-                done();
++                db.get("SELECT flt FROM flt_table", function(err, row) {
++                    if (err) throw err;
++                    assert.equal(row.flt, flt);
++                    done();
++                });
+             });
+         });
+     });
+@@ -70,11 +76,13 @@ describe('data types', function() {
+         -Infinity
+     ].forEach(function(integer) {
+         it('should serialize integer ' + integer, function(done) {
+-            db.run("INSERT INTO int_table VALUES(?)", integer);
+-            db.get("SELECT int AS integer FROM int_table", function(err, row) {
++            db.run("INSERT INTO int_table VALUES(?)", integer, function (err) {
+                 if (err) throw err;
+-                assert.equal(row.integer, integer);
+-                done();
++                db.get("SELECT int AS integer FROM int_table", function(err, row) {
++                    if (err) throw err;
++                    assert.equal(row.integer, integer);
++                    done();
++                });
+             });
+         });
+     });
diff --git a/nodejs-sqlite3.spec b/nodejs-sqlite3.spec
index feec404..dcf7a96 100644
--- a/nodejs-sqlite3.spec
+++ b/nodejs-sqlite3.spec
@@ -1,8 +1,8 @@
-%global enable_tests 0
+%global enable_tests 1
 
 Name:           nodejs-sqlite3
-Version:        2.1.5
-Release:        4%{?dist}
+Version:        2.1.7
+Release:        1%{?dist}
 Summary:        Asynchronous, non-blocking SQLite3 bindings for Node.js
 
 License:        BSD
@@ -14,10 +14,10 @@ Patch0:         nodejs-sqlite3-libraries.patch
 Patch1:         nodejs-sqlite3-paths.patch
 # Offered upstream - https://github.com/developmentseed/node-sqlite3/pull/117
 Patch2:         nodejs-sqlite3-async.patch
-# Offered upstream - https://github.com/developmentseed/node-sqlite3/pull/125
-Patch3:         nodejs-sqlite3-uv.patch
-# Will discuss with upstream
-Patch4:         nodejs-sqlite3-callbacks.patch
+# Offered upstream - https://github.com/developmentseed/node-sqlite3/pull/121
+Patch3:         nodejs-sqlite3-callbacks.patch
+# Offered upstream - https://github.com/developmentseed/node-sqlite3/pull/132
+Patch4:         nodejs-sqlite3-tests.patch
 
 ExclusiveArch:  %{ix86} x86_64 %{arm}
 
@@ -26,10 +26,12 @@ BuildRequires:  node-gyp
 BuildRequires:  sqlite-devel
 
 %if 0%{?enable_tests}
-BuildRequires:  npm(expresso)
+BuildRequires:  npm(mocha)
 BuildRequires:  npm(step)
 %endif
 
+%{?nodejs_default_filter}
+
 %description
 %summary
 
@@ -39,8 +41,8 @@ BuildRequires:  npm(step)
 %patch0 -p0 -b .libraries
 %patch1 -p0
 %patch2 -p1 -b .async
-%patch3 -p1 -b .uv
-%patch4 -p1 -b .callbacks
+%patch3 -p1 -b .callbacks
+%patch4 -p1 -b .tests
 rm -rf deps node_modules
 
 
@@ -49,15 +51,6 @@ export CXXFLAGS="%{optflags}"
 node-gyp rebuild
 
 
-%if 0%{?enable_tests}
-%check
-ln -s Release/node_sqlite3.node build/node_sqlite3.node
-%{__nodejs} test/support/createdb.js
-mkdir test/tmp
-%{nodejs_sitelib}/expresso/bin/expresso test/*.test.js
-%endif
-
-
 %install
 mkdir -p %{buildroot}/%{nodejs_sitearch}/sqlite3
 cp -pr package.json lib %{buildroot}/%{nodejs_sitearch}/sqlite3
@@ -66,12 +59,28 @@ install -p -D -m0755 build/Release/node_sqlite3.node %{buildroot}%{nodejs_sitear
 %nodejs_symlink_deps
 
 
+%if 0%{?enable_tests}
+%check
+%nodejs_symlink_deps --check
+ln -s Release/node_sqlite3.node build/node_sqlite3.node
+%{__nodejs} test/support/createdb.js
+mkdir test/tmp
+NODE_PATH=lib %{nodejs_sitelib}/mocha/bin/mocha -R spec -t 120000
+%endif
+
+
 %files
 %doc LICENSE README.md examples
 %{nodejs_sitearch}/sqlite3
 
 
 %changelog
+* Thu Mar 21 2013 Tom Hughes <tom at compton.nu> - 2.1.7-1
+- Update to 2.1.7 upstream release
+- Switch to running tests using mocha
+- Filter out provide for Node.js native extension
+- Enable tests
+
 * Wed Mar 13 2013 Tom Hughes <tom at compton.nu> - 2.1.5-4
 - Restrict supported architectures using ExclusiveArch
 - Rebuild against node 0.10
diff --git a/sources b/sources
index 499e94a..7100fcb 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-130336370ebcbf205244d8b02aa9c7e1  sqlite3-2.1.5.tgz
+5625fbba4306656c32ab27ac3148e9f5  sqlite3-2.1.7.tgz


More information about the scm-commits mailing list