From 6cfd106a7c15c17f670bd8415861d033d96f4181 Mon Sep 17 00:00:00 2001 From: zhouganqing Date: Fri, 17 Feb 2023 17:41:40 +0800 Subject: [PATCH] Import Debian changes 6.1.11+ds1+~cs6.0.6-ok1 node-tar (6.1.11+ds1+~cs6.0.6-ok1) yangtze; urgency=medium * Build for openKylin. --- debian/README.source | 30 ++++++ debian/changelog | 5 + debian/clean | 2 + debian/control | 41 +++++++ debian/copyright | 60 +++++++++++ debian/gbp.conf | 2 + debian/nodejs/root_modules | 1 + debian/rules | 12 +++ debian/source/format | 1 + debian/source/lintian-overrides | 5 + debian/tests/excluded | 9 ++ debian/tests/pkg-js/files | 5 + debian/tests/pkg-js/test | 3 + debian/tests/test_modules/chmodr/LICENSE | 15 +++ debian/tests/test_modules/chmodr/README.md | 31 ++++++ debian/tests/test_modules/chmodr/chmodr.js | 100 ++++++++++++++++++ debian/tests/test_modules/chmodr/package.json | 26 +++++ debian/watch | 23 ++++ 18 files changed, 371 insertions(+) create mode 100644 debian/README.source create mode 100644 debian/changelog create mode 100644 debian/clean create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/gbp.conf create mode 100644 debian/nodejs/root_modules create mode 100755 debian/rules create mode 100644 debian/source/format create mode 100644 debian/source/lintian-overrides create mode 100644 debian/tests/excluded create mode 100644 debian/tests/pkg-js/files create mode 100644 debian/tests/pkg-js/test create mode 100644 debian/tests/test_modules/chmodr/LICENSE create mode 100644 debian/tests/test_modules/chmodr/README.md create mode 100644 debian/tests/test_modules/chmodr/chmodr.js create mode 100644 debian/tests/test_modules/chmodr/package.json create mode 100644 debian/watch diff --git a/debian/README.source b/debian/README.source new file mode 100644 index 0000000..cb1580d --- /dev/null +++ b/debian/README.source @@ -0,0 +1,30 @@ +This package is built using pkg-components from: +https://salsa.debian.org/kapouer/pkg-components/commit/f8714364 +(while waiting for these changes to be accepted in official package). + +## how to get a source package from Vcs ? + +1. debcheckout +2. uscan-components + +This will, however, redownload original tarball. + +## how to update components ? + +uscan-components --upgrade + +## how to edit components ? + +copyright, control, watch, install files are available for each component. + +## how to update copyright file ? + +The copyright file for the main package is in +debian/components/copyright.in +and the ones for the components in +debian/components/*/copyright + +Various Debian tools require a static file in debian/copyright. +If for some reason the generated copyright file changes +copy from debian/$PACKAGE.copyright to debian/copyright after a build. + diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..31592c6 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +node-tar (6.1.11+ds1+~cs6.0.6-ok1) yangtze; urgency=medium + + * Build for openKylin. + + -- zhouganqing Fri, 17 Feb 2023 17:41:40 +0800 diff --git a/debian/clean b/debian/clean new file mode 100644 index 0000000..40b758b --- /dev/null +++ b/debian/clean @@ -0,0 +1,2 @@ +debian/node-tar.copyright +test/fixtures/unpack/ diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..cbb0b9a --- /dev/null +++ b/debian/control @@ -0,0 +1,41 @@ +Source: node-tar +Maintainer: OpenKylin Developers +Section: javascript +Testsuite: autopkgtest-pkg-nodejs +Priority: optional +Build-Depends: debhelper-compat (= 13), + dh-sequence-nodejs, + node-chownr , + node-end-of-stream , + node-minipass , + node-mkdirp (>= 1), + node-mutate-fs , + node-rimraf , + node-tap , + node-tar-stream , + node-yallist (>= 4.0~) +Standards-Version: 4.6.0 +Vcs-Browser: https://gitee.com/openkylin/node-tar +Vcs-Git: https://gitee.com/openkylin/node-tar.git +Homepage: https://github.com/npm/node-tar +Rules-Requires-Root: no + +Package: node-tar +Architecture: all +Depends: node-chownr, + node-minipass, + node-mkdirp (>= 1), + node-safe-buffer, + node-yallist (>= 4.0~), + ${misc:Depends} +Provides: ${nodejs:Provides} +Description: read and write portable tar archives module for Node.js + node-tar is able to read and write tar archives generated by + bsdtar, gnutar, solaris posix tar, and "Schilly" tar. + node-tar is a well-tested essential piece of software for npm, + the Node.js package manager. + . + This package includes components: chownr, minipass, fs-minipass, + minizlib. + . + Node.js is an event-based server-side javascript engine. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..a61f446 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,60 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: tar +Upstream-Contact: Isaac Z. Schlueter +Source: https://github.com/npm/node-tar +Comment: Repackaged for easier copyright maintainability, and lower file sizes. +Files-Excluded: + benchmarks/* +Files-Excluded-minizlib: npm-* + +Files: * +Copyright: Isaac Z. Schlueter and Contributors +License: ISC + +Files: debian/* +Copyright: 2012, Jérémy Lal + 2015, Bas Couwenberg + 2019, Yadd +License: ISC + +Files: debian/tests/test_modules/chmodr/* +Copyright: Isaac Z. Schlueter and Contributors +License: ISC + +Files: types-tar/* +Copyright: Microsoft Corporation +License: Expat + +License: ISC + 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. + +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 --git a/debian/gbp.conf b/debian/gbp.conf new file mode 100644 index 0000000..8f45e69 --- /dev/null +++ b/debian/gbp.conf @@ -0,0 +1,2 @@ +[import-orig] +filter=[ '.gitattributes', '.gitignore', '.travis.yml', '.git*' ] diff --git a/debian/nodejs/root_modules b/debian/nodejs/root_modules new file mode 100644 index 0000000..7d41e37 --- /dev/null +++ b/debian/nodejs/root_modules @@ -0,0 +1 @@ +types-tar diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..050d8c6 --- /dev/null +++ b/debian/rules @@ -0,0 +1,12 @@ +#!/usr/bin/make -f +# -*- makefile -*- + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +%: + dh $@ + +override_dh_fixperms: + dh_fixperms + chmod -x debian/node-tar/usr/share/nodejs/@types/tar/* diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/source/lintian-overrides b/debian/source/lintian-overrides new file mode 100644 index 0000000..e3e9bf7 --- /dev/null +++ b/debian/source/lintian-overrides @@ -0,0 +1,5 @@ +# Same author +add-component-copyright fs-minipass * +# test data +very-long-line-length-in-source-file test/dir-normalization.tar line * +very-long-line-length-in-source-file test/fixtures/* diff --git a/debian/tests/excluded b/debian/tests/excluded new file mode 100644 index 0000000..52f6563 --- /dev/null +++ b/debian/tests/excluded @@ -0,0 +1,9 @@ +test/create.js +test/normalize-windows-path.js +test/pack.js +test/path-reservations.js +test/replace.js +test/strip-absolute-path.js +test/unpack.js +test/update.js +test/write-entry.js diff --git a/debian/tests/pkg-js/files b/debian/tests/pkg-js/files new file mode 100644 index 0000000..4057de2 --- /dev/null +++ b/debian/tests/pkg-js/files @@ -0,0 +1,5 @@ +debian/tests/excluded +debian/tests/test_modules +map.js +README.md +test diff --git a/debian/tests/pkg-js/test b/debian/tests/pkg-js/test new file mode 100644 index 0000000..4898208 --- /dev/null +++ b/debian/tests/pkg-js/test @@ -0,0 +1,3 @@ +export TAP_TIMEOUT=60 +export NODE_PATH=debian/tests/test_modules:node_modules +tap `ls test/*.js|grep -v -f debian/tests/excluded` diff --git a/debian/tests/test_modules/chmodr/LICENSE b/debian/tests/test_modules/chmodr/LICENSE new file mode 100644 index 0000000..19129e3 --- /dev/null +++ b/debian/tests/test_modules/chmodr/LICENSE @@ -0,0 +1,15 @@ +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 --git a/debian/tests/test_modules/chmodr/README.md b/debian/tests/test_modules/chmodr/README.md new file mode 100644 index 0000000..4b342ca --- /dev/null +++ b/debian/tests/test_modules/chmodr/README.md @@ -0,0 +1,31 @@ +## Description +Has the same effect as the command line command: `chmod -R`. + +## Install + +``` +npm i --save chmodr +``` + +## Usage + +Takes the same arguments as [`fs.chmod()`](https://nodejs.org/api/fs.html#fs_fs_chmod_path_mode_callback) + +chmodr(path, mode, callback) +* path `` | `` | `` +* mode `` +* callback `` + * err `` + +## Example +```javascript +var chmodr = require('chmodr'); + +chmodr('/var/www/my/test/folder', 0o777, (err) => { + if (err) { + console.log('Failed to execute chmod', err); + } else { + console.log('Success'); + } +}); +``` diff --git a/debian/tests/test_modules/chmodr/chmodr.js b/debian/tests/test_modules/chmodr/chmodr.js new file mode 100644 index 0000000..c51e150 --- /dev/null +++ b/debian/tests/test_modules/chmodr/chmodr.js @@ -0,0 +1,100 @@ +'use strict' +const fs = require('fs') +const path = require('path') + +/* istanbul ignore next */ +const LCHMOD = fs.lchmod ? 'lchmod' : 'chmod' +/* istanbul ignore next */ +const LCHMODSYNC = fs.lchmodSync ? 'lchmodSync' : 'chmodSync' + +// fs.readdir could only accept an options object as of node v6 +const nodeVersion = process.version +let readdir = (path, options, cb) => fs.readdir(path, options, cb) +let readdirSync = (path, options) => fs.readdirSync(path, options) +/* istanbul ignore next */ +if (/^v4\./.test(nodeVersion)) + readdir = (path, options, cb) => fs.readdir(path, cb) + +// If a party has r, add x +// so that dirs are listable +const dirMode = mode => { + if (mode & 0o400) + mode |= 0o100 + if (mode & 0o40) + mode |= 0o10 + if (mode & 0o4) + mode |= 0o1 + return mode +} + +const chmodrKid = (p, child, mode, cb) => { + if (typeof child === 'string') + return fs.lstat(path.resolve(p, child), (er, stats) => { + if (er) + return cb(er) + stats.name = child + chmodrKid(p, stats, mode, cb) + }) + + if (child.isDirectory()) { + chmodr(path.resolve(p, child.name), mode, er => { + if (er) + return cb(er) + fs.chmod(path.resolve(p, child.name), dirMode(mode), cb) + }) + } else + fs[LCHMOD](path.resolve(p, child.name), mode, cb) +} + + +const chmodr = (p, mode, cb) => { + readdir(p, { withFileTypes: true }, (er, children) => { + // any error other than ENOTDIR means it's not readable, or + // doesn't exist. give up. + if (er && er.code !== 'ENOTDIR') return cb(er) + if (er) return fs[LCHMOD](p, mode, cb) + if (!children.length) return fs.chmod(p, dirMode(mode), cb) + + let len = children.length + let errState = null + const then = er => { + if (errState) return + if (er) return cb(errState = er) + if (-- len === 0) return fs.chmod(p, dirMode(mode), cb) + } + + children.forEach(child => chmodrKid(p, child, mode, then)) + }) +} + +const chmodrKidSync = (p, child, mode) => { + if (typeof child === 'string') { + const stats = fs.lstatSync(path.resolve(p, child)) + stats.name = child + child = stats + } + + if (child.isDirectory()) { + chmodrSync(path.resolve(p, child.name), mode) + fs.chmodSync(path.resolve(p, child.name), dirMode(mode)) + } else + fs[LCHMODSYNC](path.resolve(p, child.name), mode) +} + +const chmodrSync = (p, mode) => { + let children + try { + children = readdirSync(p, { withFileTypes: true }) + } catch (er) { + if (er && er.code === 'ENOTDIR') return fs[LCHMODSYNC](p, mode) + throw er + } + + if (children.length) + children.forEach(child => chmodrKidSync(p, child, mode)) + + return fs.chmodSync(p, dirMode(mode)) +} + +module.exports = chmodr +chmodr.sync = chmodrSync diff --git a/debian/tests/test_modules/chmodr/package.json b/debian/tests/test_modules/chmodr/package.json new file mode 100644 index 0000000..5efe3d3 --- /dev/null +++ b/debian/tests/test_modules/chmodr/package.json @@ -0,0 +1,26 @@ +{ + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "name": "chmodr", + "description": "like `chmod -R`", + "version": "1.2.0", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/chmodr.git" + }, + "main": "chmodr.js", + "devDependencies": { + "mkdirp": "0.3", + "rimraf": "", + "tap": "^12.0.1" + }, + "scripts": { + "test": "tap test/*.js --cov", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --all; git push origin --tags" + }, + "license": "ISC", + "files": [ + "chmodr.js" + ] +} diff --git a/debian/watch b/debian/watch new file mode 100644 index 0000000..b3ae3da --- /dev/null +++ b/debian/watch @@ -0,0 +1,23 @@ +version=4 +opts=\ +filenamemangle=s/.*?(\d[\d\.-]*@ARCHIVE_EXT@)/node-tar-$1/,\ +dversionmangle=auto,\ +repacksuffix=+ds1 \ +https://github.com/npm/node-tar/tags .*/archive/.*/v?([\d\.]+).tar.gz group + +opts=\ +ctype=nodejs,\ +component=fs-minipass,\ +dversionmangle=auto,\ +filenamemangle=s/.*?(\d[\d\.-]*@ARCHIVE_EXT@)/node-fs-minipass-$1/ \ + https://github.com/npm/fs-minipass/releases .*/archive/.*/v?([\d\.]+).tar.gz checksum + +# It is not recommended use npmregistry. Please investigate more. +# Take a look at https://wiki.debian.org/debian/watch/ +opts=\ +searchmode=plain,\ +component=types-tar,\ +ctype=nodejs,\ +pgpmode=none,\ +filenamemangle=s/.*?(\d[\d\.-]*@ARCHIVE_EXT@)/node-types-tar-$1/ \ + https://registry.npmjs.org/@types/tar https://registry.npmjs.org/@types/tar/-/tar-(4(?:.[\d\.]+)?)@ARCHIVE_EXT@ checksum