[nodejs-batch] Initial import
Jamie Nguyen
jamielinux at fedoraproject.org
Wed Mar 12 12:34:07 UTC 2014
commit dfb5576e9aacf86c3f19a669e784e39898c94913
Author: Jamie Nguyen <j at jamielinux.com>
Date: Wed Mar 12 12:33:54 2014 +0000
Initial import
.gitignore | 3 +
dl-tests.sh | 25 ++++++
nodejs-batch-0.5.0-Fix-missing-semicolon.patch | 26 ++++++
...s-batch-0.5.0-Fix-test-should.be.a-number.patch | 44 +++++++++++
nodejs-batch.spec | 82 ++++++++++++++++++++
sources | 3 +
6 files changed, 183 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..b3c98d9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1,3 @@
+/batch-0.5.0.tgz
+/examples-0.5.0.tar.bz2
+/tests-0.5.0.tar.bz2
diff --git a/dl-tests.sh b/dl-tests.sh
new file mode 100644
index 0000000..b1c31e2
--- /dev/null
+++ b/dl-tests.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+tag=0.5.0
+
+set -e
+
+tmp=$(mktemp -d)
+
+trap cleanup EXIT
+cleanup() {
+ set +e
+ [ -z "$tmp" -o ! -d "$tmp" ] || rm -rf "$tmp"
+}
+
+unset CDPATH
+pwd=$(pwd)
+
+pushd "$tmp"
+git clone git://github.com/visionmedia/batch.git
+cd batch
+git archive --prefix="test/" --format=tar tags/${tag}:test/ \
+ | bzip2 > "$pwd"/tests-${tag}.tar.bz2
+git archive --prefix="examples/" --format=tar tags/${tag}:examples/ \
+ | bzip2 > "$pwd"/examples-${tag}.tar.bz2
+popd
diff --git a/nodejs-batch-0.5.0-Fix-missing-semicolon.patch b/nodejs-batch-0.5.0-Fix-missing-semicolon.patch
new file mode 100644
index 0000000..dd996d5
--- /dev/null
+++ b/nodejs-batch-0.5.0-Fix-missing-semicolon.patch
@@ -0,0 +1,26 @@
+From 8a12ad8d352336cd1ab58785e490c3d8ae129a47 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Mathieu=20Gall=C3=A9-Tessonneau?=
+ <mathieu.galletessonneau at gmail.com>
+Date: Wed, 6 Nov 2013 20:59:06 +0100
+Subject: [PATCH 1/2] fix missing semicolon
+
+---
+ index.js | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/index.js b/index.js
+index 932d404..c2cbe46 100644
+--- a/index.js
++++ b/index.js
+@@ -142,7 +142,7 @@ Batch.prototype.end = function(cb){
+ duration: end - start
+ });
+
+- if (--pending) next()
++ if (--pending) next();
+ else if(!throws) cb(errors, results);
+ else cb(null, results);
+ }
+--
+1.8.5.3
+
diff --git a/nodejs-batch-0.5.0-Fix-test-should.be.a-number.patch b/nodejs-batch-0.5.0-Fix-test-should.be.a-number.patch
new file mode 100644
index 0000000..180ee06
--- /dev/null
+++ b/nodejs-batch-0.5.0-Fix-test-should.be.a-number.patch
@@ -0,0 +1,44 @@
+From d4c9ef6f157a765c0bc5e63486be44f9cd95c67e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Mathieu=20Gall=C3=A9-Tessonneau?=
+ <mathieu.galletessonneau at gmail.com>
+Date: Wed, 6 Nov 2013 21:15:16 +0100
+Subject: [PATCH 2/2] fix test, .should.be.a('number') isn't valid
+
+---
+ test/batch.js | 14 +++++++-------
+ 1 file changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/test/batch.js b/test/batch.js
+index 8e12301..af9e664 100644
+--- a/test/batch.js
++++ b/test/batch.js
+@@ -70,19 +70,19 @@ describe('Batch', function(){
+ switch (e.index) {
+ case 0:
+ e.value.should.equal('foo');
+- e.percent.should.be.a('number');
+- e.total.should.be.a('number');
+- e.complete.should.be.a('number');
+- e.pending.should.be.a('number');
+- e.duration.should.be.a('number');
++ e.percent.should.be.a.Number;
++ e.total.should.be.a.Number;
++ e.complete.should.be.a.Number;
++ e.pending.should.be.a.Number;
++ e.duration.should.be.a.Number;
+ break;
+ case 1:
+ e.value.should.equal('bar');
+- e.percent.should.be.a('number');
++ e.percent.should.be.a.Number;
+ break;
+ case 2:
+ e.value.should.equal('baz');
+- e.percent.should.be.a('number');
++ e.percent.should.be.a.Number;
+ break;
+ }
+
+--
+1.8.5.3
+
diff --git a/nodejs-batch.spec b/nodejs-batch.spec
new file mode 100644
index 0000000..802cac8
--- /dev/null
+++ b/nodejs-batch.spec
@@ -0,0 +1,82 @@
+%{?nodejs_find_provides_and_requires}
+
+%global enable_tests 1
+
+Name: nodejs-batch
+Version: 0.5.0
+Release: 2%{?dist}
+Summary: Asynchronous batch module with concurrency control and progress reporting
+License: MIT
+Group: System Environment/Libraries
+URL: https://github.com/visionmedia/batch
+Source0: http://registry.npmjs.org/batch/-/batch-%{version}.tgz
+# The test/ and examples/ folders are not included in the npm tarball.
+# Source1 and Source2 are generated by running Source10, which pulls from the
+# upstream version control repository.
+Source1: tests-%{version}.tar.bz2
+Source2: examples-%{version}.tar.bz2
+Source10: dl-tests.sh
+
+# Fix missing semicolon.
+# https://github.com/visionmedia/batch/commit/8a12ad8d352336cd1ab58785e490c3d8ae129a47
+Patch0: %{name}-0.5.0-Fix-missing-semicolon.patch
+# Fix test .should.be.a.('number') isn't valid.
+# https://github.com/visionmedia/batch/commit/d4c9ef6f157a765c0bc5e63486be44f9cd95c67e
+Patch1: %{name}-0.5.0-Fix-test-should.be.a-number.patch
+
+BuildArch: noarch
+%if 0%{?fedora} >= 19
+ExclusiveArch: %{nodejs_arches} noarch
+%else
+ExclusiveArch: %{ix86} x86_64 %{arm} noarch
+%endif
+
+BuildRequires: nodejs-packaging
+
+%if 0%{?enable_tests}
+BuildRequires: mocha
+BuildRequires: npm(should)
+%endif
+
+%description
+%{summary}.
+
+
+%prep
+%setup -q -n package
+%setup -q -T -D -a 1 -n package
+%setup -q -T -D -a 2 -n package
+%patch0 -p1
+%patch1 -p1
+
+
+%build
+#nothing to do
+
+
+%install
+mkdir -p %{buildroot}%{nodejs_sitelib}/batch
+cp -pr package.json index.js \
+ %{buildroot}%{nodejs_sitelib}/batch
+
+%nodejs_symlink_deps
+
+
+%if 0%{?enable_tests}
+%check
+%nodejs_symlink_deps --check
+/usr/bin/mocha --require should
+%endif
+
+
+%files
+%doc History.md Readme.md examples/
+%{nodejs_sitelib}/batch
+
+
+%changelog
+* Tue Mar 11 2014 Jamie Nguyen <jamielinux at fedoraproject.org> - 0.5.0-2
+- add History.md
+
+* Sun Mar 02 2014 Jamie Nguyen <jamielinux at fedoraproject.org> - 0.5.0-1
+- initial package
diff --git a/sources b/sources
index e69de29..087a145 100644
--- a/sources
+++ b/sources
@@ -0,0 +1,3 @@
+f49e162fa64563c80540b6d6b6a77843 batch-0.5.0.tgz
+c303eb6327a2d8233fdf04897ea90d7a examples-0.5.0.tar.bz2
+077a567659e7349e62141f3e62a20dbe tests-0.5.0.tar.bz2
More information about the scm-commits
mailing list