From 857814effa6bd5551fd1c4371fd36e9029cdbb65 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Mar 31 2016 15:09:08 +0000 Subject: Add test patch for node 5.x compatibility --- diff --git a/nodejs-tar-node5.patch b/nodejs-tar-node5.patch new file mode 100644 index 0000000..eae78ec --- /dev/null +++ b/nodejs-tar-node5.patch @@ -0,0 +1,39 @@ +commit 5e7484daa56a7932b6d1bf7c00474d55c20420da +Author: Tom Hughes +Date: Thu Mar 31 16:05:12 2016 +0100 + + Fix tests for Node.js 5 + + As it is the compressed stream that is truncated, it is the gunzip + stream that reports the end of file error now. + +diff --git a/.travis.yml b/.travis.yml +index fca8ef0..e2c1d11 100644 +--- a/.travis.yml ++++ b/.travis.yml +@@ -2,3 +2,5 @@ language: node_js + node_js: + - 0.10 + - 0.11 ++ - 4 ++ - 5 +diff --git a/test/error-on-broken.js b/test/error-on-broken.js +index e484920..7bc82c6 100644 +--- a/test/error-on-broken.js ++++ b/test/error-on-broken.js +@@ -18,8 +18,14 @@ tap.test('preclean', function (t) { + tap.test('extract test', function (t) { + var extract = tar.Extract(target) + var inp = fs.createReadStream(file) ++ var gunzip = inp.pipe(zlib.createGunzip()) + +- inp.pipe(zlib.createGunzip()).pipe(extract) ++ gunzip.pipe(extract) ++ ++ gunzip.on('error', function (er) { ++ t.equal(er.message, 'unexpected end of file') ++ t.end() ++ }) + + extract.on('error', function (er) { + t.equal(er.message, 'unexpected eof', 'error noticed') diff --git a/nodejs-tar.spec b/nodejs-tar.spec index c375243..ed68aa6 100644 --- a/nodejs-tar.spec +++ b/nodejs-tar.spec @@ -2,12 +2,14 @@ Name: nodejs-tar Version: 2.2.1 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Tar for Node.js License: BSD Group: System Environment/Libraries URL: https://github.com/isaacs/node-tar Source0: https://registry.npmjs.org/tar/-/tar-%{version}.tgz +# https://github.com/npm/node-tar/pull/68 +Patch0: nodejs-tar-node5.patch BuildArch: noarch ExclusiveArch: %{nodejs_arches} noarch @@ -27,7 +29,7 @@ A Node.js module that supports reading and writing POSIX "tar" archives. %prep -%setup -q -n package +%autosetup -p 1 -n package %build @@ -52,6 +54,9 @@ cp -pr package.json tar.js lib %{buildroot}%{nodejs_sitelib}/tar %changelog +* Thu Mar 31 2016 Tom Hughes - 2.2.1-3 +- Add test patch for nodes 5.x compatibility + * Thu Feb 04 2016 Fedora Release Engineering - 2.2.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild