openSUSE Commits
Threads by month
- ----- 2025 -----
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
July 2015
- 1 participants
- 1368 discussions
Hello community,
here is the log from the commit of package nodejs-balanced-match for openSUSE:Factory checked in at 2015-07-02 22:40:07
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/nodejs-balanced-match (Old)
and /work/SRC/openSUSE:Factory/.nodejs-balanced-match.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "nodejs-balanced-match"
Changes:
--------
New Changes file:
--- /dev/null 2015-06-25 09:04:34.320025005 +0200
+++ /work/SRC/openSUSE:Factory/.nodejs-balanced-match.new/nodejs-balanced-match.changes 2015-07-02 22:40:09.000000000 +0200
@@ -0,0 +1,5 @@
+-------------------------------------------------------------------
+Sat Jun 6 04:29:51 UTC 2015 - i(a)marguerite.su
+
+- initial version 0.2.0
+
New:
----
balanced-match-0.2.0.tgz
nodejs-balanced-match.changes
nodejs-balanced-match.spec
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ nodejs-balanced-match.spec ++++++
#
# spec file for package nodejs-balanced-match
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define base_name balanced-match
Name: nodejs-balanced-match
Version: 0.2.0
Release: 0
Summary: Match balanced character pairs
License: MIT
Group: Development/Libraries/Other
Url: https://github.com/juliangruber/balanced-match
Source: http://registry.npmjs.org/%{base_name}/-/%{base_name}-%{version}.tgz
BuildRequires: nodejs-packaging
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
%nodejs_find_provides_and_requires
%description
Match balanced character pairs.
%prep
%setup -q -n package
%build
%install
mkdir -p %{buildroot}%{nodejs_modulesdir}/%{base_name}
cp -pr package.json index.js \
%{buildroot}%{nodejs_modulesdir}/%{base_name}/
%files
%defattr(-,root,root,-)
%doc README.md
%{nodejs_modulesdir}/%{base_name}
%changelog
1
0
Hello community,
here is the log from the commit of package nodejs-tar for openSUSE:Factory checked in at 2015-07-02 22:40:01
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/nodejs-tar (Old)
and /work/SRC/openSUSE:Factory/.nodejs-tar.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "nodejs-tar"
Changes:
--------
--- /work/SRC/openSUSE:Factory/nodejs-tar/nodejs-tar.changes 2015-04-27 13:03:58.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.nodejs-tar.new/nodejs-tar.changes 2015-07-02 22:40:02.000000000 +0200
@@ -1,0 +2,10 @@
+Sat Jun 6 13:00:48 UTC 2015 - i(a)marguerite.su
+
+- update version 2.1.1
+
+-------------------------------------------------------------------
+Fri Apr 24 12:59:52 UTC 2015 - hvogel(a)suse.com
+
+- Update to version 2.1.0
+
+-------------------------------------------------------------------
Old:
----
tar-1.0.1.tgz
New:
----
tar-2.1.1.tgz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ nodejs-tar.spec ++++++
--- /var/tmp/diff_new_pack.uLuNYU/_old 2015-07-02 22:40:03.000000000 +0200
+++ /var/tmp/diff_new_pack.uLuNYU/_new 2015-07-02 22:40:03.000000000 +0200
@@ -19,10 +19,10 @@
%define base_name tar
Name: nodejs-tar
-Version: 1.0.1
+Version: 2.1.1
Release: 0
Summary: Tar for node.js
-License: BSD-2-Clause
+License: ISC
Group: Development/Languages/Other
Url: https://github.com/isaacs/node-tar
Source: http://registry.npmjs.org/%{base_name}/-/%{base_name}-%{version}.tgz
@@ -47,7 +47,7 @@
%files
%defattr(-,root,root,-)
-%doc LICENCE README.md examples
+%doc LICENSE README.md examples
%{nodejs_modulesdir}/%{base_name}
%changelog
++++++ tar-1.0.1.tgz -> tar-2.1.1.tgz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/.travis.yml new/package/.travis.yml
--- old/package/.travis.yml 2013-03-20 07:22:05.000000000 +0100
+++ new/package/.travis.yml 2014-11-28 02:45:55.000000000 +0100
@@ -1,3 +1,4 @@
language: node_js
node_js:
- - 0.6
+ - 0.10
+ - 0.11
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/LICENCE new/package/LICENCE
--- old/package/LICENCE 2014-06-24 20:07:02.000000000 +0200
+++ new/package/LICENCE 1970-01-01 01:00:00.000000000 +0100
@@ -1,25 +0,0 @@
-Copyright (c) Isaac Z. Schlueter
-All rights reserved.
-
-The BSD License
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
-``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
-TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
-BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/LICENSE new/package/LICENSE
--- old/package/LICENSE 1970-01-01 01:00:00.000000000 +0100
+++ new/package/LICENSE 2015-05-08 02:35:48.000000000 +0200
@@ -0,0 +1,12 @@
+The ISC License
+Copyright (c) Isaac Z. Schlueter and Contributors
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/README.md new/package/README.md
--- old/package/README.md 2014-06-24 22:51:52.000000000 +0200
+++ new/package/README.md 2015-04-17 08:27:57.000000000 +0200
@@ -22,7 +22,9 @@
This only works with directories, it does not work with individual files.
The optional `properties` object are used to set properties in the tar
-'Global Extended Header'.
+'Global Extended Header'. If the `fromBase` property is set to true,
+the tar will contain files relative to the path passed, and not with
+the path included.
### tar.Extract([options])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/examples/extracter.js new/package/examples/extracter.js
--- old/package/examples/extracter.js 2013-01-23 19:59:39.000000000 +0100
+++ new/package/examples/extracter.js 2014-11-28 02:45:55.000000000 +0100
@@ -1,11 +1,19 @@
var tar = require("../tar.js")
, fs = require("fs")
+
+function onError(err) {
+ console.error('An error occurred:', err)
+}
+
+function onEnd() {
+ console.log('Extracted!')
+}
+
+var extractor = tar.Extract({path: __dirname + "/extract"})
+ .on('error', onError)
+ .on('end', onEnd);
+
fs.createReadStream(__dirname + "/../test/fixtures/c.tar")
- .pipe(tar.Extract({ path: __dirname + "/extract" }))
- .on("error", function (er) {
- console.error("error here")
- })
- .on("end", function () {
- console.error("done")
- })
+ .on('error', onError)
+ .pipe(extractor);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/examples/packer.js new/package/examples/packer.js
--- old/package/examples/packer.js 2014-06-24 22:51:52.000000000 +0200
+++ new/package/examples/packer.js 2014-11-28 02:45:55.000000000 +0100
@@ -2,9 +2,23 @@
, fstream = require("fstream")
, fs = require("fs")
-var dir_destination = fs.createWriteStream('dir.tar')
+var dirDest = fs.createWriteStream('dir.tar')
+
+
+function onError(err) {
+ console.error('An error occurred:', err)
+}
+
+function onEnd() {
+ console.log('Packed!')
+}
+
+var packer = tar.Pack({ noProprietary: true })
+ .on('error', onError)
+ .on('end', onEnd);
// This must be a "directory"
fstream.Reader({ path: __dirname, type: "Directory" })
- .pipe(tar.Pack({ noProprietary: true }))
- .pipe(dir_destination)
\ No newline at end of file
+ .on('error', onError)
+ .pipe(packer)
+ .pipe(dirDest)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/lib/extract.js new/package/lib/extract.js
--- old/package/lib/extract.js 2014-06-24 20:07:02.000000000 +0200
+++ new/package/lib/extract.js 2015-04-17 09:01:18.000000000 +0200
@@ -11,10 +11,6 @@
if (!(this instanceof Extract)) return new Extract(opts)
tar.Parse.apply(this)
- // have to dump into a directory
- opts.type = "Directory"
- opts.Directory = true
-
if (typeof opts !== "object") {
opts = { path: opts }
}
@@ -47,9 +43,20 @@
entry.linkpath = entry.props.linkpath = lp
}
}
- if (entry.type !== "Link") return
- entry.linkpath = entry.props.linkpath =
- path.join(opts.path, path.join("/", entry.props.linkpath))
+ if (entry.type === "Link") {
+ entry.linkpath = entry.props.linkpath =
+ path.join(opts.path, path.join("/", entry.props.linkpath))
+ }
+
+ if (entry.type === "SymbolicLink") {
+ var dn = path.dirname(entry.path) || ""
+ var linkpath = entry.props.linkpath
+ var target = path.resolve(opts.path, dn, linkpath)
+ if (target.indexOf(opts.path) !== 0) {
+ linkpath = path.join(opts.path, path.join("/", linkpath))
+ }
+ entry.linkpath = entry.props.linkpath = linkpath
+ }
})
this._fst.on("ready", function () {
@@ -57,12 +64,21 @@
me.resume()
})
+ this._fst.on('error', function(err) {
+ me.emit('error', err)
+ })
+
+ this._fst.on('drain', function() {
+ me.emit('drain')
+ })
+
// this._fst.on("end", function () {
// console.error("\nEEEE Extract End", me._fst.path)
// })
this._fst.on("close", function () {
// console.error("\nEEEE Extract End", me._fst.path)
+ me.emit("finish")
me.emit("end")
me.emit("close")
})
@@ -72,7 +88,7 @@
Extract.prototype._streamEnd = function () {
var me = this
- if (!me._ended) me.error("unexpected eof")
+ if (!me._ended || me._entry) me.error("unexpected eof")
me._fst.end()
// my .end() is coming later.
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/lib/pack.js new/package/lib/pack.js
--- old/package/lib/pack.js 2014-06-24 20:07:02.000000000 +0200
+++ new/package/lib/pack.js 2015-04-17 08:27:57.000000000 +0200
@@ -131,7 +131,12 @@
// in the tarball to use. That way we can skip a lot of extra
// work when resolving symlinks for bundled dependencies in npm.
- var root = path.dirname((entry.root || entry).path)
+ var root = path.dirname((entry.root || entry).path);
+ if (me._global && me._global.fromBase && entry.root && entry.root.path) {
+ // user set 'fromBase: true' indicating tar root should be directory itself
+ root = entry.root.path;
+ }
+
var wprops = {}
Object.keys(entry.props || {}).forEach(function (k) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/lib/parse.js new/package/lib/parse.js
--- old/package/lib/parse.js 2014-06-24 20:07:02.000000000 +0200
+++ new/package/lib/parse.js 2015-04-17 09:01:18.000000000 +0200
@@ -61,7 +61,7 @@
// emitting "end"
Parse.prototype._streamEnd = function () {
var me = this
- if (!me._ended) me.error("unexpected eof")
+ if (!me._ended || me._entry) me.error("unexpected eof")
me.emit("end")
}
@@ -146,7 +146,7 @@
e.header = header
e.tar_file_offset = this.position
e.tar_block = this.position / 512
- this.emit("error", e)
+ return this.emit("error", e)
}
switch (tar.types[header.type]) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/package.json new/package/package.json
--- old/package/package.json 2014-08-19 21:27:39.000000000 +0200
+++ new/package/package.json 2015-05-08 02:37:15.000000000 +0200
@@ -2,7 +2,7 @@
"author": "Isaac Z. Schlueter <i(a)izs.me> (http://blog.izs.me/)",
"name": "tar",
"description": "tar for node",
- "version": "1.0.1",
+ "version": "2.1.1",
"repository": {
"type": "git",
"url": "git://github.com/isaacs/node-tar.git"
@@ -19,7 +19,8 @@
"devDependencies": {
"graceful-fs": "^3.0.2",
"rimraf": "1.x",
- "tap": "0.x"
+ "tap": "0.x",
+ "mkdirp": "^0.5.0"
},
- "license": "BSD"
+ "license": "ISC"
}
Files old/package/test/cb-never-called-1.0.1.tgz and new/package/test/cb-never-called-1.0.1.tgz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/test/dir-normalization.js new/package/test/dir-normalization.js
--- old/package/test/dir-normalization.js 1970-01-01 01:00:00.000000000 +0100
+++ new/package/test/dir-normalization.js 2015-04-15 02:40:22.000000000 +0200
@@ -0,0 +1,177 @@
+// Set the umask, so that it works the same everywhere.
+process.umask(parseInt('22', 8))
+
+var fs = require('fs')
+var path = require('path')
+
+var fstream = require('fstream')
+var test = require('tap').test
+
+var tar = require('../tar.js')
+var file = path.resolve(__dirname, 'dir-normalization.tar')
+var target = path.resolve(__dirname, 'tmp/dir-normalization-test')
+var ee = 0
+
+var expectEntries = [
+ { path: 'fixtures/',
+ mode: '755',
+ type: '5',
+ linkpath: ''
+ },
+ { path: 'fixtures/a/',
+ mode: '755',
+ type: '5',
+ linkpath: ''
+ },
+ { path: 'fixtures/the-chumbler',
+ mode: '755',
+ type: '2',
+ linkpath: path.resolve(target, 'a/b/c/d/the-chumbler'),
+ },
+ { path: 'fixtures/a/b/',
+ mode: '755',
+ type: '5',
+ linkpath: ''
+ },
+ { path: 'fixtures/a/x',
+ mode: '644',
+ type: '0',
+ linkpath: ''
+ },
+ { path: 'fixtures/a/b/c/',
+ mode: '755',
+ type: '5',
+ linkpath: ''
+ },
+ { path: 'fixtures/a/b/c/y',
+ mode: '755',
+ type: '2',
+ linkpath: '../../x',
+ }
+]
+
+var ef = 0
+var expectFiles = [
+ { path: '',
+ mode: '40755',
+ type: 'Directory',
+ depth: 0,
+ linkpath: undefined
+ },
+ { path: '/fixtures',
+ mode: '40755',
+ type: 'Directory',
+ depth: 1,
+ linkpath: undefined
+ },
+ { path: '/fixtures/a',
+ mode: '40755',
+ type: 'Directory',
+ depth: 2,
+ linkpath: undefined
+ },
+ { path: '/fixtures/a/b',
+ mode: '40755',
+ type: 'Directory',
+ depth: 3,
+ linkpath: undefined
+ },
+ { path: '/fixtures/a/b/c',
+ mode: '40755',
+ type: 'Directory',
+ depth: 4,
+ linkpath: undefined
+ },
+ { path: '/fixtures/a/b/c/y',
+ mode: '120755',
+ type: 'SymbolicLink',
+ depth: 5,
+ linkpath: '../../x'
+ },
+ { path: '/fixtures/a/x',
+ mode: '100644',
+ type: 'File',
+ depth: 3,
+ linkpath: undefined
+ },
+ { path: '/fixtures/the-chumbler',
+ mode: '120755',
+ type: 'SymbolicLink',
+ depth: 2,
+ linkpath: path.resolve(target, 'a/b/c/d/the-chumbler')
+ }
+]
+
+test('preclean', function (t) {
+ require('rimraf').sync(path.join(__dirname, '/tmp/dir-normalization-test'))
+ t.pass('cleaned!')
+ t.end()
+})
+
+test('extract test', function (t) {
+ var extract = tar.Extract(target)
+ var inp = fs.createReadStream(file)
+
+ inp.pipe(extract)
+
+ extract.on('end', function () {
+ t.equal(ee, expectEntries.length, 'should see ' + expectEntries.length + ' entries')
+
+ // should get no more entries after end
+ extract.removeAllListeners('entry')
+ extract.on('entry', function (e) {
+ t.fail('Should not get entries after end!')
+ })
+
+ next()
+ })
+
+ extract.on('entry', function (entry) {
+ var mode = entry.props.mode & (~parseInt('22', 8))
+ var found = {
+ path: entry.path,
+ mode: mode.toString(8),
+ type: entry.props.type,
+ linkpath: entry.props.linkpath,
+ }
+
+ var wanted = expectEntries[ee++]
+ t.equivalent(found, wanted, 'tar entry ' + ee + ' ' + (wanted && wanted.path))
+ })
+
+ function next () {
+ var r = fstream.Reader({
+ path: target,
+ type: 'Directory',
+ sort: 'alpha'
+ })
+
+ r.on('ready', function () {
+ foundEntry(r)
+ })
+
+ r.on('end', finish)
+
+ function foundEntry (entry) {
+ var p = entry.path.substr(target.length)
+ var mode = entry.props.mode & (~parseInt('22', 8))
+ var found = {
+ path: p,
+ mode: mode.toString(8),
+ type: entry.props.type,
+ depth: entry.props.depth,
+ linkpath: entry.props.linkpath
+ }
+
+ var wanted = expectFiles[ef++]
+ t.equivalent(found, wanted, 'unpacked file ' + ef + ' ' + (wanted && wanted.path))
+
+ entry.on('entry', foundEntry)
+ }
+
+ function finish () {
+ t.equal(ef, expectFiles.length, 'should have ' + ef + ' items')
+ t.end()
+ }
+ }
+})
Files old/package/test/dir-normalization.tar and new/package/test/dir-normalization.tar differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/test/error-on-broken.js new/package/test/error-on-broken.js
--- old/package/test/error-on-broken.js 1970-01-01 01:00:00.000000000 +0100
+++ new/package/test/error-on-broken.js 2015-04-17 09:28:49.000000000 +0200
@@ -0,0 +1,33 @@
+var fs = require('fs')
+var path = require('path')
+var zlib = require('zlib')
+
+var tap = require('tap')
+
+var tar = require('../tar.js')
+
+var file = path.join(__dirname, 'cb-never-called-1.0.1.tgz')
+var target = path.join(__dirname, 'tmp/extract-test')
+
+tap.test('preclean', function (t) {
+ require('rimraf').sync(__dirname + '/tmp/extract-test')
+ t.pass('cleaned!')
+ t.end()
+})
+
+tap.test('extract test', function (t) {
+ var extract = tar.Extract(target)
+ var inp = fs.createReadStream(file)
+
+ inp.pipe(zlib.createGunzip()).pipe(extract)
+
+ extract.on('error', function (er) {
+ t.equal(er.message, 'unexpected eof', 'error noticed')
+ t.end()
+ })
+
+ extract.on('end', function () {
+ t.fail('shouldn\'t reach this point due to errors')
+ t.end()
+ })
+})
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/test/extract.js new/package/test/extract.js
--- old/package/test/extract.js 2014-06-24 21:07:24.000000000 +0200
+++ new/package/test/extract.js 2015-04-17 08:35:53.000000000 +0200
@@ -118,7 +118,7 @@
linkpath: undefined,
nlink: 2 },
{ path: '/200LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL',
- mode: '120755',
+ mode: '120777',
type: 'SymbolicLink',
depth: 1,
size: 200,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/test/pack.js new/package/test/pack.js
--- old/package/test/pack.js 2014-08-19 21:22:05.000000000 +0200
+++ new/package/test/pack.js 2015-04-17 08:27:57.000000000 +0200
@@ -830,6 +830,10 @@
runTest(t, false)
})
+tap.test("with from base", { timeout: 10000 }, function (t) {
+ runTest(t, true, true)
+})
+
function alphasort (a, b) {
return a === b ? 0
: a.toLowerCase() > b.toLowerCase() ? 1
@@ -839,7 +843,7 @@
}
-function runTest (t, doGH) {
+function runTest (t, doGH, doFromBase) {
var reader = Reader({ path: input
, filter: function () {
return !this.path.match(/\.(tar|hex)$/)
@@ -847,7 +851,10 @@
, sort: alphasort
})
- var pack = Pack(doGH ? pkg : null)
+ var props = doGH ? pkg : {}
+ if(doFromBase) props.fromBase = true;
+
+ var pack = Pack(props)
var writer = Writer(target)
// skip the global header if we're not doing that.
@@ -901,6 +908,17 @@
}
t.equal(ev, wanted[0], "event type should be "+wanted[0])
+ if(doFromBase) {
+ if(wanted[1].path.indexOf('fixtures/') && wanted[1].path.length == 100)
+ wanted[1].path = wanted[1].path.replace('fixtures/', '') + 'ccccccccc'
+
+ if(wanted[1]) wanted[1].path = wanted[1].path.replace('fixtures/', '').replace('//', '/')
+ if(wanted[1].path == '') wanted[1].path = '/'
+ if(wanted[2] && wanted[2].path) wanted[2].path = wanted[2].path.replace('fixtures', '').replace(/^\//, '')
+
+ wanted[1].linkpath = wanted[1].linkpath.replace('fixtures/', '')
+ }
+
if (ev !== wanted[0] || e.path !== wanted[1].path) {
console.error("wanted", wanted)
console.error([ev, e.props])
1
0
Hello community,
here is the log from the commit of package nodejs-which for openSUSE:Factory checked in at 2015-07-02 22:39:56
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/nodejs-which (Old)
and /work/SRC/openSUSE:Factory/.nodejs-which.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "nodejs-which"
Changes:
--------
--- /work/SRC/openSUSE:Factory/nodejs-which/nodejs-which.changes 2015-04-27 13:02:13.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.nodejs-which.new/nodejs-which.changes 2015-07-02 22:39:56.000000000 +0200
@@ -1,0 +2,10 @@
+Sat Jun 6 13:03:36 UTC 2015 - i(a)marguerite.su
+
+- update version 1.1.1
+
+-------------------------------------------------------------------
+Fri Apr 24 13:03:05 UTC 2015 - hvogel(a)suse.com
+
+- Update to version 1.0.9
+
+-------------------------------------------------------------------
Old:
----
which-1.0.5.tgz
New:
----
which-1.1.1.tgz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ nodejs-which.spec ++++++
--- /var/tmp/diff_new_pack.omzOxW/_old 2015-07-02 22:39:57.000000000 +0200
+++ /var/tmp/diff_new_pack.omzOxW/_new 2015-07-02 22:39:57.000000000 +0200
@@ -19,10 +19,10 @@
%define base_name which
Name: nodejs-which
-Version: 1.0.5
+Version: 1.1.1
Release: 0
Summary: A which(1) command for node.js
-License: MIT
+License: ISC
Group: Development/Languages/Other
Url: https://github.com/isaacs/which
Source: http://registry.npmjs.org/%{base_name}/-/%{base_name}-%{version}.tgz
++++++ which-1.0.5.tgz -> which-1.1.1.tgz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/LICENSE new/package/LICENSE
--- old/package/LICENSE 2011-09-23 18:46:12.000000000 +0200
+++ new/package/LICENSE 2014-11-25 11:34:19.000000000 +0100
@@ -1,23 +1,15 @@
-Copyright 2009, 2010, 2011 Isaac Z. Schlueter.
-All rights reserved.
+The ISC License
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of this software and associated documentation
-files (the "Software"), to deal in the Software without
-restriction, including without limitation the rights to use,
-copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following
-conditions:
+Copyright (c) Isaac Z. Schlueter and Contributors
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/README.md new/package/README.md
--- old/package/README.md 2011-08-07 20:22:07.000000000 +0200
+++ new/package/README.md 2015-05-10 06:10:58.000000000 +0200
@@ -1,5 +1,34 @@
-The "which" util from npm's guts.
+# which
+
+Like the unix `which` utility.
Finds the first instance of a specified executable in the PATH
environment variable. Does not cache the results, so `hash -r` is not
needed when the PATH changes.
+
+## USAGE
+
+```javascript
+var which = require('which')
+
+// async usage
+which('node', function (er, resolvedPath) {
+ // er is returned if no "node" is found on the PATH
+ // if it is found, then the absolute path to the exec is returned
+})
+
+// sync usage
+// throws if not found
+var resolved = which.sync('node')
+
+// Pass options to override the PATH and PATHEXT environment vars.
+which('node', { path: someOtherPath }, function (er, resolved) {
+ if (er)
+ throw er
+ console.log('found at %j', resolved)
+})
+```
+
+## OPTIONS
+
+If you pass in options, then `path` and `pathExt` are relevant.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/package.json new/package/package.json
--- old/package/package.json 2012-03-02 01:07:38.000000000 +0100
+++ new/package/package.json 2015-05-10 06:24:18.000000000 +0200
@@ -2,16 +2,23 @@
"author": "Isaac Z. Schlueter <i(a)izs.me> (http://blog.izs.me)",
"name": "which",
"description": "Like which(1) unix command. Find the first instance of an executable in the PATH.",
- "version": "1.0.5",
+ "version": "1.1.1",
"repository": {
"type": "git",
"url": "git://github.com/isaacs/node-which.git"
},
"main": "which.js",
"bin": "./bin/which",
- "engines": {
- "node": "*"
+ "license": "ISC",
+ "dependencies": {
+ "is-absolute": "^0.1.7"
},
- "dependencies": {},
- "devDependencies": {}
+ "devDependencies": {
+ "mkdirp": "^0.5.0",
+ "rimraf": "^2.3.3",
+ "tap": "^1.0.2"
+ },
+ "scripts": {
+ "test": "tap test/*.js"
+ }
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/test/basic.js new/package/test/basic.js
--- old/package/test/basic.js 1970-01-01 01:00:00.000000000 +0100
+++ new/package/test/basic.js 2015-05-10 06:18:16.000000000 +0200
@@ -0,0 +1,84 @@
+var t = require('tap')
+var fs = require('fs')
+var rimraf = require('rimraf')
+var mkdirp = require('mkdirp')
+var fixture = __dirname + '/fixture'
+var which = require('../which.js')
+var path = require('path')
+
+var isWindows = process.platform === 'win32' ||
+ process.env.OSTYPE === 'cygwin' ||
+ process.env.OSTYPE === 'msys'
+
+var skip = { skip: isWindows ? 'not relevant on windows' : false }
+
+t.test('setup', function (t) {
+ rimraf.sync(fixture)
+ mkdirp.sync(fixture)
+ fs.writeFileSync(fixture + '/foo.sh', 'echo foo\n')
+ t.end()
+})
+
+t.test('does not find non-executable', skip, function (t) {
+ t.plan(2)
+
+ t.test('absolute', function (t) {
+ t.plan(2)
+ which(fixture + '/foo.sh', function (er) {
+ t.isa(er, Error)
+ })
+
+ t.throws(function () {
+ which.sync(fixture + '/foo.sh')
+ })
+ })
+
+ t.test('with path', function (t) {
+ t.plan(2)
+ which('foo.sh', { path: fixture }, function (er) {
+ t.isa(er, Error)
+ })
+
+ t.throws(function () {
+ which.sync('foo.sh', { path: fixture })
+ })
+ })
+})
+
+t.test('make executable', function (t) {
+ fs.chmodSync(fixture + '/foo.sh', '0755')
+ t.end()
+})
+
+t.test('find when executable', function (t) {
+ t.plan(2)
+ var opt = { pathExt: '.sh' }
+ var expect = path.resolve(fixture, 'foo.sh').toLowerCase()
+
+ t.test('absolute', function (t) {
+ t.plan(2)
+ runTest(t)
+ })
+
+ function runTest(t) {
+ which(fixture + '/foo.sh', opt, function (er, found) {
+ if (er)
+ throw er
+ t.equal(found.toLowerCase(), expect)
+ })
+
+ var found = which.sync(fixture + '/foo.sh', opt).toLowerCase()
+ t.equal(found, expect)
+ }
+
+ t.test('with path', function (t) {
+ t.plan(2)
+ opt.path = fixture
+ runTest(t)
+ })
+})
+
+t.test('clean', function (t) {
+ rimraf.sync(fixture)
+ t.end()
+})
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/which.js new/package/which.js
--- old/package/which.js 2012-03-02 01:07:21.000000000 +0100
+++ new/package/which.js 2015-05-10 06:23:16.000000000 +0200
@@ -1,57 +1,83 @@
module.exports = which
which.sync = whichSync
-var path = require("path")
- , fs
- , COLON = process.platform === "win32" ? ";" : ":"
- , isExe
-
-try {
- fs = require("graceful-fs")
-} catch (ex) {
- fs = require("fs")
-}
+var isWindows = process.platform === 'win32' ||
+ process.env.OSTYPE === 'cygwin' ||
+ process.env.OSTYPE === 'msys'
+
+var path = require('path')
+var COLON = isWindows ? ';' : ':'
+var isExe
+var fs = require('fs')
+var isAbsolute = require('is-absolute')
-if (process.platform == "win32") {
+if (isWindows) {
// On windows, there is no good way to check that a file is executable
isExe = function isExe () { return true }
} else {
isExe = function isExe (mod, uid, gid) {
- //console.error(mod, uid, gid);
- //console.error("isExe?", (mod & 0111).toString(8))
var ret = (mod & 0001)
|| (mod & 0010) && process.getgid && gid === process.getgid()
|| (mod & 0100) && process.getuid && uid === process.getuid()
- //console.error("isExe?", ret)
+ || (mod & 0110) && process.getuid && 0 === process.getuid()
+
+ if (process.getgroups && (mod & 0010)) {
+ var groups = process.getgroups()
+ for (var g = 0; g < groups.length; g++) {
+ if (groups[g] === gid)
+ return true
+ }
+ }
+
return ret
}
}
+function which (cmd, opt, cb) {
+ if (typeof opt === 'function') {
+ cb = opt
+ opt = {}
+ }
+ var colon = opt.colon || COLON
+ var pathEnv = opt.path || process.env.PATH || ''
+ var pathExt = ['']
+
+ // On windows, env.Path is common.
+ if (isWindows && !pathEnv) {
+ var k = Object.keys(process.env)
+ for (var p = 0; p < k.length; p++) {
+ if (p.toLowerCase() === 'path') {
+ pathEnv = process.env[p]
+ break
+ }
+ }
+ }
+
+ pathEnv = pathEnv.split(colon)
-function which (cmd, cb) {
- if (isAbsolute(cmd)) return cb(null, cmd)
- var pathEnv = (process.env.PATH || "").split(COLON)
- , pathExt = [""]
- if (process.platform === "win32") {
- pathEnv.push(process.cwd())
- pathExt = (process.env.PATHEXT || ".EXE").split(COLON)
- if (cmd.indexOf(".") !== -1) pathExt.unshift("")
+ if (isWindows) {
+ pathEnv.unshift(process.cwd())
+ pathExt = (opt.pathExt || process.env.PATHEXT || '.EXE').split(colon)
+ if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')
+ pathExt.unshift('')
}
- //console.error("pathEnv", pathEnv)
+
+ // If it's absolute, then we don't bother searching the pathenv.
+ // just check the file itself, and that's it.
+ if (isAbsolute(cmd))
+ pathEnv = ['']
+
;(function F (i, l) {
- if (i === l) return cb(new Error("not found: "+cmd))
+ if (i === l) return cb(new Error('not found: '+cmd))
var p = path.resolve(pathEnv[i], cmd)
;(function E (ii, ll) {
if (ii === ll) return F(i + 1, l)
var ext = pathExt[ii]
- //console.error(p + ext)
fs.stat(p + ext, function (er, stat) {
if (!er &&
- stat &&
stat.isFile() &&
isExe(stat.mode, stat.uid, stat.gid)) {
- //console.error("yes, exe!", p + ext)
return cb(null, p + ext)
}
return E(ii + 1, ll)
@@ -60,45 +86,52 @@
})(0, pathEnv.length)
}
-function whichSync (cmd) {
- if (isAbsolute(cmd)) return cmd
- var pathEnv = (process.env.PATH || "").split(COLON)
- , pathExt = [""]
- if (process.platform === "win32") {
- pathEnv.push(process.cwd())
- pathExt = (process.env.PATHEXT || ".EXE").split(COLON)
- if (cmd.indexOf(".") !== -1) pathExt.unshift("")
+function whichSync (cmd, opt) {
+ if (!opt)
+ opt = {}
+
+ var colon = opt.colon || COLON
+
+ var pathEnv = opt.path || process.env.PATH || ''
+ var pathExt = ['']
+
+ // On windows, env.Path is common.
+ if (isWindows && !pathEnv) {
+ var k = Object.keys(process.env)
+ for (var p = 0; p < k.length; p++) {
+ if (p.toLowerCase() === 'path') {
+ pathEnv = process.env[p]
+ break
+ }
+ }
}
+
+ pathEnv = pathEnv.split(colon)
+
+ if (isWindows) {
+ pathEnv.unshift(process.cwd())
+ pathExt = (opt.pathExt || process.env.PATHEXT || '.EXE').split(colon)
+ if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')
+ pathExt.unshift('')
+ }
+
+ // If it's absolute, then we don't bother searching the pathenv.
+ // just check the file itself, and that's it.
+ if (isAbsolute(cmd))
+ pathEnv = ['']
+
for (var i = 0, l = pathEnv.length; i < l; i ++) {
var p = path.join(pathEnv[i], cmd)
for (var j = 0, ll = pathExt.length; j < ll; j ++) {
var cur = p + pathExt[j]
var stat
- try { stat = fs.statSync(cur) } catch (ex) {}
- if (stat &&
- stat.isFile() &&
- isExe(stat.mode, stat.uid, stat.gid)) return cur
+ try {
+ stat = fs.statSync(cur)
+ if (stat.isFile() && isExe(stat.mode, stat.uid, stat.gid))
+ return cur
+ } catch (ex) {}
}
}
- throw new Error("not found: "+cmd)
-}
-
-var isAbsolute = process.platform === "win32" ? absWin : absUnix
-
-function absWin (p) {
- if (absUnix(p)) return true
- // pull off the device/UNC bit from a windows path.
- // from node's lib/path.js
- var splitDeviceRe =
- /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?([\\\/])?/
- , result = splitDeviceRe.exec(p)
- , device = result[1] || ''
- , isUnc = device && device.charAt(1) !== ':'
- , isAbsolute = !!result[2] || isUnc // UNC paths are always absolute
-
- return isAbsolute
-}
-function absUnix (p) {
- return p.charAt(0) === "/" || p === ""
+ throw new Error('not found: '+cmd)
}
1
0
Hello community,
here is the log from the commit of package nodejs-osenv for openSUSE:Factory checked in at 2015-07-02 22:39:48
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/nodejs-osenv (Old)
and /work/SRC/openSUSE:Factory/.nodejs-osenv.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "nodejs-osenv"
Changes:
--------
--- /work/SRC/openSUSE:Factory/nodejs-osenv/nodejs-osenv.changes 2015-04-27 13:03:25.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.nodejs-osenv.new/nodejs-osenv.changes 2015-07-02 22:39:50.000000000 +0200
@@ -1,0 +2,5 @@
+Sat Jun 6 12:55:57 UTC 2015 - i(a)marguerite.su
+
+- update version 0.1.1
+
+-------------------------------------------------------------------
Old:
----
osenv-0.1.0.tgz
New:
----
osenv-0.1.1.tgz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ nodejs-osenv.spec ++++++
--- /var/tmp/diff_new_pack.kNgAdz/_old 2015-07-02 22:39:50.000000000 +0200
+++ /var/tmp/diff_new_pack.kNgAdz/_new 2015-07-02 22:39:50.000000000 +0200
@@ -19,10 +19,10 @@
%define base_name osenv
Name: nodejs-osenv
-Version: 0.1.0
+Version: 0.1.1
Release: 0
Summary: Node.js OS specific env lookup
-License: BSD-2-Clause
+License: ISC
Group: Development/Languages/Other
Url: https://github.com/isaacs/osenv
Source: http://registry.npmjs.org/%{base_name}/-/%{base_name}-%{version}.tgz
++++++ osenv-0.1.0.tgz -> osenv-0.1.1.tgz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/LICENSE new/package/LICENSE
--- old/package/LICENSE 2014-05-26 19:39:00.000000000 +0200
+++ new/package/LICENSE 2015-05-20 09:15:20.000000000 +0200
@@ -1,27 +1,15 @@
-Copyright (c) Isaac Z. Schlueter ("Author")
-All rights reserved.
+The ISC License
-The BSD License
+Copyright (c) Isaac Z. Schlueter and Contributors
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
-1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
-2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
-BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
-BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
-IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/package.json new/package/package.json
--- old/package/package.json 2014-05-26 19:58:23.000000000 +0200
+++ new/package/package.json 2015-05-20 09:15:20.000000000 +0200
@@ -1,6 +1,6 @@
{
"name": "osenv",
- "version": "0.1.0",
+ "version": "0.1.1",
"main": "osenv.js",
"directories": {
"test": "test"
@@ -12,10 +12,7 @@
"scripts": {
"test": "tap test/*.js"
},
- "repository": {
- "type": "git",
- "url": "git://github.com/isaacs/osenv"
- },
+ "repository": "https://github.com/npm/osenv",
"keywords": [
"environment",
"variable",
@@ -26,6 +23,6 @@
"ps1"
],
"author": "Isaac Z. Schlueter <i(a)izs.me> (http://blog.izs.me/)",
- "license": "BSD",
+ "license": "ISC",
"description": "Look up environment settings specific to different operating systems"
}
1
0
Hello community,
here is the log from the commit of package nodejs-nopt for openSUSE:Factory checked in at 2015-07-02 22:39:40
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/nodejs-nopt (Old)
and /work/SRC/openSUSE:Factory/.nodejs-nopt.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "nodejs-nopt"
Changes:
--------
--- /work/SRC/openSUSE:Factory/nodejs-nopt/nodejs-nopt.changes 2015-04-27 13:03:34.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.nodejs-nopt.new/nodejs-nopt.changes 2015-07-02 22:39:41.000000000 +0200
@@ -1,0 +2,5 @@
+Sat Jun 6 12:51:32 UTC 2015 - i(a)marguerite.su
+
+- update version 3.0.2
+
+-------------------------------------------------------------------
Old:
----
nopt-3.0.1.tgz
New:
----
nopt-3.0.2.tgz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ nodejs-nopt.spec ++++++
--- /var/tmp/diff_new_pack.I089CC/_old 2015-07-02 22:39:41.000000000 +0200
+++ /var/tmp/diff_new_pack.I089CC/_new 2015-07-02 22:39:41.000000000 +0200
@@ -19,12 +19,12 @@
%define base_name nopt
Name: nodejs-nopt
-Version: 3.0.1
+Version: 3.0.2
Release: 0
Summary: Option parser
-License: MIT
+License: ISC
Group: Development/Libraries/Other
-Url: https://github.com/npm/nopt
+Url: https://github.com/isaacs/nopt
Source: http://registry.npmjs.org/%{base_name}/-/%{base_name}-%{version}.tgz
BuildRequires: nodejs-packaging
BuildRoot: %{_tmppath}/%{name}-%{version}-build
++++++ nopt-3.0.1.tgz -> nopt-3.0.2.tgz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/LICENSE new/package/LICENSE
--- old/package/LICENSE 2012-08-30 22:08:48.000000000 +0200
+++ new/package/LICENSE 2015-05-19 03:38:04.000000000 +0200
@@ -1,23 +1,15 @@
-Copyright 2009, 2010, 2011 Isaac Z. Schlueter.
-All rights reserved.
+The ISC License
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of this software and associated documentation
-files (the "Software"), to deal in the Software without
-restriction, including without limitation the rights to use,
-copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following
-conditions:
+Copyright (c) Isaac Z. Schlueter and Contributors
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/package.json new/package/package.json
--- old/package/package.json 2014-07-01 19:12:21.000000000 +0200
+++ new/package/package.json 2015-05-19 03:38:06.000000000 +0200
@@ -1,6 +1,6 @@
{
"name": "nopt",
- "version": "3.0.1",
+ "version": "3.0.2",
"description": "Option parsing for Node, supporting types, shorthands, etc. Used by npm.",
"author": "Isaac Z. Schlueter <i(a)izs.me> (http://blog.izs.me/)",
"main": "lib/nopt.js",
@@ -9,10 +9,7 @@
},
"repository": "http://github.com/isaacs/nopt",
"bin": "./bin/nopt.js",
- "license": {
- "type": "MIT",
- "url": "https://github.com/isaacs/nopt/raw/master/LICENSE"
- },
+ "license": "ISC",
"dependencies": {
"abbrev": "1"
},
1
0
Hello community,
here is the log from the commit of package nodejs-promzard for openSUSE:Factory checked in at 2015-07-02 22:39:34
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/nodejs-promzard (Old)
and /work/SRC/openSUSE:Factory/.nodejs-promzard.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "nodejs-promzard"
Changes:
--------
--- /work/SRC/openSUSE:Factory/nodejs-promzard/nodejs-promzard.changes 2015-04-27 13:03:21.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.nodejs-promzard.new/nodejs-promzard.changes 2015-07-02 22:39:36.000000000 +0200
@@ -1,0 +2,5 @@
+Sat Jun 6 11:35:42 UTC 2015 - i(a)marguerite.su
+
+- update version 0.3.0
+
+-------------------------------------------------------------------
Old:
----
promzard-0.2.2.tgz
New:
----
promzard-0.3.0.tgz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ nodejs-promzard.spec ++++++
--- /var/tmp/diff_new_pack.KBjZma/_old 2015-07-02 22:39:36.000000000 +0200
+++ /var/tmp/diff_new_pack.KBjZma/_new 2015-07-02 22:39:36.000000000 +0200
@@ -19,7 +19,7 @@
%define base_name promzard
Name: nodejs-promzard
-Version: 0.2.2
+Version: 0.3.0
Release: 0
Summary: Node.js prompting wizard
License: ISC
++++++ promzard-0.2.2.tgz -> promzard-0.3.0.tgz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/example/buffer.js new/package/example/buffer.js
--- old/package/example/buffer.js 1970-01-01 01:00:00.000000000 +0100
+++ new/package/example/buffer.js 2015-03-14 21:39:03.000000000 +0100
@@ -0,0 +1,12 @@
+var pz = require('../promzard')
+
+var path = require('path')
+var file = path.resolve(__dirname, 'substack-input.js')
+var buf = require('fs').readFileSync(file)
+var ctx = { basename: path.basename(path.dirname(file)) }
+
+pz.fromBuffer(buf, ctx, function (er, res) {
+ if (er)
+ throw er
+ console.error(JSON.stringify(res, null, 2))
+})
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/package.json new/package/package.json
--- old/package/package.json 2014-05-08 20:07:56.000000000 +0200
+++ new/package/package.json 2015-03-14 21:40:42.000000000 +0100
@@ -2,7 +2,7 @@
"author": "Isaac Z. Schlueter <i(a)izs.me> (http://blog.izs.me/)",
"name": "promzard",
"description": "prompting wizardly",
- "version": "0.2.2",
+ "version": "0.3.0",
"repository": {
"url": "git://github.com/isaacs/promzard"
},
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/promzard.js new/package/promzard.js
--- old/package/promzard.js 2014-05-08 19:46:16.000000000 +0200
+++ new/package/promzard.js 2015-03-14 21:40:30.000000000 +0100
@@ -21,6 +21,16 @@
cb(null, data)
})
}
+promzard.fromBuffer = function (buf, ctx, cb) {
+ var filename = 0
+ do {
+ filename = '\0' + Math.random();
+ } while (files[filename])
+ files[filename] = buf
+ var ret = promzard(filename, ctx, cb)
+ delete files[filename]
+ return ret
+}
function PromZard (file, ctx) {
if (!(this instanceof PromZard))
@@ -175,8 +185,14 @@
prompt[1] = this.ctx[k]
return this.prompt(prompt, function (er, res) {
- if (er)
- return this.emit('error', this.error = er);
+ if (er) {
+ if (!er.notValid) {
+ return this.emit('error', this.error = er);
+ }
+ console.log(er.message)
+ i --
+ return L.call(this)
+ }
o[k] = res
L.call(this)
}.bind(this))
@@ -206,7 +222,13 @@
if (tx) {
cb = function (cb) { return function (er, data) {
- try { return cb(er, tx(data)) }
+ try {
+ var res = tx(data)
+ if (!er && res instanceof Error && !!res.notValid) {
+ return cb(res, null)
+ }
+ return cb(er, res)
+ }
catch (er) { this.emit('error', er) }
}}(cb).bind(this)
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/test/buffer.js new/package/test/buffer.js
--- old/package/test/buffer.js 1970-01-01 01:00:00.000000000 +0100
+++ new/package/test/buffer.js 2015-03-14 21:39:19.000000000 +0100
@@ -0,0 +1,84 @@
+var tap = require('tap')
+var pz = require('../promzard.js')
+var spawn = require('child_process').spawn
+
+tap.test('run the example using a buffer', function (t) {
+
+ var example = require.resolve('../example/buffer.js')
+ var node = process.execPath
+
+ var expect = {
+ "name": "example",
+ "version": "0.0.0",
+ "description": "testing description",
+ "main": "test-entry.js",
+ "directories": {
+ "example": "example",
+ "test": "test"
+ },
+ "dependencies": {},
+ "devDependencies": {
+ "tap": "~0.2.5"
+ },
+ "scripts": {
+ "test": "tap test/*.js"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/substack/example.git"
+ },
+ "homepage": "https://github.com/substack/example",
+ "keywords": [
+ "fugazi",
+ "function",
+ "waiting",
+ "room"
+ ],
+ "author": {
+ "name": "James Halliday",
+ "email": "mail(a)substack.net",
+ "url": "http://substack.net"
+ },
+ "license": "MIT",
+ "engine": {
+ "node": ">=0.6"
+ }
+ }
+
+ var c = spawn(node, [example], { customFds: [-1,-1,-1] })
+ var output = ''
+ c.stdout.on('data', function (d) {
+ output += d
+ respond()
+ })
+
+ var actual = ''
+ c.stderr.on('data', function (d) {
+ actual += d
+ })
+
+ function respond () {
+ if (output.match(/description: $/)) {
+ c.stdin.write('testing description\n')
+ return
+ }
+ if (output.match(/entry point: \(index\.js\) $/)) {
+ c.stdin.write('test-entry.js\n')
+ return
+ }
+ if (output.match(/keywords: $/)) {
+ c.stdin.write('fugazi function waiting room\n')
+ // "read" module is weird on node >= 0.10 when not a TTY
+ // requires explicit ending for reasons.
+ // could dig in, but really just wanna make tests pass, whatever.
+ c.stdin.end()
+ return
+ }
+ }
+
+ c.on('close', function () {
+ actual = JSON.parse(actual)
+ t.deepEqual(actual, expect)
+ t.end()
+ })
+})
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/test/validate.input new/package/test/validate.input
--- old/package/test/validate.input 1970-01-01 01:00:00.000000000 +0100
+++ new/package/test/validate.input 2015-03-14 21:40:30.000000000 +0100
@@ -0,0 +1,8 @@
+module.exports = {
+ "name": prompt("name", function (data) {
+ if (data === 'cool') return data
+ var er = new Error('not cool')
+ er.notValid = true
+ return er
+ })
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/test/validate.js new/package/test/validate.js
--- old/package/test/validate.js 1970-01-01 01:00:00.000000000 +0100
+++ new/package/test/validate.js 2015-03-14 21:40:30.000000000 +0100
@@ -0,0 +1,20 @@
+
+var promzard = require('../')
+var test = require('tap').test
+
+test('validate', function (t) {
+ t.plan(2)
+ var ctx = { tmpdir : '/tmp' }
+ var file = __dirname + '/validate.input'
+ promzard(file, ctx, function (er, found) {
+ t.ok(!er)
+ var wanted = { name: 'cool' }
+ t.same(found, wanted)
+ })
+ setTimeout(function () {
+ process.stdin.emit('data', 'not cool\n')
+ }, 100)
+ setTimeout(function () {
+ process.stdin.emit('data', 'cool\n')
+ }, 200)
+})
1
0
Hello community,
here is the log from the commit of package nodejs-npm-package-arg for openSUSE:Factory checked in at 2015-07-02 22:39:27
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/nodejs-npm-package-arg (Old)
and /work/SRC/openSUSE:Factory/.nodejs-npm-package-arg.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "nodejs-npm-package-arg"
Changes:
--------
--- /work/SRC/openSUSE:Factory/nodejs-npm-package-arg/nodejs-npm-package-arg.changes 2015-04-27 13:03:05.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.nodejs-npm-package-arg.new/nodejs-npm-package-arg.changes 2015-07-02 22:39:28.000000000 +0200
@@ -1,0 +2,10 @@
+Sat Jun 6 11:31:47 UTC 2015 - i(a)marguerite.su
+
+- update version 4.0.1
+
+-------------------------------------------------------------------
+Fri Apr 24 12:28:49 UTC 2015 - hvogel(a)suse.com
+
+- Update to version 4.0.0
+
+-------------------------------------------------------------------
Old:
----
npm-package-arg-2.1.3.tgz
New:
----
npm-package-arg-4.0.1.tgz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ nodejs-npm-package-arg.spec ++++++
--- /var/tmp/diff_new_pack.WkaIlb/_old 2015-07-02 22:39:28.000000000 +0200
+++ /var/tmp/diff_new_pack.WkaIlb/_new 2015-07-02 22:39:28.000000000 +0200
@@ -19,7 +19,7 @@
%define base_name npm-package-arg
Name: nodejs-npm-package-arg
-Version: 2.1.3
+Version: 4.0.1
Release: 0
Summary: Parse things that can be arguments to `npm install`
License: ISC
++++++ npm-package-arg-2.1.3.tgz -> npm-package-arg-4.0.1.tgz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/README.md new/package/README.md
--- old/package/README.md 2014-09-27 07:35:23.000000000 +0200
+++ new/package/README.md 2015-05-21 22:46:39.000000000 +0200
@@ -1,26 +1,54 @@
# npm-package-arg
-Parse the things that can be arguments to `npm install`
+Parse package name and specifier passed to commands like `npm install` or
+`npm cache add`. This just parses the text given-- it's worth noting that
+`npm` has further logic it applies by looking at your disk to figure out
+what ambiguous specifiers are. If you want that logic, please see
+[realize-package-specifier].
-Takes an argument like `foo(a)1.2`, or `foo@user/foo`, or
-`http://x.com/foo.tgz`, or `git+https://github.com/user/foo`, and
-figures out what type of thing it is.
+[realize-package-specifier]: https://www.npmjs.org/package/realize-package-specifier
-## USAGE
+Arguments look like: `foo(a)1.2`, `@bar/foo@1.2`, `foo@user/foo`, `http://x.com/foo.tgz`,
+`git+https://github.com/user/foo`, `bitbucket:user/foo`, `foo.tar.gz` or `bar`
+
+## EXAMPLES
```javascript
var assert = require("assert")
var npa = require("npm-package-arg")
// Pass in the descriptor, and it'll return an object
-var parsed = npa("foo(a)1.2")
+var parsed = npa("@bar/foo@1.2")
+
+// Returns an object like:
+{
+ raw: '@bar/foo@1.2', // what was passed in
+ name: "@bar/foo", // the name of the package
+ scope: "@bar", // the private scope of the package, or null
+ type: "range", // the type of specifier this is
+ spec: ">=1.2.0 <1.3.0" // the expanded specifier
+ rawSpec: "1.2" // the specifier as passed in
+ }
+
+// Parsing urls pointing at hosted git services produces a variation:
+var parsed = npa("git+https://github.com/user/foo")
// Returns an object like:
-// {
-// name: "foo", // The bit in front of the @
-// type: "range", // the type of descriptor this is
-// spec: "1.2" // the specifier for this descriptor
-// }
+{
+ raw: 'git+https://github.com/user/foo',
+ scope: null,
+ name: null,
+ rawSpec: 'git+https://github.com/user/foo',
+ spec: 'user/foo',
+ type: 'hosted',
+ hosted: {
+ type: 'github',
+ ssh: 'git@github.com:user/foo.git',
+ sshurl: 'git+ssh://git@github.com/user/foo.git',
+ https: 'https://github.com/user/foo.git',
+ directUrl: 'https://raw.githubusercontent.com/user/foo/master/package.json'
+ }
+}
// Completely unreasonable invalid garbage throws an error
// Make sure you wrap this in a try/catch if you have not
@@ -30,23 +58,41 @@
})
```
-For more examples, see the test file.
+## USING
+
+`var npa = require('npm-package-arg')`
+
+* var result = npa(*arg*)
+
+Parses *arg* and returns a result object detailing what *arg* is.
+
+*arg* -- a package descriptor, like: `foo(a)1.2`, or `foo@user/foo`, or
+`http://x.com/foo.tgz`, or `git+https://github.com/user/foo`
-## Result Objects
+## RESULT OBJECT
The objects that are returned by npm-package-arg contain the following
-fields:
+keys:
* `name` - If known, the `name` field expected in the resulting pkg.
* `type` - One of the following strings:
* `git` - A git repo
- * `github` - A github shorthand, like `user/project`
+ * `hosted` - A hosted project, from github, bitbucket or gitlab. Originally
+ either a full url pointing at one of these services or a shorthand like
+ `user/project` or `github:user/project` for github or `bitbucket:user/project`
+ for bitbucket.
* `tag` - A tagged version, like `"foo@latest"`
* `version` - A specific version number, like `"foo(a)1.2.3"`
* `range` - A version range, like `"foo(a)2.x"`
* `local` - A local file or folder path
* `remote` - An http url (presumably to a tgz)
* `spec` - The "thing". URL, the range, git repo, etc.
+* `hosted` - If type=hosted this will be an object with the following keys:
+ * `type` - github, bitbucket or gitlab
+ * `ssh` - The ssh path for this git repo
+ * `sshUrl` - The ssh URL for this git repo
+ * `httpsUrl` - The HTTPS URL for this git repo
+ * `directUrl` - The URL for the package.json in this git repo
* `raw` - The original un-modified string that was provided.
* `rawSpec` - The part after the `name@...`, as it was originally
provided.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/npa.js new/package/npa.js
--- old/package/npa.js 2014-09-27 07:35:23.000000000 +0200
+++ new/package/npa.js 2015-05-21 22:51:43.000000000 +0200
@@ -3,14 +3,15 @@
var util = require("util")
var semver = require("semver")
var path = require("path")
+var HostedGit = require("hosted-git-info")
module.exports = npa
var isWindows = process.platform === "win32" || global.FAKE_WINDOWS
-var slashRe = isWindows ? /\\|\// : /\//
+var slashRe = isWindows ? /\\|[/]/ : /[/]/
-var parseName = /^(?:@([^\/]+?)\/)?([^\/]+?)$/
-var nameAt = /^(@([^\/]+?)\/)?([^\/]+?)@/
+var parseName = /^(?:@([^/]+?)[/])?([^/]+?)$/
+var nameAt = /^(@([^/]+?)[/])?([^/]+?)@/
var debug = util.debuglog ? util.debuglog("npa")
: /\bnpa\b/i.test(process.env.NODE_DEBUG || "")
? function () {
@@ -25,7 +26,7 @@
var n = name.trim()
if (!n || n.charAt(0) === "."
|| !n.match(/^[a-zA-Z0-9]/)
- || n.match(/[\/\(\)&\?#\|<>@:%\s\\\*'"!~`]/)
+ || n.match(/[/()&?#|<>@:%\s\\*'"!~`]/)
|| n.toLowerCase() === "node_modules"
|| n !== encodeURIComponent(n)
|| n.toLowerCase() === "favicon.ico") {
@@ -70,20 +71,11 @@
urlparse = {}
}
- if (urlparse.protocol) {
+ if (urlparse.protocol || HostedGit.fromUrl(arg)) {
return parseUrl(res, arg, urlparse)
}
- // parse git stuff
- // parse tag/range/local/remote
-
- if (maybeGitHubShorthand(arg)) {
- res.type = "github"
- res.spec = arg
- return res
- }
-
- // at this point, it's not a url, and not github
+ // at this point, it's not a url, and not hosted
// If it's a valid name, and doesn't already have a name, then assume
// $name@"" range
//
@@ -132,19 +124,22 @@
res.spec = path.resolve(arg)
}
-function maybeGitHubShorthand (arg) {
- // Note: This does not fully test the git ref format.
- // See https://www.kernel.org/pub/software/scm/git/docs/git-check-ref-format.html
- //
- // The only way to do this properly would be to shell out to
- // git-check-ref-format, and as this is a fast sync function,
- // we don't want to do that. Just let git fail if it turns
- // out that the commit-ish is invalid.
- // GH usernames cannot start with . or -
- return /^[^@%\/\s\.-][^@%\/\s]*\/[^@\s\/%]+(?:#.*)?$/.test(arg)
-}
-
function parseUrl (res, arg, urlparse) {
+ var gitHost = HostedGit.fromUrl(arg)
+ if (gitHost) {
+ res.type = "hosted"
+ res.spec = gitHost.toString(),
+ res.hosted = {
+ type: gitHost.type,
+ ssh: gitHost.ssh(),
+ sshUrl: gitHost.sshurl(),
+ httpsUrl: gitHost.https(),
+ gitUrl: gitHost.git(),
+ shortcut: gitHost.shortcut(),
+ directUrl: gitHost.file("package.json")
+ }
+ return res
+ }
// check the protocol, and then see if it's git or not
switch (urlparse.protocol) {
case "git:":
@@ -154,23 +149,23 @@
case "git+ftp:":
case "git+ssh:":
case "git+file:":
- res.type = 'git'
- res.spec = arg.replace(/^git\+/, '')
+ res.type = "git"
+ res.spec = arg.replace(/^git[+]/, "")
break
- case 'http:':
- case 'https:':
- res.type = 'remote'
+ case "http:":
+ case "https:":
+ res.type = "remote"
res.spec = arg
break
- case 'file:':
- res.type = 'local'
+ case "file:":
+ res.type = "local"
res.spec = urlparse.pathname
- break;
+ break
default:
- throw new Error('Unsupported URL Type: ' + arg)
+ throw new Error("Unsupported URL Type: " + arg)
break
}
@@ -181,7 +176,8 @@
function Result () {
if (!(this instanceof Result)) return new Result
}
-Result.prototype.name = null
-Result.prototype.type = null
-Result.prototype.spec = null
-Result.prototype.raw = null
+Result.prototype.name = null
+Result.prototype.type = null
+Result.prototype.spec = null
+Result.prototype.raw = null
+Result.prototype.hosted = null
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/package.json new/package/package.json
--- old/package/package.json 2014-09-29 18:40:39.000000000 +0200
+++ new/package/package.json 2015-05-21 22:54:12.000000000 +0200
@@ -1,12 +1,13 @@
{
"name": "npm-package-arg",
- "version": "2.1.3",
+ "version": "4.0.1",
"description": "Parse the things that can be arguments to `npm install`",
"main": "npa.js",
"directories": {
"test": "test"
},
"dependencies": {
+ "hosted-git-info": "^2.1.4",
"semver": "4"
},
"devDependencies": {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/package.json~ new/package/package.json~
--- old/package/package.json~ 2014-09-29 17:42:29.000000000 +0200
+++ new/package/package.json~ 1970-01-01 01:00:00.000000000 +0100
@@ -1,28 +0,0 @@
-{
- "name": "npm-package-arg",
- "version": "2.1.2",
- "description": "Parse the things that can be arguments to `npm install`",
- "main": "npa.js",
- "directories": {
- "test": "test"
- },
- "dependencies": {
- "semver": "^2.3.0 || 3.x || 4"
- },
- "devDependencies": {
- "tap": "^0.4.9"
- },
- "scripts": {
- "test": "tap test/*.js"
- },
- "repository": {
- "type": "git",
- "url": "https://github.com/npm/npm-package-arg"
- },
- "author": "Isaac Z. Schlueter <i(a)izs.me> (http://blog.izs.me/)",
- "license": "ISC",
- "bugs": {
- "url": "https://github.com/npm/npm-package-arg/issues"
- },
- "homepage": "https://github.com/npm/npm-package-arg"
-}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/test/basic.js new/package/test/basic.js
--- old/package/test/basic.js 2014-09-29 18:40:04.000000000 +0200
+++ new/package/test/basic.js 2015-05-21 22:51:58.000000000 +0200
@@ -63,11 +63,11 @@
rawSpec: "=v1.2.3"
},
- "git+ssh://git@github.com/user/foo#1.2.3": {
+ "git+ssh://git@notgithub.com/user/foo#1.2.3": {
name: null,
type: "git",
- spec: "ssh://git@github.com/user/foo#1.2.3",
- raw: "git+ssh://git@github.com/user/foo#1.2.3"
+ spec: "ssh://git@notgithub.com/user/foo#1.2.3",
+ raw: "git+ssh://git@notgithub.com/user/foo#1.2.3"
},
"git+file://path/to/repo#1.2.3": {
@@ -77,25 +77,25 @@
raw: "git+file://path/to/repo#1.2.3"
},
- "git://github.com/user/foo": {
+ "git://notgithub.com/user/foo": {
name: null,
type: "git",
- spec: "git://github.com/user/foo",
- raw: "git://github.com/user/foo"
+ spec: "git://notgithub.com/user/foo",
+ raw: "git://notgithub.com/user/foo"
},
- "@foo/bar@git+ssh://github.com/user/foo": {
+ "@foo/bar@git+ssh://notgithub.com/user/foo": {
name: "@foo/bar",
scope: "@foo",
- spec: "ssh://github.com/user/foo",
- rawSpec: "git+ssh://github.com/user/foo",
- raw: "@foo/bar@git+ssh://github.com/user/foo"
+ spec: "ssh://notgithub.com/user/foo",
+ rawSpec: "git+ssh://notgithub.com/user/foo",
+ raw: "@foo/bar@git+ssh://notgithub.com/user/foo"
},
"/path/to/foo": {
name: null,
type: "local",
- spec: "/path/to/foo",
+ spec: path.resolve(__dirname, "/path/to/foo"),
raw: "/path/to/foo"
},
@@ -134,41 +134,6 @@
raw: "https://server.com/foo.tgz"
},
- "user/foo-js": {
- name: null,
- type: "github",
- spec: "user/foo-js",
- raw: "user/foo-js"
- },
-
- "user/foo-js#bar/baz": {
- name: null,
- type: "github",
- spec: "user/foo-js#bar/baz",
- raw: "user/foo-js#bar/baz"
- },
-
- "user..blerg--/..foo-js# . . . . . some . tags / / /": {
- name: null,
- type: "github",
- spec: "user..blerg--/..foo-js# . . . . . some . tags / / /",
- raw: "user..blerg--/..foo-js# . . . . . some . tags / / /"
- },
-
- "user/foo-js#bar/baz/bin": {
- name: null,
- type: "github",
- spec: "user/foo-js#bar/baz/bin",
- raw: "user/foo-js#bar/baz/bin"
- },
-
- "foo@user/foo-js": {
- name: "foo",
- type: "github",
- spec: "user/foo-js",
- raw: "foo@user/foo-js"
- },
-
"foo@latest": {
name: "foo",
type: "tag",
@@ -186,8 +151,8 @@
Object.keys(tests).forEach(function (arg) {
var res = npa(arg)
- t.type(res, "Result")
- t.has(res, tests[arg])
+ t.type(res, "Result", arg + " is result")
+ t.has(res, tests[arg], arg + " matches expectations")
})
// Completely unreasonable invalid garbage throws an error
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/test/basic.js~ new/package/test/basic.js~
--- old/package/test/basic.js~ 2014-09-27 07:35:23.000000000 +0200
+++ new/package/test/basic.js~ 1970-01-01 01:00:00.000000000 +0100
@@ -1,203 +0,0 @@
-var npa = require("../npa.js")
-var path = require("path")
-
-require("tap").test("basic", function (t) {
- t.setMaxListeners(999)
-
- var tests = {
- "foo(a)1.2": {
- name: "foo",
- type: "range",
- spec: ">=1.2.0-0 <1.3.0-0",
- raw: "foo(a)1.2",
- rawSpec: "1.2"
- },
-
- "@foo/bar": {
- raw: "@foo/bar",
- name: "@foo/bar",
- scope: "@foo",
- rawSpec: "",
- spec: "*",
- type: "range"
- },
-
- "@foo/bar@": {
- raw: "@foo/bar@",
- name: "@foo/bar",
- scope: "@foo",
- rawSpec: "",
- spec: "*",
- type: "range"
- },
-
- "@foo/bar@baz": {
- raw: "@foo/bar@baz",
- name: "@foo/bar",
- scope: "@foo",
- rawSpec: "baz",
- spec: "baz",
- type: "tag"
- },
-
- "@f fo o al/ a d s ;f ": {
- raw: "@f fo o al/ a d s ;f",
- name: null,
- rawSpec: "@f fo o al/ a d s ;f",
- spec: path.resolve("@f fo o al/ a d s ;f"),
- type: "local"
- },
-
- "foo(a)1.2.3": {
- name: "foo",
- type: "version",
- spec: "1.2.3",
- raw: "foo(a)1.2.3"
- },
-
- "foo(a)=v1.2.3": {
- name: "foo",
- type: "version",
- spec: "1.2.3",
- raw: "foo(a)=v1.2.3",
- rawSpec: "=v1.2.3"
- },
-
- "git+ssh://git@github.com/user/foo#1.2.3": {
- name: null,
- type: "git",
- spec: "ssh://git@github.com/user/foo#1.2.3",
- raw: "git+ssh://git@github.com/user/foo#1.2.3"
- },
-
- "git+file://path/to/repo#1.2.3": {
- name: null,
- type: "git",
- spec: "file://path/to/repo#1.2.3",
- raw: "git+file://path/to/repo#1.2.3"
- },
-
- "git://github.com/user/foo": {
- name: null,
- type: "git",
- spec: "git://github.com/user/foo",
- raw: "git://github.com/user/foo"
- },
-
- "@foo/bar@git+ssh://github.com/user/foo": {
- name: "@foo/bar",
- scope: "@foo",
- spec: "ssh://github.com/user/foo",
- rawSpec: "git+ssh://github.com/user/foo",
- raw: "@foo/bar@git+ssh://github.com/user/foo"
- },
-
- "/path/to/foo": {
- name: null,
- type: "local",
- spec: "/path/to/foo",
- raw: "/path/to/foo"
- },
-
- "file:path/to/foo": {
- name: null,
- type: "local",
- spec: "path/to/foo",
- raw: "file:path/to/foo"
- },
-
- "file:~/path/to/foo": {
- name: null,
- type: "local",
- spec: "~/path/to/foo",
- raw: "file:~/path/to/foo"
- },
-
- "file:../path/to/foo": {
- name: null,
- type: "local",
- spec: "../path/to/foo",
- raw: "file:../path/to/foo"
- },
-
- "file:///path/to/foo": {
- name: null,
- type: "local",
- spec: "/path/to/foo",
- raw: "file:///path/to/foo"
- },
-
- "https://server.com/foo.tgz": {
- name: null,
- type: "remote",
- spec: "https://server.com/foo.tgz",
- raw: "https://server.com/foo.tgz"
- },
-
- "user/foo-js": {
- name: null,
- type: "github",
- spec: "user/foo-js",
- raw: "user/foo-js"
- },
-
- "user/foo-js#bar/baz": {
- name: null,
- type: "github",
- spec: "user/foo-js#bar/baz",
- raw: "user/foo-js#bar/baz"
- },
-
- "user..blerg--/..foo-js# . . . . . some . tags / / /": {
- name: null,
- type: "github",
- spec: "user..blerg--/..foo-js# . . . . . some . tags / / /",
- raw: "user..blerg--/..foo-js# . . . . . some . tags / / /"
- },
-
- "user/foo-js#bar/baz/bin": {
- name: null,
- type: "github",
- spec: "user/foo-js#bar/baz/bin",
- raw: "user/foo-js#bar/baz/bin"
- },
-
- "foo@user/foo-js": {
- name: "foo",
- type: "github",
- spec: "user/foo-js",
- raw: "foo@user/foo-js"
- },
-
- "foo@latest": {
- name: "foo",
- type: "tag",
- spec: "latest",
- raw: "foo@latest"
- },
-
- "foo": {
- name: "foo",
- type: "range",
- spec: "*",
- raw: "foo"
- }
- }
-
- Object.keys(tests).forEach(function (arg) {
- var res = npa(arg)
- t.type(res, "Result")
- t.has(res, tests[arg])
- })
-
- // Completely unreasonable invalid garbage throws an error
- t.throws(function() {
- npa("this is not a \0 valid package name or url")
- })
-
- t.throws(function() {
- npa("gopher://yea right")
- }, "Unsupported URL Type: gopher://yea right")
-
- t.end()
-})
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/test/bitbucket.js new/package/test/bitbucket.js
--- old/package/test/bitbucket.js 1970-01-01 01:00:00.000000000 +0100
+++ new/package/test/bitbucket.js 2015-05-21 22:51:43.000000000 +0200
@@ -0,0 +1,82 @@
+var npa = require("../npa.js")
+var path = require("path")
+
+require("tap").test("basic", function (t) {
+ t.setMaxListeners(999)
+
+ var tests = {
+ "bitbucket:user/foo-js": {
+ name: null,
+ type: "hosted",
+ hosted: { type: "bitbucket" },
+ spec: "bitbucket:user/foo-js",
+ raw: "bitbucket:user/foo-js"
+ },
+
+ "bitbucket:user/foo-js#bar/baz": {
+ name: null,
+ type: "hosted",
+ hosted: { type: "bitbucket" },
+ spec: "bitbucket:user/foo-js#bar/baz",
+ raw: "bitbucket:user/foo-js#bar/baz"
+ },
+
+ "bitbucket:user..blerg--/..foo-js# . . . . . some . tags / / /": {
+ name: null,
+ type: "hosted",
+ hosted: { type: "bitbucket" },
+ spec: "bitbucket:user..blerg--/..foo-js# . . . . . some . tags / / /",
+ raw: "bitbucket:user..blerg--/..foo-js# . . . . . some . tags / / /"
+ },
+
+ "bitbucket:user/foo-js#bar/baz/bin": {
+ name: null,
+ type: "hosted",
+ hosted: { type: "bitbucket" },
+ spec: "bitbucket:user/foo-js#bar/baz/bin",
+ raw: "bitbucket:user/foo-js#bar/baz/bin"
+ },
+
+ "foo@bitbucket:user/foo-js": {
+ name: "foo",
+ type: "hosted",
+ hosted: { type: "bitbucket" },
+ spec: "bitbucket:user/foo-js",
+ raw: "foo@bitbucket:user/foo-js"
+ },
+
+ "git+ssh://git@bitbucket.org/user/foo#1.2.3": {
+ name: null,
+ type: "hosted",
+ hosted: { type: "bitbucket" },
+ spec: "git+ssh://git@bitbucket.org/user/foo.git#1.2.3",
+ raw: "git+ssh://git@bitbucket.org/user/foo#1.2.3"
+ },
+
+ "https://bitbucket.org/user/foo.git": {
+ name: null,
+ type: "hosted",
+ hosted: { type: "bitbucket" },
+ spec: "git+https://bitbucket.org/user/foo.git",
+ raw: "https://bitbucket.org/user/foo.git"
+ },
+
+ "@foo/bar@git+ssh://bitbucket.org/user/foo": {
+ name: "@foo/bar",
+ scope: "@foo",
+ type: "hosted",
+ hosted: { type: "bitbucket" },
+ spec: "git+ssh://git@bitbucket.org/user/foo.git",
+ rawSpec: "git+ssh://bitbucket.org/user/foo",
+ raw: "@foo/bar@git+ssh://bitbucket.org/user/foo"
+ }
+ }
+
+ Object.keys(tests).forEach(function (arg) {
+ var res = npa(arg)
+ t.type(res, "Result", arg + " is a result")
+ t.has(res, tests[arg], arg + " matches expectations")
+ })
+
+ t.end()
+})
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/test/bitbucket.js~ new/package/test/bitbucket.js~
--- old/package/test/bitbucket.js~ 1970-01-01 01:00:00.000000000 +0100
+++ new/package/test/bitbucket.js~ 2015-05-21 22:48:51.000000000 +0200
@@ -0,0 +1,82 @@
+var npa = require("../npa.js")
+var path = require("path")
+
+require("tap").test("basic", function (t) {
+ t.setMaxListeners(999)
+
+ var tests = {
+ "bitbucket:user/foo-js": {
+ name: null,
+ type: "hosted",
+ hosted: { type: "bitbucket" },
+ spec: "bitbucket:user/foo-js",
+ raw: "bitbucket:user/foo-js"
+ },
+
+ "bitbucket:user/foo-js#bar/baz": {
+ name: null,
+ type: "hosted",
+ hosted: { type: "bitbucket" },
+ spec: "bitbucket:user/foo-js#bar/baz",
+ raw: "bitbucket:user/foo-js#bar/baz"
+ },
+
+ "bitbucket:user..blerg--/..foo-js# . . . . . some . tags / / /": {
+ name: null,
+ type: "hosted",
+ hosted: { type: "bitbucket" },
+ spec: "bitbucket:user..blerg--/..foo-js# . . . . . some . tags / / /",
+ raw: "bitbucket:user..blerg--/..foo-js# . . . . . some . tags / / /"
+ },
+
+ "bitbucket:user/foo-js#bar/baz/bin": {
+ name: null,
+ type: "hosted",
+ hosted: { type: "bitbucket" },
+ spec: "bitbucket:user/foo-js#bar/baz/bin",
+ raw: "bitbucket:user/foo-js#bar/baz/bin"
+ },
+
+ "foo@bitbucket:user/foo-js": {
+ name: "foo",
+ type: "hosted",
+ hosted: { type: "bitbucket" },
+ spec: "bitbucket:user/foo-js",
+ raw: "foo@bitbucket:user/foo-js"
+ },
+
+ "git+ssh://git@bitbucket.org/user/foo#1.2.3": {
+ name: null,
+ type: "hosted",
+ hosted: { type: "bitbucket" },
+ spec: "git+ssh://git@bitbucket.org/user/foo.git#1.2.3",
+ raw: "git+ssh://git@bitbucket.org/user/foo#1.2.3"
+ },
+
+ "https://bitbucket.org/user/foo.git": {
+ name: null,
+ type: "hosted",
+ hosted: { type: "bitbucket" },
+ spec: "git+https:bitbucket.org/user/foo.git",
+ raw: "https://bitbucket.org/user/foo.git"
+ },
+
+ "@foo/bar@git+ssh://bitbucket.org/user/foo": {
+ name: "@foo/bar",
+ scope: "@foo",
+ type: "hosted",
+ hosted: { type: "bitbucket" },
+ spec: "git+ssh://git@bitbucket.org/user/foo.git",
+ rawSpec: "git+ssh://bitbucket.org/user/foo",
+ raw: "@foo/bar@git+ssh://bitbucket.org/user/foo"
+ }
+ }
+
+ Object.keys(tests).forEach(function (arg) {
+ var res = npa(arg)
+ t.type(res, "Result", arg + " is a result")
+ t.has(res, tests[arg], arg + " matches expectations")
+ })
+
+ t.end()
+})
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/test/github.js new/package/test/github.js
--- old/package/test/github.js 1970-01-01 01:00:00.000000000 +0100
+++ new/package/test/github.js 2015-05-21 22:51:43.000000000 +0200
@@ -0,0 +1,106 @@
+var npa = require("../npa.js")
+var path = require("path")
+
+require("tap").test("basic", function (t) {
+ t.setMaxListeners(999)
+
+ var tests = {
+ "user/foo-js": {
+ name: null,
+ type: "hosted",
+ hosted: { type: "github" },
+ spec: "github:user/foo-js",
+ raw: "user/foo-js"
+ },
+
+ "user/foo-js#bar/baz": {
+ name: null,
+ type: "hosted",
+ hosted: { type: "github" },
+ spec: "github:user/foo-js#bar/baz",
+ raw: "user/foo-js#bar/baz"
+ },
+
+ "user..blerg--/..foo-js# . . . . . some . tags / / /": {
+ name: null,
+ type: "hosted",
+ hosted: { type: "github" },
+ spec: "github:user..blerg--/..foo-js# . . . . . some . tags / / /",
+ raw: "user..blerg--/..foo-js# . . . . . some . tags / / /"
+ },
+
+ "user/foo-js#bar/baz/bin": {
+ name: null,
+ type: "hosted",
+ hosted: { type: "github" },
+ raw: "github:user/foo-js#bar/baz/bin",
+ raw: "user/foo-js#bar/baz/bin"
+ },
+
+ "foo@user/foo-js": {
+ name: "foo",
+ type: "hosted",
+ hosted: { type: "github" },
+ spec: "github:user/foo-js",
+ raw: "foo@user/foo-js"
+ },
+
+ "github:user/foo-js": {
+ name: null,
+ type: "hosted",
+ hosted: { type: "github" },
+ spec: "github:user/foo-js",
+ raw: "github:user/foo-js"
+ },
+
+ "git+ssh://git@github.com/user/foo#1.2.3": {
+ name: null,
+ type: "hosted",
+ hosted: { type: "github" },
+ spec: "git+ssh://git@github.com/user/foo.git#1.2.3",
+ raw: "git+ssh://git@github.com/user/foo#1.2.3"
+ },
+
+ "git://github.com/user/foo": {
+ name: null,
+ type: "hosted",
+ hosted: { type: "github" },
+ spec: "git://github.com/user/foo.git",
+ raw: "git://github.com/user/foo"
+ },
+
+ "https://github.com/user/foo.git": {
+ name: null,
+ type: "hosted",
+ hosted: { type: "github" },
+ spec: "git+https://github.com/user/foo.git",
+ raw: "https://github.com/user/foo.git"
+ },
+
+ "@foo/bar@git+ssh://github.com/user/foo": {
+ name: "@foo/bar",
+ scope: "@foo",
+ type: "hosted",
+ hosted: { type: "github" },
+ spec: "git+ssh://git@github.com/user/foo.git",
+ rawSpec: "git+ssh://github.com/user/foo",
+ raw: "@foo/bar@git+ssh://github.com/user/foo"
+ },
+
+ "foo@bar/foo": {
+ name: "foo",
+ type: "hosted",
+ hosted: { type: "github" },
+ spec: "github:bar/foo",
+ raw: "foo@bar/foo"
+ }
+ }
+
+ Object.keys(tests).forEach(function (arg) {
+ var res = npa(arg)
+ t.type(res, "Result", arg + " is a result")
+ t.has(res, tests[arg], arg + " matches expectations")
+ })
+
+ t.end()
+})
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/test/github.js~ new/package/test/github.js~
--- old/package/test/github.js~ 1970-01-01 01:00:00.000000000 +0100
+++ new/package/test/github.js~ 2015-05-21 22:48:51.000000000 +0200
@@ -0,0 +1,106 @@
+var npa = require("../npa.js")
+var path = require("path")
+
+require("tap").test("basic", function (t) {
+ t.setMaxListeners(999)
+
+ var tests = {
+ "user/foo-js": {
+ name: null,
+ type: "hosted",
+ hosted: { type: "github" },
+ spec: "github:user/foo-js",
+ raw: "user/foo-js"
+ },
+
+ "user/foo-js#bar/baz": {
+ name: null,
+ type: "hosted",
+ hosted: { type: "github" },
+ spec: "github:user/foo-js#bar/baz",
+ raw: "user/foo-js#bar/baz"
+ },
+
+ "user..blerg--/..foo-js# . . . . . some . tags / / /": {
+ name: null,
+ type: "hosted",
+ hosted: { type: "github" },
+ spec: "github:user..blerg--/..foo-js# . . . . . some . tags / / /",
+ raw: "user..blerg--/..foo-js# . . . . . some . tags / / /"
+ },
+
+ "user/foo-js#bar/baz/bin": {
+ name: null,
+ type: "hosted",
+ hosted: { type: "github" },
+ raw: "github:user/foo-js#bar/baz/bin",
+ raw: "user/foo-js#bar/baz/bin"
+ },
+
+ "foo@user/foo-js": {
+ name: "foo",
+ type: "hosted",
+ hosted: { type: "github" },
+ spec: "github:user/foo-js",
+ raw: "foo@user/foo-js"
+ },
+
+ "github:user/foo-js": {
+ name: null,
+ type: "hosted",
+ hosted: { type: "github" },
+ spec: "github:user/foo-js",
+ raw: "github:user/foo-js"
+ },
+
+ "git+ssh://git@github.com/user/foo#1.2.3": {
+ name: null,
+ type: "hosted",
+ hosted: { type: "github" },
+ spec: "git+ssh://git@github.com/user/foo.git#1.2.3",
+ raw: "git+ssh://git@github.com/user/foo#1.2.3"
+ },
+
+ "git://github.com/user/foo": {
+ name: null,
+ type: "hosted",
+ hosted: { type: "github" },
+ spec: "git://github.com/user/foo.git",
+ raw: "git://github.com/user/foo"
+ },
+
+ "https://github.com/user/foo.git": {
+ name: null,
+ type: "hosted",
+ hosted: { type: "github" },
+ spec: "git+https:github.com/user/foo.git",
+ raw: "https://github.com/user/foo.git"
+ },
+
+ "@foo/bar@git+ssh://github.com/user/foo": {
+ name: "@foo/bar",
+ scope: "@foo",
+ type: "hosted",
+ hosted: { type: "github" },
+ spec: "git+ssh://git@github.com/user/foo.git",
+ rawSpec: "git+ssh://github.com/user/foo",
+ raw: "@foo/bar@git+ssh://github.com/user/foo"
+ },
+
+ "foo@bar/foo": {
+ name: "foo",
+ type: "hosted",
+ hosted: { type: "github" },
+ spec: "github:bar/foo",
+ raw: "foo@bar/foo"
+ }
+ }
+
+ Object.keys(tests).forEach(function (arg) {
+ var res = npa(arg)
+ t.type(res, "Result", arg + " is a result")
+ t.has(res, tests[arg], arg + " matches expectations")
+ })
+
+ t.end()
+})
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/test/gitlab.js new/package/test/gitlab.js
--- old/package/test/gitlab.js 1970-01-01 01:00:00.000000000 +0100
+++ new/package/test/gitlab.js 2015-05-21 22:51:43.000000000 +0200
@@ -0,0 +1,82 @@
+var npa = require("../npa.js")
+var path = require("path")
+
+require("tap").test("basic", function (t) {
+ t.setMaxListeners(999)
+
+ var tests = {
+ "gitlab:user/foo-js": {
+ name: null,
+ type: "hosted",
+ hosted: { type: "gitlab" },
+ raw: "gitlab:user/foo-js",
+ raw: "gitlab:user/foo-js"
+ },
+
+ "gitlab:user/foo-js#bar/baz": {
+ name: null,
+ type: "hosted",
+ hosted: { type: "gitlab" },
+ raw: "gitlab:user/foo-js#bar/baz",
+ raw: "gitlab:user/foo-js#bar/baz"
+ },
+
+ "gitlab:user..blerg--/..foo-js# . . . . . some . tags / / /": {
+ name: null,
+ type: "hosted",
+ hosted: { type: "gitlab" },
+ spec: "gitlab:user..blerg--/..foo-js# . . . . . some . tags / / /",
+ raw: "gitlab:user..blerg--/..foo-js# . . . . . some . tags / / /"
+ },
+
+ "gitlab:user/foo-js#bar/baz/bin": {
+ name: null,
+ type: "hosted",
+ hosted: { type: "gitlab" },
+ spec: "gitlab:user/foo-js#bar/baz/bin",
+ raw: "gitlab:user/foo-js#bar/baz/bin"
+ },
+
+ "foo@gitlab:user/foo-js": {
+ name: "foo",
+ type: "hosted",
+ hosted: { type: "gitlab" },
+ spec: "gitlab:user/foo-js",
+ raw: "foo@gitlab:user/foo-js"
+ },
+
+ "git+ssh://git@gitlab.com/user/foo#1.2.3": {
+ name: null,
+ type: "hosted",
+ hosted: { type: "gitlab" },
+ spec: "git+ssh://git@gitlab.com/user/foo.git#1.2.3",
+ raw: "git+ssh://git@gitlab.com/user/foo#1.2.3"
+ },
+
+ "https://gitlab.com/user/foo.git": {
+ name: null,
+ type: "hosted",
+ hosted: { type: "gitlab" },
+ spec: "git+https://gitlab.com/user/foo.git",
+ raw: "https://gitlab.com/user/foo.git"
+ },
+
+ "@foo/bar@git+ssh://gitlab.com/user/foo": {
+ name: "@foo/bar",
+ scope: "@foo",
+ type: "hosted",
+ hosted: { type: "gitlab" },
+ spec: "git+ssh://git@gitlab.com/user/foo.git",
+ rawSpec: "git+ssh://gitlab.com/user/foo",
+ raw: "@foo/bar@git+ssh://gitlab.com/user/foo"
+ }
+ }
+
+ Object.keys(tests).forEach(function (arg) {
+ var res = npa(arg)
+ t.type(res, "Result", arg + " is a result")
+ t.has(res, tests[arg], arg + " matches expectations")
+ })
+
+ t.end()
+})
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/test/gitlab.js~ new/package/test/gitlab.js~
--- old/package/test/gitlab.js~ 1970-01-01 01:00:00.000000000 +0100
+++ new/package/test/gitlab.js~ 2015-05-21 22:48:52.000000000 +0200
@@ -0,0 +1,82 @@
+var npa = require("../npa.js")
+var path = require("path")
+
+require("tap").test("basic", function (t) {
+ t.setMaxListeners(999)
+
+ var tests = {
+ "gitlab:user/foo-js": {
+ name: null,
+ type: "hosted",
+ hosted: { type: "gitlab" },
+ raw: "gitlab:user/foo-js",
+ raw: "gitlab:user/foo-js"
+ },
+
+ "gitlab:user/foo-js#bar/baz": {
+ name: null,
+ type: "hosted",
+ hosted: { type: "gitlab" },
+ raw: "gitlab:user/foo-js#bar/baz",
+ raw: "gitlab:user/foo-js#bar/baz"
+ },
+
+ "gitlab:user..blerg--/..foo-js# . . . . . some . tags / / /": {
+ name: null,
+ type: "hosted",
+ hosted: { type: "gitlab" },
+ spec: "gitlab:user..blerg--/..foo-js# . . . . . some . tags / / /",
+ raw: "gitlab:user..blerg--/..foo-js# . . . . . some . tags / / /"
+ },
+
+ "gitlab:user/foo-js#bar/baz/bin": {
+ name: null,
+ type: "hosted",
+ hosted: { type: "gitlab" },
+ spec: "gitlab:user/foo-js#bar/baz/bin",
+ raw: "gitlab:user/foo-js#bar/baz/bin"
+ },
+
+ "foo@gitlab:user/foo-js": {
+ name: "foo",
+ type: "hosted",
+ hosted: { type: "gitlab" },
+ spec: "gitlab:user/foo-js",
+ raw: "foo@gitlab:user/foo-js"
+ },
+
+ "git+ssh://git@gitlab.com/user/foo#1.2.3": {
+ name: null,
+ type: "hosted",
+ hosted: { type: "gitlab" },
+ spec: "git+ssh://git@gitlab.com/user/foo.git#1.2.3",
+ raw: "git+ssh://git@gitlab.com/user/foo#1.2.3"
+ },
+
+ "https://gitlab.com/user/foo.git": {
+ name: null,
+ type: "hosted",
+ hosted: { type: "gitlab" },
+ spec: "git+https:gitlab.com/user/foo.git",
+ raw: "https://gitlab.com/user/foo.git"
+ },
+
+ "@foo/bar@git+ssh://gitlab.com/user/foo": {
+ name: "@foo/bar",
+ scope: "@foo",
+ type: "hosted",
+ hosted: { type: "gitlab" },
+ spec: "git+ssh://git@gitlab.com/user/foo.git",
+ rawSpec: "git+ssh://gitlab.com/user/foo",
+ raw: "@foo/bar@git+ssh://gitlab.com/user/foo"
+ }
+ }
+
+ Object.keys(tests).forEach(function (arg) {
+ var res = npa(arg)
+ t.type(res, "Result", arg + " is a result")
+ t.has(res, tests[arg], arg + " matches expectations")
+ })
+
+ t.end()
+})
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/test/windows.js new/package/test/windows.js
--- old/package/test/windows.js 2014-09-27 07:35:23.000000000 +0200
+++ new/package/test/windows.js 2015-05-21 22:46:39.000000000 +0200
@@ -6,28 +6,28 @@
var cases = {
"C:\\x\\y\\z": {
- raw: 'C:\\x\\y\\z',
+ raw: "C:\\x\\y\\z",
scope: null,
name: null,
- rawSpec: 'C:\\x\\y\\z',
- spec: path.resolve('C:\\x\\y\\z'),
- type: 'local'
+ rawSpec: "C:\\x\\y\\z",
+ spec: path.resolve("C:\\x\\y\\z"),
+ type: "local"
},
"foo@C:\\x\\y\\z": {
- raw: 'foo@C:\\x\\y\\z',
+ raw: "foo@C:\\x\\y\\z",
scope: null,
- name: 'foo',
- rawSpec: 'C:\\x\\y\\z',
- spec: path.resolve('C:\\x\\y\\z'),
- type: 'local'
+ name: "foo",
+ rawSpec: "C:\\x\\y\\z",
+ spec: path.resolve("C:\\x\\y\\z"),
+ type: "local"
},
"foo@/foo/bar/baz": {
- raw: 'foo@/foo/bar/baz',
+ raw: "foo@/foo/bar/baz",
scope: null,
- name: 'foo',
- rawSpec: '/foo/bar/baz',
- spec: path.resolve('/foo/bar/baz'),
- type: 'local'
+ name: "foo",
+ rawSpec: "/foo/bar/baz",
+ spec: path.resolve("/foo/bar/baz"),
+ type: "local"
}
}
1
0

02 Jul '15
Hello community,
here is the log from the commit of package nodejs-normalize-package-data for openSUSE:Factory checked in at 2015-07-02 22:39:21
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/nodejs-normalize-package-data (Old)
and /work/SRC/openSUSE:Factory/.nodejs-normalize-package-data.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "nodejs-normalize-package-data"
Changes:
--------
--- /work/SRC/openSUSE:Factory/nodejs-normalize-package-data/nodejs-normalize-package-data.changes 2015-04-27 13:01:58.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.nodejs-normalize-package-data.new/nodejs-normalize-package-data.changes 2015-07-02 22:39:22.000000000 +0200
@@ -1,0 +2,10 @@
+Sat Jun 6 11:27:36 UTC 2015 - i(a)marguerite.su
+
+- update version 2.2.0
+
+-------------------------------------------------------------------
+Fri Apr 24 12:25:21 UTC 2015 - hvogel(a)suse.com
+
+- Update to version 2.0.0
+
+-------------------------------------------------------------------
Old:
----
normalize-package-data-1.0.3.tgz
New:
----
normalize-package-data-2.2.0.tgz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ nodejs-normalize-package-data.spec ++++++
--- /var/tmp/diff_new_pack.pIzMUt/_old 2015-07-02 22:39:23.000000000 +0200
+++ /var/tmp/diff_new_pack.pIzMUt/_new 2015-07-02 22:39:23.000000000 +0200
@@ -19,7 +19,7 @@
%define base_name normalize-package-data
Name: nodejs-normalize-package-data
-Version: 1.0.3
+Version: 2.2.0
Release: 0
Summary: Normalizes data that can be found in package.json files
License: BSD-2-Clause
++++++ normalize-package-data-1.0.3.tgz -> normalize-package-data-2.2.0.tgz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/README.md new/package/README.md
--- old/package/README.md 2014-09-30 01:05:04.000000000 +0200
+++ new/package/README.md 2015-05-22 01:32:48.000000000 +0200
@@ -1,4 +1,4 @@
-# normalize-package-data […
normalize-package data exports a function that normalizes package metadata. This data is typically found in a package.json file, but in principle could come from any source - for example the npm registry.
@@ -68,9 +68,11 @@
* If `bundledDependencies` field (a typo) exists and `bundleDependencies` field does not, `bundledDependencies` will get renamed to `bundleDependencies`.
* If the value of any of the dependencies fields (`dependencies`, `devDependencies`, `optionalDependencies`) is a string, it gets converted into an object with familiar `name=>value` pairs.
* The values in `optionalDependencies` get added to `dependencies`. The `optionalDependencies` array is left untouched.
+* As of v2: Dependencies that point at known hosted git providers (currently: github, bitbucket, gitlab) will have their URLs canonicalized, but protocols will be preserved.
+* As of v2: Dependencies that use shortcuts for hosted git providers (`org/proj`, `github:org/proj`, `bitbucket:org/proj`, `gitlab:org/proj`, `gist:docid`) will have the shortcut left in place. (In the case of github, the `org/proj` form will be expanded to `github:org/proj`.) THIS MARKS A BREAKING CHANGE FROM V1, where the shorcut was previously expanded to a URL.
* If `description` field does not exist, but `readme` field does, then (more or less) the first paragraph of text that's found in the readme is taken as value for `description`.
* If `repository` field is a string, it will become an object with `url` set to the original string value, and `type` set to `"git"`.
-* If `repository.url` is not a valid url, but in the style of "[owner-name]/[repo-name]", `repository.url` will be set to git://github.com/[owner-name]/[repo-name]
+* If `repository.url` is not a valid url, but in the style of "[owner-name]/[repo-name]", `repository.url` will be set to https://github.com/[owner-name]/[repo-name]
* If `bugs` field is a string, the value of `bugs` field is changed into an object with `url` set to the original string value.
* If `bugs` field does not exist, but `repository` field points to a repository hosted on GitHub, the value of the `bugs` field gets set to an url in the form of https://github.com/[owner-name]/[repo-name]/issues . If the repository field points to a GitHub Gist repo url, the associated http url is chosen.
* If `bugs` field is an object, the resulting value only has email and url properties. If email and url properties are not strings, they are ignored. If no valid values for either email or url is found, bugs field will be removed.
@@ -91,6 +93,10 @@
If `version` field is given, the value of the version field must be a valid *semver* string, as determined by the `semver.valid` method. See [documentation for the semver module](https://github.com/isaacs/node-semver).
+### Rules for license field
+
+The `license` field should be a valid *SDPDX license expression* string, as determined by the `spdx.valid` method. See [documentation for the spdx module](https://github.com/kemitchell/spdx.js).
+
## Credits
This package contains code based on read-package-json written by Isaac Z. Schlueter. Used with permisson.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/lib/fixer.js new/package/lib/fixer.js
--- old/package/lib/fixer.js 2014-09-30 01:09:04.000000000 +0200
+++ new/package/lib/fixer.js 2015-05-22 01:32:48.000000000 +0200
@@ -1,11 +1,11 @@
var semver = require("semver")
-var parseGitHubURL = require("github-url-from-git")
+var spdx = require('spdx');
+var hostedGitInfo = require("hosted-git-info")
var depTypes = ["dependencies","devDependencies","optionalDependencies"]
var extractDescription = require("./extract_description")
var url = require("url")
var typos = require("./typos")
var coreModuleNames = require("./core_module_names")
-var githubUserRepo = require("github-url-from-username-repo")
var fixer = module.exports = {
// default warning function
@@ -25,12 +25,10 @@
}
var r = data.repository.url || ""
if (r) {
- var ghurl = parseGitHubURL(r)
- if (ghurl) {
- r = ghurl.replace(/^https?:\/\//, 'git://')
- } else if (githubUserRepo(r)) {
- // repo has 'user/reponame' filled in as repo
- data.repository.url = githubUserRepo(r)
+ var hosted = hostedGitInfo.fromUrl(r)
+ if (hosted) {
+ r = data.repository.url
+ = hosted.getDefaultRepresentation() == "shortcut" ? hosted.https() : hosted.toString()
}
}
@@ -57,7 +55,7 @@
if (typeof data.scripts[k] !== "string") {
this.warn("nonStringScript")
delete data.scripts[k]
- } else if (typos.script[k]) {
+ } else if (typos.script[k] && !data.scripts[typos.script[k]]) {
this.warn("typo", k, typos.script[k], "scripts")
}
}, this)
@@ -143,11 +141,8 @@
this.warn("nonStringDependency", d, JSON.stringify(r))
delete data[deps][d]
}
- // "/" is not allowed as packagename for publishing, but for git-urls
- // normalize shorthand-urls
- if (githubUserRepo(data[deps][d])) {
- data[deps][d] = 'git+' + githubUserRepo(data[deps][d])
- }
+ var hosted = hostedGitInfo.fromUrl(data[deps][d])
+ if (hosted) data[deps][d] = hosted.toString()
}, this)
}, this)
}
@@ -198,7 +193,10 @@
modifyPeople(data, parsePerson)
}
-, fixNameField: function(data, strict) {
+, fixNameField: function(data, options) {
+ if (typeof options === "boolean") options = {strict: options}
+ else if (typeof options === "undefined") options = {}
+ var strict = options.strict
if (!data.name && !strict) {
data.name = ""
return
@@ -208,7 +206,7 @@
}
if (!strict)
data.name = data.name.trim()
- ensureValidName(data.name, strict)
+ ensureValidName(data.name, strict, options.allowLegacyCase)
if (coreModuleNames.indexOf(data.name) !== -1)
this.warn("conflictingName", data.name)
}
@@ -234,12 +232,9 @@
, fixBugsField: function(data) {
if (!data.bugs && data.repository && data.repository.url) {
- var gh = parseGitHubURL(data.repository.url)
- if(gh) {
- if(gh.match(/^https:\/\/github.com\//))
- data.bugs = {url: gh + "/issues"}
- else // gist url
- data.bugs = {url: gh}
+ var hosted = hostedGitInfo.fromUrl(data.repository.url)
+ if(hosted && hosted.bugs()) {
+ data.bugs = {url: hosted.bugs()}
}
}
else if(data.bugs) {
@@ -278,13 +273,10 @@
, fixHomepageField: function(data) {
if (!data.homepage && data.repository && data.repository.url) {
- var gh = parseGitHubURL(data.repository.url)
- if (gh)
- data.homepage = gh
- else
- return true
- } else if (!data.homepage)
- return true
+ var hosted = hostedGitInfo.fromUrl(data.repository.url)
+ if (hosted && hosted.docs()) data.homepage = hosted.docs()
+ }
+ if (!data.homepage) return
if(typeof data.homepage !== "string") {
this.warn("nonUrlHomepage")
@@ -295,6 +287,18 @@
data.homepage = "http://" + data.homepage
}
}
+
+, fixLicenseField: function(data) {
+ if (!data.license) {
+ return this.warn("missingLicense")
+ } else if (
+ typeof(data.license) !== 'string' ||
+ data.license.length < 1 ||
+ !spdx.valid(data.license)
+ ) {
+ this.warn("nonSPDXLicense")
+ }
+ }
}
function isValidScopedPackageName(spec) {
@@ -313,10 +317,10 @@
spec === encodeURIComponent(spec)
}
-function ensureValidName (name, strict) {
+function ensureValidName (name, strict, allowLegacyCase) {
if (name.charAt(0) === "." ||
!(isValidScopedPackageName(name) || isCorrectlyEncodedName(name)) ||
- (strict && name !== name.toLowerCase()) ||
+ (strict && (!allowLegacyCase) && name !== name.toLowerCase()) ||
name.toLowerCase() === "node_modules" ||
name.toLowerCase() === "favicon.ico") {
throw new Error("Invalid name: " + JSON.stringify(name))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/lib/normalize.js new/package/lib/normalize.js
--- old/package/lib/normalize.js 2014-04-25 00:48:20.000000000 +0200
+++ new/package/lib/normalize.js 2015-05-22 01:32:48.000000000 +0200
@@ -1,10 +1,12 @@
module.exports = normalize
var fixer = require("./fixer")
+normalize.fixer = fixer
+
var makeWarning = require("./make_warning")
var fieldsToFix = ['name','version','description','repository','modules','scripts'
- ,'files','bin','man','bugs','keywords','readme','homepage']
+ ,'files','bin','man','bugs','keywords','readme','homepage','license']
var otherThingsToFix = ['dependencies','people', 'typos']
var thingsToFix = fieldsToFix.map(function(fieldName) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/lib/warning_messages.json new/package/lib/warning_messages.json
--- old/package/lib/warning_messages.json 2014-09-30 01:08:55.000000000 +0200
+++ new/package/lib/warning_messages.json 2015-05-22 01:32:48.000000000 +0200
@@ -19,11 +19,13 @@
,"nonStringDescription": "'description' field should be a string"
,"missingDescription": "No description"
,"missingReadme": "No README data"
+ ,"missingLicense": "No license field."
,"nonEmailUrlBugsString": "Bug string field must be url, email, or {email,url}"
,"nonUrlBugsUrlField": "bugs.url field must be a string url. Deleted."
,"nonEmailBugsEmailField": "bugs.email field must be a string email. Deleted."
,"emptyNormalizedBugs": "Normalized value of bugs field is an empty object. Deleted."
,"nonUrlHomepage": "homepage field must be a string url. Deleted."
+ ,"nonSPDXLicense": "license should be a valid SPDX license expression"
,"missingProtocolHomepage": "homepage field must start with a protocol."
,"typo": "%s should probably be %s."
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/package.json new/package/package.json
--- old/package/package.json 2014-09-30 01:12:07.000000000 +0200
+++ new/package/package.json 2015-05-22 01:43:21.000000000 +0200
@@ -1,20 +1,21 @@
{
"name": "normalize-package-data",
- "version": "1.0.3",
+ "version": "2.2.0",
"author": "Meryn Stol <merynstol(a)gmail.com>",
"description": "Normalizes data that can be found in package.json files.",
+ "license": "BSD-2-Clause",
"repository": {
"type": "git",
- "url": "git://github.com/meryn/normalize-package-data.git"
+ "url": "git://github.com/npm/normalize-package-data.git"
},
"main": "lib/normalize.js",
"scripts": {
"test": "tap test/*.js"
},
"dependencies": {
- "github-url-from-git": "^1.3.0",
- "github-url-from-username-repo": "^1.0.0",
- "semver": "2 || 3 || 4"
+ "hosted-git-info": "^2.0.2",
+ "semver": "2 || 3 || 4",
+ "spdx": "^0.4.0"
},
"devDependencies": {
"tap": "~0.2.5",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/test/fixtures/read-package-json.json new/package/test/fixtures/read-package-json.json
--- old/package/test/fixtures/read-package-json.json 2013-04-20 01:02:39.000000000 +0200
+++ new/package/test/fixtures/read-package-json.json 2015-05-22 01:32:48.000000000 +0200
@@ -7,6 +7,7 @@
"type": "git",
"url": "git://github.com/isaacs/read-package-json.git"
},
+ "license": "MIT",
"main": "read-json.js",
"scripts": {
"test": "tap test/*.js"
@@ -24,4 +25,4 @@
"npmlog": "0",
"graceful-fs": "~1.1.8"
}
-}
\ No newline at end of file
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/test/mixedcase-names.js new/package/test/mixedcase-names.js
--- old/package/test/mixedcase-names.js 1970-01-01 01:00:00.000000000 +0100
+++ new/package/test/mixedcase-names.js 2015-05-22 01:32:48.000000000 +0200
@@ -0,0 +1,32 @@
+var test = require('tap').test
+
+var normalize = require('../')
+var fixer = normalize.fixer
+
+test('mixedcase', function (t) {
+ t.doesNotThrow(function () {
+ fixer.fixNameField({name: 'foo'}, true)
+ })
+
+ t.doesNotThrow(function () {
+ fixer.fixNameField({name: 'foo'}, false)
+ })
+
+ t.doesNotThrow(function () {
+ fixer.fixNameField({name: 'foo'})
+ })
+
+ t.throws(function () {
+ fixer.fixNameField({name: 'Foo'}, true)
+ }, new Error('Invalid name: "Foo"'), 'should throw an error')
+
+ t.throws(function () {
+ fixer.fixNameField({name: 'Foo'}, {strict: true})
+ }, new Error('Invalid name: "Foo"'), 'should throw an error')
+
+ t.doesNotThrow(function () {
+ fixer.fixNameField({name: 'Foo'}, {strict: true, allowLegacyCase: true})
+ })
+
+ t.end()
+})
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/test/normalize.js new/package/test/normalize.js
--- old/package/test/normalize.js 2014-06-06 08:06:18.000000000 +0200
+++ new/package/test/normalize.js 2015-05-22 01:32:48.000000000 +0200
@@ -9,6 +9,7 @@
var safeFormat = require("../lib/safe_format")
var rpjPath = path.resolve(__dirname,"./fixtures/read-package-json.json")
+
tap.test("normalize some package data", function(t) {
var packageData = require(rpjPath)
var warnings = []
@@ -52,7 +53,8 @@
t.same(warnings, [
warningMessages.missingDescription,
warningMessages.missingRepository,
- warningMessages.missingReadme
+ warningMessages.missingReadme,
+ warningMessages.missingLicense
])
t.end()
})
@@ -75,7 +77,8 @@
safeFormat(warningMessages.conflictingName, 'http'),
warningMessages.nonEmailUrlBugsString,
warningMessages.emptyNormalizedBugs,
- warningMessages.nonUrlHomepage
+ warningMessages.nonUrlHomepage,
+ warningMessages.missingLicense
]
t.same(warnings, expect)
t.end()
@@ -109,9 +112,11 @@
warningMessages.nonEmailBugsEmailField,
warningMessages.emptyNormalizedBugs,
warningMessages.missingReadme,
+ warningMessages.missingLicense,
warningMessages.nonEmailUrlBugsString,
warningMessages.emptyNormalizedBugs,
- warningMessages.nonUrlHomepage ]
+ warningMessages.nonUrlHomepage,
+ warningMessages.missingLicense]
t.same(warnings, expect)
t.end()
})
@@ -132,18 +137,40 @@
[ warningMessages.missingDescription,
warningMessages.missingRepository,
warningMessages.missingReadme,
- warningMessages.missingProtocolHomepage ]
+ warningMessages.missingProtocolHomepage,
+ warningMessages.missingLicense]
t.same(warnings, expect)
t.same(a.homepage, 'http://example.org')
t.end()
})
+tap.test("license field should be a valid SPDX expression", function(t) {
+ var warnings = []
+ function warn(w) {
+ warnings.push(w)
+ }
+ var a
+ normalize(a={
+ license: 'Apache 2'
+ }, warn)
+
+ console.error(a)
+
+ var expect =
+ [ warningMessages.missingDescription,
+ warningMessages.missingRepository,
+ warningMessages.missingReadme,
+ warningMessages.nonSPDXLicense]
+ t.same(warnings, expect)
+ t.end()
+})
+
tap.test("gist bugs url", function(t) {
var d = {
repository: "git@gist.github.com:123456.git"
}
normalize(d)
- t.same(d.repository, { type: 'git', url: 'git@gist.github.com:123456.git' })
+ t.same(d.repository, { type: 'git', url: 'git+ssh://git@gist.github.com/123456.git' })
t.same(d.bugs, { url: 'https://gist.github.com/123456' })
t.end();
});
@@ -151,21 +178,21 @@
tap.test("singularize repositories", function(t) {
var d = {repositories:["git@gist.github.com:123456.git"]}
normalize(d)
- t.same(d.repository, { type: 'git', url: 'git@gist.github.com:123456.git' })
+ t.same(d.repository, { type: 'git', url: 'git+ssh://git@gist.github.com/123456.git' })
t.end()
});
tap.test("treat visionmedia/express as github repo", function(t) {
var d = {repository: {type: "git", url: "visionmedia/express"}}
normalize(d)
- t.same(d.repository, { type: "git", url: "https://github.com/visionmedia/express" })
+ t.same(d.repository, { type: "git", url: "git+https://github.com/visionmedia/express.git" })
t.end()
});
tap.test("treat isaacs/node-graceful-fs as github repo", function(t) {
var d = {repository: {type: "git", url: "isaacs/node-graceful-fs"}}
normalize(d)
- t.same(d.repository, { type: "git", url: "https://github.com/isaacs/node-graceful-fs" })
+ t.same(d.repository, { type: "git", url: "git+https://github.com/isaacs/node-graceful-fs.git" })
t.end()
});
@@ -174,7 +201,7 @@
normalize(a={
repository: { type: "git", url: "https://github.com/isaacs/node-graceful-fs" }
})
- t.same(a.homepage, 'https://github.com/isaacs/node-graceful-fs')
+ t.same(a.homepage, 'https://github.com/isaacs/node-graceful-fs#readme')
t.end()
})
@@ -192,14 +219,14 @@
normalize(a={
repository: { type: "git", url: "sindresorhus/chalk" }
})
- t.same(a.homepage, 'https://github.com/sindresorhus/chalk')
+ t.same(a.homepage, 'https://github.com/sindresorhus/chalk#readme')
t.end()
})
-tap.test("treat isaacs/node-graceful-fs as github repo in dependencies", function(t) {
+tap.test("don't mangle github shortcuts in dependencies", function(t) {
var d = {dependencies: {"node-graceful-fs": "isaacs/node-graceful-fs"}}
normalize(d)
- t.same(d.dependencies, {"node-graceful-fs": "git+https://github.com/isaacs/node-graceful-fs" })
+ t.same(d.dependencies, {"node-graceful-fs": "github:isaacs/node-graceful-fs" })
t.end()
});
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/test/typo.js new/package/test/typo.js
--- old/package/test/typo.js 2014-04-25 00:48:20.000000000 +0200
+++ new/package/test/typo.js 2015-05-22 01:32:48.000000000 +0200
@@ -15,6 +15,7 @@
var expect =
[ warningMessages.missingRepository,
+ warningMessages.missingLicense,
typoMessage('dependancies', 'dependencies'),
typoMessage('dependecies', 'dependencies'),
typoMessage('depdenencies', 'dependencies'),
@@ -66,7 +67,8 @@
typoMessage("bugs['name']", "bugs['url']"),
warningMessages.nonUrlBugsUrlField,
warningMessages.emptyNormalizedBugs,
- warningMessages.missingReadme ]
+ warningMessages.missingReadme,
+ warningMessages.missingLicense]
normalize({name:"name"
,version:"1.2.5"
@@ -79,6 +81,7 @@
[ warningMessages.missingDescription,
warningMessages.missingRepository,
warningMessages.missingReadme,
+ warningMessages.missingLicense,
typoMessage('script', 'scripts') ]
normalize({name:"name"
@@ -93,7 +96,8 @@
warningMessages.missingRepository,
typoMessage("scripts['server']", "scripts['start']"),
typoMessage("scripts['tests']", "scripts['test']"),
- warningMessages.missingReadme ]
+ warningMessages.missingReadme,
+ warningMessages.missingLicense]
normalize({name:"name"
,version:"1.2.5"
@@ -101,6 +105,20 @@
t.same(warnings, expect)
+ warnings.length = 0
+ expect =
+ [ warningMessages.missingDescription,
+ warningMessages.missingRepository,
+ warningMessages.missingReadme,
+ warningMessages.missingLicense]
+
+ normalize({name:"name"
+ ,version:"1.2.5"
+ ,scripts:{server:"start",tests:"test"
+ ,start:"start",test:"test"}}, warn)
+
+ t.same(warnings, expect)
+
warnings.length = 0
expect = []
1
0
Hello community,
here is the log from the commit of package nodejs-lru-cache for openSUSE:Factory checked in at 2015-07-02 22:39:15
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/nodejs-lru-cache (Old)
and /work/SRC/openSUSE:Factory/.nodejs-lru-cache.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "nodejs-lru-cache"
Changes:
--------
--- /work/SRC/openSUSE:Factory/nodejs-lru-cache/nodejs-lru-cache.changes 2015-04-27 13:01:35.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.nodejs-lru-cache.new/nodejs-lru-cache.changes 2015-07-02 22:39:17.000000000 +0200
@@ -1,0 +2,10 @@
+Sat Jun 6 11:44:03 UTC 2015 - i(a)marguerite.su
+
+- update version 2.6.4
+
+-------------------------------------------------------------------
+Fri Apr 24 12:19:04 UTC 2015 - hvogel(a)suse.com
+
+- Update to version 2.6.1
+
+-------------------------------------------------------------------
Old:
----
node-lru-cache-2.5.0.tar.gz
New:
----
lru-cache-2.6.4.tgz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ nodejs-lru-cache.spec ++++++
--- /var/tmp/diff_new_pack.01di0S/_old 2015-07-02 22:39:17.000000000 +0200
+++ /var/tmp/diff_new_pack.01di0S/_new 2015-07-02 22:39:17.000000000 +0200
@@ -19,13 +19,13 @@
%define base_name lru-cache
Name: nodejs-lru-cache
-Version: 2.5.0
+Version: 2.6.4
Release: 0
Summary: LRU Cache
License: MIT
Group: Development/Libraries/Other
Url: https://github.com/isaacs/node-lru-cache
-Source: node-%{base_name}-%{version}.tar.gz
+Source: http://registry.npmjs.org/%{base_name}/-/%{base_name}-%{version}.tgz
BuildRequires: nodejs-packaging
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
@@ -37,7 +37,7 @@
A cache object that deletes the least-recently-used items.
%prep
-%setup -q -n node-%{base_name}-%{version}
+%setup -q -n package
%build
1
0
Hello community,
here is the log from the commit of package nodejs-lockfile for openSUSE:Factory checked in at 2015-07-02 22:39:07
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/nodejs-lockfile (Old)
and /work/SRC/openSUSE:Factory/.nodejs-lockfile.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "nodejs-lockfile"
Changes:
--------
--- /work/SRC/openSUSE:Factory/nodejs-lockfile/nodejs-lockfile.changes 2015-04-27 13:01:35.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.nodejs-lockfile.new/nodejs-lockfile.changes 2015-07-02 22:39:08.000000000 +0200
@@ -1,0 +2,5 @@
+Sat Jun 6 11:41:12 UTC 2015 - i(a)marguerite.su
+
+- update version 1.0.1
+
+-------------------------------------------------------------------
Old:
----
lockfile-1.0.0.tgz
New:
----
lockfile-1.0.1.tgz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ nodejs-lockfile.spec ++++++
--- /var/tmp/diff_new_pack.MB74lT/_old 2015-07-02 22:39:09.000000000 +0200
+++ /var/tmp/diff_new_pack.MB74lT/_new 2015-07-02 22:39:09.000000000 +0200
@@ -19,10 +19,10 @@
%define base_name lockfile
Name: nodejs-lockfile
-Version: 1.0.0
+Version: 1.0.1
Release: 0
Summary: Node.js lock file utility
-License: BSD-2-Clause
+License: ISC
Group: Development/Languages/Other
Url: https://github.com/isaacs/lockfile
Source: http://registry.npmjs.org/%{base_name}/-/%{base_name}-%{version}.tgz
++++++ lockfile-1.0.0.tgz -> lockfile-1.0.1.tgz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/LICENSE new/package/LICENSE
--- old/package/LICENSE 2012-07-24 03:28:24.000000000 +0200
+++ new/package/LICENSE 2015-05-20 09:02:02.000000000 +0200
@@ -1,27 +1,15 @@
-Copyright (c) Isaac Z. Schlueter ("Author")
-All rights reserved.
+The ISC License
-The BSD License
+Copyright (c) Isaac Z. Schlueter and Contributors
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
-1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
-2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
-BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
-BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
-IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/README.md new/package/README.md
--- old/package/README.md 2014-08-17 02:35:55.000000000 +0200
+++ new/package/README.md 2015-05-20 09:00:42.000000000 +0200
@@ -51,13 +51,13 @@
Check if the lockfile is locked and not stale.
-Returns boolean.
+Callback is called with `cb(error, isLocked)`.
-### lockFile.checkSync(path, [opts], cb)
+### lockFile.checkSync(path, [opts])
Check if the lockfile is locked and not stale.
-Callback is called with `cb(error, isLocked)`.
+Returns boolean.
## Options
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package/package.json new/package/package.json
--- old/package/package.json 2014-08-20 20:44:41.000000000 +0200
+++ new/package/package.json 2015-05-20 09:02:03.000000000 +0200
@@ -1,6 +1,6 @@
{
"name": "lockfile",
- "version": "1.0.0",
+ "version": "1.0.1",
"main": "lockfile.js",
"directories": {
"test": "test"
@@ -25,6 +25,6 @@
"O_EXCL"
],
"author": "Isaac Z. Schlueter <i(a)izs.me> (http://blog.izs.me/)",
- "license": "BSD",
+ "license": "ISC",
"description": "A very polite lock file utility, which endeavors to not litter, and to wait patiently for others."
}
1
0