!1 package init

Merge pull request !1 from wang_yue111/master
This commit is contained in:
openeuler-ci-bot 2020-08-21 00:11:12 +08:00 committed by Gitee
commit 3048c9a995
4 changed files with 83 additions and 0 deletions

39
nodejs-tar-node5.patch Normal file
View File

@ -0,0 +1,39 @@
commit 5e7484daa56a7932b6d1bf7c00474d55c20420da
Author: Tom Hughes <tom@compton.nu>
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')

39
nodejs-tar.spec Normal file
View File

@ -0,0 +1,39 @@
%{?nodejs_find_provides_and_requires}
Name: nodejs-tar
Version: 2.2.1
Release: 1
Summary: Tar for Node.js
License: BSD
URL: https://github.com/isaacs/node-tar
Source0: https://registry.npmjs.org/tar/-/tar-%{version}.tgz
Patch0: nodejs-tar-node5.patch
BuildArch: noarch
ExclusiveArch: %{nodejs_arches} noarch
BuildRequires: nodejs-packaging
BuildRequires: npm(tap) npm(block-stream) npm(fstream) npm(graceful-fs) npm(inherits) >= 2.0.0
BuildRequires: npm(mkdirp) npm(rimraf)
%description
A Node.js module that supports reading and writing POSIX "tar" archives.
%prep
%autosetup -p 1 -n package
%build
%install
mkdir -p %{buildroot}%{nodejs_sitelib}/tar
cp -pr package.json tar.js lib %{buildroot}%{nodejs_sitelib}/tar
%nodejs_symlink_deps
%check
%nodejs_symlink_deps --check
%__tap test/*.js
%files
%doc README.md examples
%license LICENSE
%{nodejs_sitelib}/tar
%changelog
* Wed Aug 12 2020 wangyue <wangyue92@huawei.com> - 2.2.1-1
- package init

5
nodejs-tar.yaml Normal file
View File

@ -0,0 +1,5 @@
git_url: https://github.com/isaacs/node-tar
version_control: github
src_repo: isaacs/node-tar
tag_prefix: "^v"
seperator: "."

BIN
tar-2.2.1.tgz Normal file

Binary file not shown.