Skip to content

Commit b684f2a

Browse files
committed
Add header comments. Use PORT. Assume SHAs and binaries co-exist
1 parent acb9fdc commit b684f2a

File tree

4 files changed

+45
-9
lines changed

4 files changed

+45
-9
lines changed

package/README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,18 @@ Installation is described in [INSTALL](../INSTALL.md).
4444
[npm](https://www.npmjs.com/package/oracledb).
4545

4646
- `make npmpackage` makes the main node-oracledb package
47-
containing the JavaScript files.
47+
containing the general node-oracledb JavaScript files and the
48+
package.json in this directory. This is the package that an
49+
`npm install oracledb` will initially install.
4850

4951
- `make binarypackage` makes a binary package for the current
50-
Node.js/node-oracledb/platform and generates a SHA256 for the
51-
binary.
52+
Node.js-node / oracledb / platform combination and generates a
53+
SHA256 for the binary.
5254

53-
- The `package.json` in this directory invokes an install script that
54-
downloads a binary package from GitHub. This variant of
55-
`package.json` is the copy bundled for the npm release..
55+
- As part of `npm install`, the `package.json` in this directory
56+
invokes `oracledbinstall.js` that downloads the appropriate binary
57+
package from GitHub. This variant of `package.json` is the copy
58+
bundled for the npm release.
5659

5760
The parent file `../package.json` doesn't have the install target
5861
meaning that node-gyp will be invoked to compile node-oracledb. This

package/createpackage.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@
1515
* See the License for the specific language governing permissions and
1616
* limitations under the License.
1717
*
18+
* NAME
19+
* createpackage.js
20+
*
21+
* DESCRIPTION
22+
* Creates a binary package for the current node-oracledb binary. A
23+
* custom package format is used. The package uses a custom format
24+
* with three components: length bytes (giving the length of the
25+
* license file), the license file, and then the node-oracledb
26+
* binary. The package is gzipped.
27+
*
1828
*****************************************************************************/
1929

2030
'use strict';

package/extractpackage.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,21 @@
1515
* See the License for the specific language governing permissions and
1616
* limitations under the License.
1717
*
18+
* NAME
19+
* extractpackage.js
20+
*
21+
* DESCRIPTION
22+
* This script is a command-line interface to extract node-oracledb
23+
* binaries from an available binary package, see INSTALL.md.
24+
*
25+
* USAGE
26+
* Run this script like:
27+
* node extractpackage.js path=oracledb-vX.Y.Z-node-vNN-platform-architecture.gz
28+
* For example:
29+
* node extractpackage.js path=oracledb-v2.0.14-node-v57-darwin-x64.gz
30+
*
31+
* The extracted binary can be manually moved to the correct directory.
32+
*
1833
*****************************************************************************/
1934

2035
'use strict';

package/oracledbinstall.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@
1515
* See the License for the specific language governing permissions and
1616
* limitations under the License.
1717
*
18+
* NAME
19+
* oracledbinstall.js
20+
*
21+
* DESCRIPTION
22+
* This script is included in the npm bundle of node-oracledb. It
23+
* is invoked by package.json during npm install. It downloads a
24+
* pre-built node-oracleb binary if one is available, or gives a
25+
* message on how to compile from source code.
26+
*
1827
*****************************************************************************/
1928

2029
'use strict';
@@ -52,7 +61,6 @@ try {
5261

5362
const PACKAGE_HOSTNAME = 'github.com';
5463
const PACKAGE_PATH_REMOTE = '/oracle/node-oracledb/releases/download/' + packageUtil.dynamicProps.GITHUB_TAG + '/' + packageUtil.dynamicProps.PACKAGE_FILE_NAME;
55-
const SHA_HOSTNAME = PACKAGE_HOSTNAME;
5664
const SHA_PATH_REMOTE = '/oracle/node-oracledb/releases/download/' + packageUtil.dynamicProps.GITHUB_TAG + '/' + packageUtil.SHA_FILE_NAME;
5765
const PORT = 443;
5866

@@ -130,7 +138,7 @@ function verifyBinary() {
130138
.then((sha) => {
131139
binarySha = sha;
132140

133-
return getRemoteFileReadStream(SHA_HOSTNAME, SHA_PATH_REMOTE);
141+
return getRemoteFileReadStream(PACKAGE_HOSTNAME, SHA_PATH_REMOTE);
134142
})
135143
.then(readStream => {
136144
return new Promise((resolve, reject) => {
@@ -191,7 +199,7 @@ function getFileReadStreamByProxy(hostname, path, proxyHostname, proxyPort) {
191199
host: proxyHostname,
192200
port: proxyPort,
193201
method: 'CONNECT',
194-
path: hostname + ':443'
202+
path: hostname + ':' + PORT
195203
});
196204

197205
req.on('error', reject);

0 commit comments

Comments
 (0)