From a09468804271b1d66e8745cb08367636b2d89ec1 Mon Sep 17 00:00:00 2001 From: Alexis Svinartchouk Date: Mon, 26 Mar 2018 16:56:56 +0100 Subject: [PATCH 1/3] Update e2fsprogs to v1.44.1 Connects-To: #14 Change-Type: patch --- deps/e2fsprogs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/e2fsprogs b/deps/e2fsprogs index 05dacf9..7489246 160000 --- a/deps/e2fsprogs +++ b/deps/e2fsprogs @@ -1 +1 @@ -Subproject commit 05dacf97376d0f611544e81cf993161b911ae8e7 +Subproject commit 748924621fdd0e70a191091915fc9724d42e4796 From adc2578e5f99f2d0a2b0bfb0745464eae045c615 Mon Sep 17 00:00:00 2001 From: Alexis Svinartchouk Date: Mon, 26 Mar 2018 17:02:41 +0100 Subject: [PATCH 2/3] Update file-disk to ^4.1.1 Connects-To: #14 Change-Type: major --- lib/disk.js | 31 +++++++++++++++++++++++-------- package.json | 4 ++-- test/index.js | 2 +- 3 files changed, 26 insertions(+), 11 deletions(-) diff --git a/lib/disk.js b/lib/disk.js index 2cb1612..bbb066f 100644 --- a/lib/disk.js +++ b/lib/disk.js @@ -1,12 +1,19 @@ 'use strict'; -const filedisk = require('file-disk'); - const constants = require('./constants'); -class DiskWrapper extends filedisk.DiskWrapper { +const promiseToCallback = (promise, callback, transform) => { + promise + .then((result) => { + const args = (transform === undefined) ? [] : transform(result); + callback(null, ...args); + }) + .catch(callback); +}; + +class DiskWrapper { constructor(disk, offset=0) { - super(disk); + this.disk = disk; this.offset = offset; } @@ -14,16 +21,24 @@ class DiskWrapper extends filedisk.DiskWrapper { offset += this.offset; switch(type) { case constants.E2FS_BLK_READ: - this.disk.read(buffer, 0, buffer.length, offset, callback); + promiseToCallback( + this.disk.read(buffer, 0, buffer.length, offset), + callback, + ({ bytesRead, buffer }) => [ bytesRead, buffer ] + ); break; case constants.E2FS_BLK_WRITE: - this.disk.write(buffer, 0, buffer.length, offset, callback); + promiseToCallback( + this.disk.write(buffer, 0, buffer.length, offset), + callback, + ({ bytesWritten, buffer }) => [ bytesWritten, buffer ] + ); break; case constants.E2FS_BLK_FLUSH: - this.disk.flush(callback); + promiseToCallback(this.disk.flush(), callback); break; case constants.E2FS_BLK_DISCARD: - this.disk.discard(offset, length, callback); + promiseToCallback(this.disk.discard(offset, length), callback); break; default: callback(new Error('Unknown request type: ' + type)); diff --git a/package.json b/package.json index 84a8c0b..6619882 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "async": "^2.4.1", "bindings": "^1.2.1", "eslint": "^3.19.0", - "file-disk": "^1.0.0", + "file-disk": "^4.1.1", "nan": "^2.5.1", "node-pre-gyp": "^0.6.39" }, @@ -60,4 +60,4 @@ "bugs": { "url": "https://github.com/resin-io/node-ext2fs/issues" } -} \ No newline at end of file +} diff --git a/test/index.js b/test/index.js index 90e48b1..9ffae9f 100644 --- a/test/index.js +++ b/test/index.js @@ -879,7 +879,7 @@ describe('ext2fs', function() { return fs.trimAsync(); }) .then(function() { - return disk.getBlockMapAsync(blockSize); + return disk.getBlockMap(blockSize, true); // true is for calculateChecksums }) .then(function(bmap) { assert.strictEqual(bmap.imageSize, 4194304); From 072d8411c19ddea9484f2c1a1a49acfdf7f8bba4 Mon Sep 17 00:00:00 2001 From: "resin-io-versionbot[bot]" Date: Tue, 27 Mar 2018 18:43:16 +0000 Subject: [PATCH 3/3] v1.0.0 --- CHANGELOG.md | 5 +++++ package.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f56da8..0ac1ac9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file automatically by Versionist. DO NOT EDIT THIS FILE MANUALLY! This project adheres to [Semantic Versioning](http://semver.org/). +## v1.0.0 - 2018-03-27 + +* Update file-disk to ^4.1.1 #15 [Alexis Svinartchouk] +* Update e2fsprogs to v1.44.1 #15 [Alexis Svinartchouk] + ## v0.1.1 - 2017-11-21 * Ensure pre-gyp releases use the existing versionbot tag (not a new one) #13 [Tim Perry] diff --git a/package.json b/package.json index 6619882..364b46d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ext2fs", - "version": "0.1.1", + "version": "1.0.0", "description": "NodeJS native bindings to the libext2fs for cross-platform ext filesystem handling", "author": "Petros Angelatos ", "contributors": [