[Pkg-javascript-commits] [node-yazl] 02/05: Imported Upstream version 2.0.2

Andrew Kelley andrewrk-guest at moszumanska.debian.org
Fri Oct 17 05:53:21 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-yazl.

commit 00456a617df26b97ea58def96d2c720db23eaeb4
Author: Andrew Kelley <superjoe30 at gmail.com>
Date:   Fri Oct 17 05:48:59 2014 +0000

    Imported Upstream version 2.0.2
---
 README.md    |  2 ++
 index.js     | 11 ++++++-----
 package.json |  2 +-
 3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/README.md b/README.md
index 3171c41..a10f0d5 100644
--- a/README.md
+++ b/README.md
@@ -194,6 +194,8 @@ File Descriptors are given after each file data with this information, as per th
 But remember a complete metadata listing is still always available in the central directory record,
 so if unzip implementations are relying on that, like they should,
 none of this paragraph will matter anyway.
+Even so, Mac's Archive Utility requires File Descriptors to include the optional signature,
+so yazl includes the optional file descriptor signature.
 
 All other bits are unset.
 
diff --git a/index.js b/index.js
index 26e8987..3f4b218 100644
--- a/index.js
+++ b/index.js
@@ -271,14 +271,15 @@ Entry.prototype.getLocalFileHeader = function() {
     /* no extra fields */                                       // extra field (variable size)
   ]);
 };
-var FILE_DESCRIPTOR_SIZE = 12
+var FILE_DESCRIPTOR_SIZE = 16
 Entry.prototype.getFileDescriptor = function() {
   var buffer = new Buffer(FILE_DESCRIPTOR_SIZE);
-  buffer.writeUInt32LE(this.crc32, 0);            // crc-32                          4 bytes
-  buffer.writeUInt32LE(this.compressedSize, 4);   // compressed size                 4 bytes
-  buffer.writeUInt32LE(this.uncompressedSize, 8); // uncompressed size               4 bytes
+  buffer.writeUInt32LE(0x08074b50, 0);             // optional signature (required according to Archive Utility)
+  buffer.writeUInt32LE(this.crc32, 4);             // crc-32                          4 bytes
+  buffer.writeUInt32LE(this.compressedSize, 8);    // compressed size                 4 bytes
+  buffer.writeUInt32LE(this.uncompressedSize, 12); // uncompressed size               4 bytes
   return buffer;
-}
+};
 var CENTRAL_DIRECTORY_RECORD_FIXED_SIZE = 46;
 Entry.prototype.getCentralDirectoryRecord = function() {
   var fixedSizeStuff = new Buffer(CENTRAL_DIRECTORY_RECORD_FIXED_SIZE);
diff --git a/package.json b/package.json
index fba070a..4f9d55f 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "yazl",
-  "version": "2.0.1",
+  "version": "2.0.2",
   "description": "yet another zip library for node",
   "main": "index.js",
   "scripts": {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-yazl.git



More information about the Pkg-javascript-commits mailing list