[nodejs-sqlite3] Update to 2.1.7 upstream release

Tom Hughes tomh at fedoraproject.org
Sun May 5 10:37:33 UTC 2013


commit 80755f2e7eab40abc132f88c7aeeae9a159b812d
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 |   95 ++++++++++++++++++++++++++++++++++---------
 nodejs-sqlite3-uv.patch    |   85 ---------------------------------------
 nodejs-sqlite3.spec        |   46 +++++++++++----------
 sources                    |    2 +-
 5 files changed, 102 insertions(+), 127 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
index c166411..d7db5b2 100644
--- a/nodejs-sqlite3-tests.patch
+++ b/nodejs-sqlite3-tests.patch
@@ -1,25 +1,80 @@
-diff --git a/test/scheduling.test.js b/test/scheduling.test.js
-index d28d2be..7947826 100644
---- a/test/scheduling.test.js
-+++ b/test/scheduling.test.js
-@@ -30,7 +30,7 @@ exports['test scheduling a query with callback after the database was closed'] =
+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() {
  
-     db.close();
-     db.run("CREATE TABLE foo (id int)", function(err) {
--        assert.ok(err.message, "SQLITE_MISUSE: Database handle is closed");
-+        assert.equal(err.message, "SQLITE_MISUSE: Database handle is closed");
-         error = true;
+     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,7 +49,10 @@ exports['test running a query after the database was closed'] = function(beforeE
-         db.close(function(err) {
-             assert.ok(err);
-             error = true;
--            assert.equal(err.message, "SQLITE_BUSY: unable to close due to unfinalised statements");
-+            assert.ok(
-+              err.message == "SQLITE_BUSY: unable to close due to unfinalised statements" ||
-+              err.message == "SQLITE_BUSY: unable to close due to unfinalized statements or unfinished backups"
-+            );
-             stmt.run();
+@@ -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 c90f5b4..f97722c 100644
--- a/nodejs-sqlite3.spec
+++ b/nodejs-sqlite3.spec
@@ -1,8 +1,8 @@
 %global enable_tests 1
 
 Name:           nodejs-sqlite3
-Version:        2.1.5
-Release:        5%{?dist}
+Version:        2.1.7
+Release:        1%{?dist}
 Summary:        Asynchronous, non-blocking SQLite3 bindings for Node.js
 
 License:        BSD
@@ -14,12 +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
 # Offered upstream - https://github.com/developmentseed/node-sqlite3/pull/121
-Patch4:         nodejs-sqlite3-callbacks.patch
-# Offered upstream - https://github.com/developmentseed/node-sqlite3/pull/122
-Patch5:         nodejs-sqlite3-tests.patch
+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}
 
@@ -28,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
 
@@ -41,9 +41,8 @@ BuildRequires:  npm(step)
 %patch0 -p0 -b .libraries
 %patch1 -p0
 %patch2 -p1 -b .async
-%patch3 -p1 -b .uv
-%patch4 -p1 -b .callbacks
-%patch5 -p1 -b .tests
+%patch3 -p1 -b .callbacks
+%patch4 -p1 -b .tests
 rm -rf deps node_modules
 
 
@@ -52,16 +51,6 @@ export CXXFLAGS="%{optflags}"
 node-gyp rebuild
 
 
-%if 0%{?enable_tests}
-%check
-ln -s %{nodejs_sitelib} .
-ln -s Release/node_sqlite3.node build/node_sqlite3.node
-%{__nodejs} test/support/createdb.js
-mkdir test/tmp
-NODE_PATH=lib %{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
@@ -70,12 +59,27 @@ 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
+
 * Wed Mar 13 2013 Tom Hughes <tom at compton.nu> - 2.1.5-5
 - 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