diff -Nru node-lockfile-1.0.4/debian/changelog node-lockfile-1.0.4/debian/changelog --- node-lockfile-1.0.4/debian/changelog 2018-09-16 08:53:38.000000000 +0000 +++ node-lockfile-1.0.4/debian/changelog 2019-11-19 21:46:07.000000000 +0000 @@ -1,3 +1,24 @@ +node-lockfile (1.0.4-3) unstable; urgency=medium + + * Team upload + * Back to unstable after successful tests + * Bump debhelper compatibility level to 12 + * Declare compliance with policy 4.4.1 + * Add "Rules-Requires-Root: no" + * Add debian/gbp.conf + * Switch install to pkg-js-tools + + -- Xavier Guimard Tue, 19 Nov 2019 22:46:07 +0100 + +node-lockfile (1.0.4-2) experimental; urgency=medium + + * Team upload + * Switch tests to pkg-js-tools and embed "touch" for tests (Closes: #928645) + * Declare compliance with policy 4.3.0 + * Add upstream/metadata + + -- Xavier Guimard Wed, 08 May 2019 11:41:01 +0200 + node-lockfile (1.0.4-1) unstable; urgency=medium * Team upload diff -Nru node-lockfile-1.0.4/debian/compat node-lockfile-1.0.4/debian/compat --- node-lockfile-1.0.4/debian/compat 2018-09-16 08:53:38.000000000 +0000 +++ node-lockfile-1.0.4/debian/compat 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -11 diff -Nru node-lockfile-1.0.4/debian/control node-lockfile-1.0.4/debian/control --- node-lockfile-1.0.4/debian/control 2018-09-16 08:53:38.000000000 +0000 +++ node-lockfile-1.0.4/debian/control 2019-11-19 21:44:25.000000000 +0000 @@ -3,14 +3,17 @@ Priority: optional Maintainer: Debian Javascript Maintainers Uploaders: Jérémy Lal +Testsuite: autopkgtest-pkg-nodejs Build-Depends: - debhelper (>= 11~) + debhelper-compat (= 12) , node-tap , node-signal-exit (>= 3.0.2~) -Standards-Version: 4.2.1 + , pkg-js-tools (>= 0.9.12~) +Standards-Version: 4.4.1 Homepage: https://github.com/isaacs/lockfile Vcs-Git: https://salsa.debian.org/js-team/node-lockfile.git Vcs-Browser: https://salsa.debian.org/js-team/node-lockfile +Rules-Requires-Root: no Package: node-lockfile Architecture: all diff -Nru node-lockfile-1.0.4/debian/copyright node-lockfile-1.0.4/debian/copyright --- node-lockfile-1.0.4/debian/copyright 2018-09-16 08:53:38.000000000 +0000 +++ node-lockfile-1.0.4/debian/copyright 2019-11-19 18:45:44.000000000 +0000 @@ -1,12 +1,21 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: lockfile Upstream-Contact: https://github.com/isaacs/lockfile/issues Source: https://github.com/isaacs/lockfile Files: * -Copyright: 2012-2013 Isaac Z. Schlueter +Copyright: 2012-2013, Isaac Z. Schlueter License: BSD-2-clause +Files: debian/* +Copyright: 2013, Jérémy Lal + 2019, Xavier Guimard +License: BSD-2-clause + +Files: debian/tests/test-modules/touch/* +Copyright: 2009-2011, Isaac Z. Schlueter +License: Expat + License: BSD-2-clause Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -31,3 +40,25 @@ 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. + +License: Expat + 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: + . + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + . + 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. diff -Nru node-lockfile-1.0.4/debian/gbp.conf node-lockfile-1.0.4/debian/gbp.conf --- node-lockfile-1.0.4/debian/gbp.conf 1970-01-01 00:00:00.000000000 +0000 +++ node-lockfile-1.0.4/debian/gbp.conf 2019-11-19 21:43:49.000000000 +0000 @@ -0,0 +1,5 @@ +[DEFAULT] +pristine-tar = True + +[import-orig] +filter = [ '.gitignore', '.travis.yml', '.git*' ] diff -Nru node-lockfile-1.0.4/debian/install node-lockfile-1.0.4/debian/install --- node-lockfile-1.0.4/debian/install 2018-09-16 08:53:38.000000000 +0000 +++ node-lockfile-1.0.4/debian/install 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -lockfile.js usr/lib/nodejs/lockfile -package.json usr/lib/nodejs/lockfile diff -Nru node-lockfile-1.0.4/debian/patches/remove-touch.patch node-lockfile-1.0.4/debian/patches/remove-touch.patch --- node-lockfile-1.0.4/debian/patches/remove-touch.patch 2018-09-16 08:53:38.000000000 +0000 +++ node-lockfile-1.0.4/debian/patches/remove-touch.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ -touch module can be replaced easily with fs - ---- a/test/basic.js -+++ b/test/basic.js -@@ -2,7 +2,7 @@ - var lockFile = require('../lockfile.js') - var path = require('path') - var fs = require('fs') --var touch = require('touch') -+var touch = { 'sync' : function (f) { var fs = require('fs') ;fs.closeSync(fs.openSync(f,'w')) ; } } - - // On Unix systems, it uses ctime by default for staleness checks, since it's - // the most reliable. However, because this test artificially sets some locks ---- a/test/retry-time.js -+++ b/test/retry-time.js -@@ -9,7 +9,7 @@ - // But it should NOT be as slow as 2000. - - var lockFile = require('../') --var touch = require('touch') -+var touch = { 'sync' : function (f) { var fs = require('fs') ;fs.closeSync(fs.openSync(f,'w')) ; } } - var test = require('tap').test - var fs = require('fs') - ---- a/test/stale-contention.js -+++ b/test/stale-contention.js -@@ -3,7 +3,7 @@ - var test = require('tap').test - var path = require('path') - var lock = path.resolve(__dirname, 'stale.lock') --var touch = require('touch') -+var touch = { 'sync' : function (f) { var fs = require('fs') ;fs.closeSync(fs.openSync(f,'w')) ; } } - var spawn = require('child_process').spawn - var node = process.execPath - diff -Nru node-lockfile-1.0.4/debian/patches/series node-lockfile-1.0.4/debian/patches/series --- node-lockfile-1.0.4/debian/patches/series 2018-09-16 08:53:38.000000000 +0000 +++ node-lockfile-1.0.4/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -remove-touch.patch diff -Nru node-lockfile-1.0.4/debian/rules node-lockfile-1.0.4/debian/rules --- node-lockfile-1.0.4/debian/rules 2018-09-16 08:53:38.000000000 +0000 +++ node-lockfile-1.0.4/debian/rules 2019-11-19 18:45:44.000000000 +0000 @@ -5,13 +5,4 @@ #export DH_VERBOSE=1 %: - dh $@ - -override_dh_auto_test: -ifeq (,$(filter nocheck,$(DEB_BUILD_PROFILES))) - # TODO: investigate why stale-contention is failing - mkdir node_modules - ln -s .. node_modules/lockfile - tap test/{basic,retry-time,unlock-no-cb}.js - rm -rf node_modules -endif + dh $@ --with nodejs diff -Nru node-lockfile-1.0.4/debian/tests/control node-lockfile-1.0.4/debian/tests/control --- node-lockfile-1.0.4/debian/tests/control 2018-09-16 08:53:38.000000000 +0000 +++ node-lockfile-1.0.4/debian/tests/control 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -Tests: require -Depends: node-lockfile - -Test-Command: tap test/{basic,retry-time,unlock-no-cb}.js -Depends: @, node-tap diff -Nru node-lockfile-1.0.4/debian/tests/pkg-js/files node-lockfile-1.0.4/debian/tests/pkg-js/files --- node-lockfile-1.0.4/debian/tests/pkg-js/files 1970-01-01 00:00:00.000000000 +0000 +++ node-lockfile-1.0.4/debian/tests/pkg-js/files 2019-11-19 18:45:44.000000000 +0000 @@ -0,0 +1,2 @@ +debian/tests/test-modules +test diff -Nru node-lockfile-1.0.4/debian/tests/pkg-js/test node-lockfile-1.0.4/debian/tests/pkg-js/test --- node-lockfile-1.0.4/debian/tests/pkg-js/test 1970-01-01 00:00:00.000000000 +0000 +++ node-lockfile-1.0.4/debian/tests/pkg-js/test 2019-11-19 18:45:44.000000000 +0000 @@ -0,0 +1,5 @@ +set -e +ln -s ../../.. debian/tests/test-modules/lockfile +#NODE_PATH=debian/tests/test-modules tap test/{basic,retry-time,unlock-no-cb}.js +NODE_PATH=debian/tests/test-modules tap test/*.js +rm -f debian/tests/test-modules/lockfile diff -Nru node-lockfile-1.0.4/debian/tests/require node-lockfile-1.0.4/debian/tests/require --- node-lockfile-1.0.4/debian/tests/require 2018-09-16 08:53:38.000000000 +0000 +++ node-lockfile-1.0.4/debian/tests/require 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -#!/bin/sh -set -e -nodejs -e "require('lockfile');" diff -Nru node-lockfile-1.0.4/debian/tests/test-modules/touch/LICENSE node-lockfile-1.0.4/debian/tests/test-modules/touch/LICENSE --- node-lockfile-1.0.4/debian/tests/test-modules/touch/LICENSE 1970-01-01 00:00:00.000000000 +0000 +++ node-lockfile-1.0.4/debian/tests/test-modules/touch/LICENSE 2019-11-19 18:45:44.000000000 +0000 @@ -0,0 +1,23 @@ +Copyright 2009, 2010, 2011 Isaac Z. Schlueter. +All rights reserved. + +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: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +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. diff -Nru node-lockfile-1.0.4/debian/tests/test-modules/touch/package.json node-lockfile-1.0.4/debian/tests/test-modules/touch/package.json --- node-lockfile-1.0.4/debian/tests/test-modules/touch/package.json 1970-01-01 00:00:00.000000000 +0000 +++ node-lockfile-1.0.4/debian/tests/test-modules/touch/package.json 2019-11-19 18:45:44.000000000 +0000 @@ -0,0 +1,54 @@ +{ + "_args": [ + [ + "touch@0.0.2", + "/home/xavier/dev/debian/src/pkg-js/packages/node-lockfile" + ] + ], + "_development": true, + "_from": "touch@0.0.2", + "_id": "touch@0.0.2", + "_inBundle": false, + "_integrity": "sha1-plp3d5Xly74SmUmb3EIoH/shtfQ=", + "_location": "/touch", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "touch@0.0.2", + "name": "touch", + "escapedName": "touch", + "rawSpec": "0.0.2", + "saveSpec": null, + "fetchSpec": "0.0.2" + }, + "_requiredBy": [ + "#DEV:/" + ], + "_resolved": "https://registry.npmjs.org/touch/-/touch-0.0.2.tgz", + "_spec": "0.0.2", + "_where": "/home/xavier/dev/debian/src/pkg-js/packages/node-lockfile", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/node-touch/issues" + }, + "dependencies": { + "nopt": "~1.0.10" + }, + "description": "like touch(1) in node", + "engines": { + "node": ">=0.6" + }, + "homepage": "https://github.com/isaacs/node-touch#readme", + "main": "touch.js", + "name": "touch", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-touch.git" + }, + "version": "0.0.2" +} diff -Nru node-lockfile-1.0.4/debian/tests/test-modules/touch/README.md node-lockfile-1.0.4/debian/tests/test-modules/touch/README.md --- node-lockfile-1.0.4/debian/tests/test-modules/touch/README.md 1970-01-01 00:00:00.000000000 +0000 +++ node-lockfile-1.0.4/debian/tests/test-modules/touch/README.md 2019-11-19 18:45:44.000000000 +0000 @@ -0,0 +1,33 @@ +# node-touch + +For all your node touching needs. + +## CLI Usage: + +See `man touch` + +## API Usage: + +```javascript +var touch = require("touch") +``` + +Gives you the following functions: + +* `touch(filename, options, cb)` +* `touch.sync(filename, options)` +* `touch.ftouch(fd, options, cb)` +* `touch.ftouchSync(fd, options)` + +## Options + +* `force` like `touch -f` Boolean +* `time` like `touch -t ` Can be a Date object, or any parseable + Date string, or epoch ms number. +* `atime` like `touch -a` Can be either a Boolean, or a Date. +* `mtime` like `touch -m` Can be either a Boolean, or a Date. +* `ref` like `touch -r ` Must be path to a file. +* `nocreate` like `touch -c` Boolean + +If neither `atime` nor `mtime` are set, then both values are set. If +one of them is set, then the other is not. diff -Nru node-lockfile-1.0.4/debian/tests/test-modules/touch/touch.js node-lockfile-1.0.4/debian/tests/test-modules/touch/touch.js --- node-lockfile-1.0.4/debian/tests/test-modules/touch/touch.js 1970-01-01 00:00:00.000000000 +0000 +++ node-lockfile-1.0.4/debian/tests/test-modules/touch/touch.js 2019-11-19 18:45:44.000000000 +0000 @@ -0,0 +1,154 @@ +var fs = require("fs") + , cons = require("constants") + +module.exports = touch +touch.touchSync = touch.sync = function (f, options) { + return touch(f, options) +} + +touch.ftouch = ftouch +touch.ftouchSync = function (fd, options) { + return ftouch(fd, options) +} + +function validOpts (options) { + options = Object.create(options || {}) + + // {mtime: true}, {ctime: true} + // If set to something else, then treat as epoch ms value + var now = new Date(options.time || Date.now()) + if (!options.atime && !options.mtime) { + options.atime = options.mtime = now + } else if (true === options.atime) { + options.atime = now + } else if (true === options.mtime) { + options.mtime = now + } + + var oflags = 0 + if (!options.force) { + oflags = oflags | cons.O_RDWR + } + if (!options.nocreate) { + oflags = oflags | cons.O_CREAT + } + + options.oflags = oflags + return options +} + +function optionsRef (then, arg, options, cb) { + if (!options.ref) return then(arg, options, cb) + + return cb + ? fs.stat(options.ref, optionsRefcb(then, arg, options, cb)) + : optionsRefcb(then, arg, options)(null, fs.statSync(options.ref)) +} + +function optionsRefcb (then, arg, options, cb) { return function (er, s) { + if (er) { + er.path = er.file = options.ref + return cb(er) + } + options.atime = options.atime && s.atime.getTime() + options.mtime = options.mtime && s.mtime.getTime() + + // so we don't keep doing this. + options.ref = null + + return then(arg, options, cb) +}} + +function touch (f, options, cb) { + if (typeof options === "function") cb = options, options = null + options = validOpts(options) + return optionsRef(touch_, f, validOpts(options), cb) +} + +function touch_ (f, options, cb) { + return openThenF(f, options, cb) +} + +function openThenF (f, options, cb) { + options.closeAfter = true + return cb + ? fs.open(f, options.oflags, openThenFcb(options, cb)) + : openThenFcb(options)(null, fs.openSync(f, options.oflags)) +} + +function openThenFcb (options, cb) { return function (er, fd) { + if (er) { + if (fd && options.closeAfter) fs.close(fd, function () {}) + return cb(er) + } + return ftouch(fd, options, cb) +}} + +function ftouch (fd, options, cb) { + if (typeof options === "function") cb = options, options = null + return optionsRef(ftouch_, fd, validOpts(options), cb) +} + +function ftouch_ (fd, options, cb) { + // still not set. leave as what the file already has. + return fstatThenFutimes(fd, options, cb) +} + +function fstatThenFutimes (fd, options, cb) { + if (options.atime && options.mtime) return thenFutimes(fd, options, cb) + + return cb + ? fs.fstat(fd, fstatThenFutimescb(fd, options, cb)) + : fstatThenFutimescb(fd, options)(null, fs.fstatSync(fd)) +} + +function fstatThenFutimescb (fd, options, cb) { return function (er, s) { + if (er) { + if (options.closeAfter) fs.close(fd, function () {}) + return cb(er) + } + options.atime = options.atime || s.atime.getTime() + options.mtime = options.mtime || s.mtime.getTime() + return thenFutimes(fd, options, cb) +}} + +function thenFutimes (fd, options, cb) { + if (typeof options.atime === "object") { + options.atime = options.atime.getTime() + } + if (typeof options.mtime === "object") { + options.mtime = options.mtime.getTime() + } + + var a = parseInt(options.atime / 1000, 10) + , m = parseInt(options.mtime / 1000, 10) + return cb + ? fs.futimes(fd, a, m, thenFutimescb(fd, options, cb)) + : thenFutimescb(fd, options)(null, fs.futimesSync(fd, a, m)) +} + +function thenFutimescb (fd, options, cb) { return function (er, res) { + if (er) { + if (options.closeAfter) fs.close(fd, function () {}) + return cb(er) + } + return finish(fd, options, res, cb) +}} + +function finish (fd, options, res, cb) { + return options.closeAfter ? finishClose(fd, options, res, cb) + : cb ? cb(null, res) + : res +} + +function finishClose (fd, options, res, cb) { + return cb + ? fs.close(fd, finishClosecb(res, options, cb)) + : finishClosecb(res, options)(null, fs.closeSync(fd)) +} + +function finishClosecb (res, options, cb) { return function (er) { + if (er) return cb(er) + options.closeAfter = null + return finish(null, options, res, cb) +}} diff -Nru node-lockfile-1.0.4/debian/upstream/metadata node-lockfile-1.0.4/debian/upstream/metadata --- node-lockfile-1.0.4/debian/upstream/metadata 1970-01-01 00:00:00.000000000 +0000 +++ node-lockfile-1.0.4/debian/upstream/metadata 2019-11-19 18:45:44.000000000 +0000 @@ -0,0 +1,7 @@ +--- +Archive: GitHub +Bug-Database: https://github.com/isaacs/lockfile/issues +Contact: https://github.com/isaacs/lockfile/issues +Name: lockfile +Repository: https://github.com/isaacs/lockfile.git +Repository-Browse: https://github.com/isaacs/lockfile