[Pkg-javascript-commits] [node-yauzl] 04/08: use debian package for fd-slicer instead of patch
Andrew Kelley
andrewrk-guest at moszumanska.debian.org
Fri Oct 17 06:01:01 UTC 2014
This is an automated email from the git hooks/post-receive script.
andrewrk-guest pushed a commit to branch master
in repository node-yauzl.
commit 6704a28a7f173e159bed1aeb9299ad21f6474a5a
Author: Andrew Kelley <superjoe30 at gmail.com>
Date: Fri Oct 17 05:57:56 2014 +0000
use debian package for fd-slicer instead of patch
---
debian/control | 4 +-
debian/patches/bundle-fd-slicer.patch | 233 ----------------------------------
debian/patches/series | 1 -
3 files changed, 2 insertions(+), 236 deletions(-)
diff --git a/debian/control b/debian/control
index 3cd6428..d66602c 100644
--- a/debian/control
+++ b/debian/control
@@ -7,8 +7,8 @@ Build-Depends:
debhelper (>= 8)
, dh-buildinfo
, nodejs
- , node-iconv
, node-pend
+ , node-fd-slicer
Standards-Version: 3.9.5
Homepage: https://github.com/thejoshwolfe/yauzl
Vcs-Git: git://anonscm.debian.org/pkg-javascript/node-yauzl.git
@@ -20,8 +20,8 @@ Architecture: all
Depends:
${misc:Depends}
, nodejs
- , node-iconv (>= 2.1.4)
, node-pend (>= 1.1.3)
+ , node-fd-slicer
Description: yet another unzip library - Node.js module
yauzl is a Node.js module which provides the ability to read from zip files.
It follows the spec by reading the central directory for file metadata instead
diff --git a/debian/patches/bundle-fd-slicer.patch b/debian/patches/bundle-fd-slicer.patch
deleted file mode 100644
index 19f6036..0000000
--- a/debian/patches/bundle-fd-slicer.patch
+++ /dev/null
@@ -1,233 +0,0 @@
-Description: bundle fd-slicer module
- fd-slicer is too small for the FTP masters to accept, so we bundle it in a
- patch.
-Author: Andrew Kelley <superjoe30 at gmail.com>
-Forwarded: not-needed
-
---- /dev/null
-+++ node-yauzl-2.0.0/node_modules/fd-slicer/index.js
-@@ -0,0 +1,166 @@
-+var fs = require('fs');
-+var util = require('util');
-+var stream = require('stream');
-+var Readable = stream.Readable;
-+var Writable = stream.Writable;
-+var Pend = require('pend');
-+var EventEmitter = require('events').EventEmitter;
-+
-+module.exports = FdSlicer;
-+
-+util.inherits(FdSlicer, EventEmitter);
-+function FdSlicer(fd, options) {
-+ options = options || {};
-+ EventEmitter.call(this);
-+
-+ this.fd = fd;
-+ this.pend = new Pend();
-+ this.pend.max = 1;
-+ this.refCount = 0;
-+ this.autoClose = !!options.autoClose;
-+}
-+
-+FdSlicer.prototype.read = function(buffer, offset, length, position, callback) {
-+ var self = this;
-+ self.pend.go(function(cb) {
-+ fs.read(self.fd, buffer, offset, length, position, function(err, bytesRead, buffer) {
-+ cb();
-+ callback(err, bytesRead, buffer);
-+ });
-+ });
-+};
-+
-+FdSlicer.prototype.write = function(buffer, offset, length, position, callback) {
-+ var self = this;
-+ self.pend.go(function(cb) {
-+ fs.write(self.fd, buffer, offset, length, position, function(err, written, buffer) {
-+ cb();
-+ callback(err, written, buffer);
-+ });
-+ });
-+};
-+
-+FdSlicer.prototype.createReadStream = function(options) {
-+ return new ReadStream(this, options);
-+};
-+
-+FdSlicer.prototype.createWriteStream = function(options) {
-+ return new WriteStream(this, options);
-+};
-+
-+FdSlicer.prototype.ref = function() {
-+ this.refCount += 1;
-+};
-+
-+FdSlicer.prototype.unref = function() {
-+ var self = this;
-+ self.refCount -= 1;
-+
-+ if (self.refCount > 0) return;
-+ if (self.refCount < 0) throw new Error("invalid unref");
-+
-+ if (self.autoClose) {
-+ fs.close(self.fd, onCloseDone);
-+ }
-+
-+ function onCloseDone(err) {
-+ if (err) {
-+ self.emit('error', err);
-+ } else {
-+ self.emit('close');
-+ }
-+ }
-+};
-+
-+util.inherits(ReadStream, Readable);
-+function ReadStream(context, options) {
-+ options = options || {};
-+ Readable.call(this, options);
-+
-+ this.context = context;
-+ this.context.ref();
-+
-+ this.start = options.start || 0;
-+ this.end = options.end;
-+ this.pos = this.start;
-+ this.destroyed = false;
-+}
-+
-+ReadStream.prototype._read = function(n) {
-+ var self = this;
-+ if (self.destroyed) return;
-+
-+ var toRead = Math.min(self._readableState.highWaterMark, n);
-+ if (self.end != null) {
-+ toRead = Math.min(toRead, self.end - self.pos);
-+ }
-+ if (toRead <= 0) {
-+ self.push(null);
-+ self.context.unref();
-+ return;
-+ }
-+ self.context.pend.go(function(cb) {
-+ if (self.destroyed) return cb();
-+ var buffer = new Buffer(toRead);
-+ fs.read(self.context.fd, buffer, 0, toRead, self.pos, function(err, bytesRead) {
-+ if (err) {
-+ self.destroy();
-+ self.emit('error', err);
-+ } else if (bytesRead === 0) {
-+ self.push(null);
-+ self.context.unref();
-+ } else {
-+ self.pos += bytesRead;
-+ self.push(buffer.slice(0, bytesRead));
-+ }
-+ cb();
-+ });
-+ });
-+};
-+
-+ReadStream.prototype.destroy = function() {
-+ this.destroyed = true;
-+};
-+
-+util.inherits(WriteStream, Writable);
-+function WriteStream(context, options) {
-+ options = options || {};
-+ Writable.call(this, options);
-+
-+ this.context = context;
-+ this.context.ref();
-+
-+ this.start = options.start || 0;
-+ this.bytesWritten = 0;
-+ this.pos = this.start;
-+ this.destroyed = false;
-+
-+ this.on('finish', function() {
-+ context.unref();
-+ });
-+}
-+
-+WriteStream.prototype._write = function(buffer, encoding, callback) {
-+ var self = this;
-+ if (self.destroyed) return;
-+
-+ self.context.pend.go(function(cb) {
-+ if (self.destroyed) return cb();
-+ fs.write(self.context.fd, buffer, 0, buffer.length, self.pos, function(err, bytes) {
-+ if (err) {
-+ self.destroy();
-+ cb();
-+ callback(err);
-+ } else {
-+ self.bytesWritten += bytes;
-+ self.pos += bytes;
-+ cb();
-+ callback();
-+ }
-+ });
-+ });
-+};
-+
-+WriteStream.prototype.destroy = function() {
-+ this.destroyed = true;
-+};
---- /dev/null
-+++ node-yauzl-2.0.0/node_modules/fd-slicer/package.json
-@@ -0,0 +1,55 @@
-+{
-+ "name": "fd-slicer",
-+ "version": "0.2.1",
-+ "description": "safely create multiple ReadStream or WriteStream objects from the same file descriptor",
-+ "main": "index.js",
-+ "scripts": {
-+ "test": "mocha --reporter spec"
-+ },
-+ "author": {
-+ "name": "Andrew Kelley",
-+ "email": "superjoe30 at gmail.com"
-+ },
-+ "license": "MIT",
-+ "devDependencies": {
-+ "mocha": "~1.21.3",
-+ "stream-equal": "~0.1.5"
-+ },
-+ "dependencies": {
-+ "pend": "~1.1.3"
-+ },
-+ "directories": {
-+ "test": "test"
-+ },
-+ "repository": {
-+ "type": "git",
-+ "url": "git://github.com/andrewrk/node-fd-slicer.git"
-+ },
-+ "bugs": {
-+ "url": "https://github.com/andrewrk/node-fd-slicer/issues"
-+ },
-+ "_id": "fd-slicer at 0.2.1",
-+ "dist": {
-+ "shasum": "4824cbd31ee247e3a2e41f76808196f2d3322018",
-+ "tarball": "http://registry.npmjs.org/fd-slicer/-/fd-slicer-0.2.1.tgz"
-+ },
-+ "_from": "fd-slicer@~0.2.1",
-+ "_npmVersion": "1.3.10",
-+ "_npmUser": {
-+ "name": "superjoe",
-+ "email": "superjoe30 at gmail.com"
-+ },
-+ "maintainers": [
-+ {
-+ "name": "superjoe",
-+ "email": "superjoe30 at gmail.com"
-+ },
-+ {
-+ "name": "thejoshwolfe",
-+ "email": "thejoshwolfe at gmail.com"
-+ }
-+ ],
-+ "_shasum": "4824cbd31ee247e3a2e41f76808196f2d3322018",
-+ "_resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-0.2.1.tgz",
-+ "readme": "ERROR: No README data found!"
-+}
diff --git a/debian/patches/series b/debian/patches/series
deleted file mode 100644
index e6206e1..0000000
--- a/debian/patches/series
+++ /dev/null
@@ -1 +0,0 @@
-bundle-fd-slicer.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-yauzl.git
More information about the Pkg-javascript-commits
mailing list