k2hash 2.0.4 → 2.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -182,6 +182,11 @@ check_and_download_asset_file()
182
182
  PRNINFO "Not found ${ASSET_TGZ_FILENAME} file."
183
183
  return 1
184
184
  fi
185
+ if ! tar tvfz "${SRCTOP}/${ASSET_TGZ_FILENAME}" >/dev/null 2>&1; then
186
+ PRNINFO "${ASSET_TGZ_FILENAME} file is not tar.gz format."
187
+ rm -f "${SRCTOP}/${ASSET_TGZ_FILENAME}" 2>/dev/null
188
+ return 1
189
+ fi
185
190
  if ! _RESULT_CODE=$("${CURLCMD}" -s -S -L -w '%{http_code}' -o "${SRCTOP}/${ASSET_SHA256_FILENAME}" -X GET "${ASSET_SHA256_DOWNLOAD_URL}" --insecure); then
186
191
  PRNINFO "Failed to get sha256 file(${ASSET_SHA256_FILENAME})."
187
192
  rm -f "${SRCTOP}/${ASSET_SHA256_FILENAME}" 2>/dev/null
@@ -203,10 +208,14 @@ check_and_download_asset_file()
203
208
  SHA256_VALUE=$(awk '{print $1}' "${SRCTOP}/${ASSET_SHA256_FILENAME}" 2>/dev/null | tr -d '\n')
204
209
  if ! DL_TGZ_SHA256_VALUE=$(sha256sum "${SRCTOP}/${ASSET_TGZ_FILENAME}" 2>/dev/null | awk '{print $1}' 2>/dev/null | tr -d '\n'); then
205
210
  PRNINFO "Failed to make sha256 value from download tgz file."
211
+ rm -f "${SRCTOP}/${ASSET_TGZ_FILENAME}" 2>/dev/null
212
+ rm -f "${SRCTOP}/${ASSET_SHA256_FILENAME}" 2>/dev/null
206
213
  return 1
207
214
  fi
208
215
  if [ -z "${SHA256_VALUE}" ] || [ -z "${DL_TGZ_SHA256_VALUE}" ] || [ "${SHA256_VALUE}" != "${DL_TGZ_SHA256_VALUE}" ]; then
209
216
  PRNINFO "The sha256 value of the downloaded tgz file is incorrect."
217
+ rm -f "${SRCTOP}/${ASSET_TGZ_FILENAME}" 2>/dev/null
218
+ rm -f "${SRCTOP}/${ASSET_SHA256_FILENAME}" 2>/dev/null
210
219
  return 1
211
220
  fi
212
221
 
@@ -217,6 +226,8 @@ check_and_download_asset_file()
217
226
  cd "${SRCTOP}" || exit 1
218
227
  if ! tar xvfz "${SRCTOP}/${ASSET_TGZ_FILENAME}" >/dev/null 2>&1; then
219
228
  PRNINFO "Could not extract files from ${ASSET_TGZ_FILENAME} file."
229
+ rm -f "${SRCTOP}/${ASSET_TGZ_FILENAME}" 2>/dev/null
230
+ rm -f "${SRCTOP}/${ASSET_SHA256_FILENAME}" 2>/dev/null
220
231
  cd "${_CUR_DIR}" || exit 1
221
232
  return 1
222
233
  fi
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "k2hash",
3
- "version": "2.0.4",
3
+ "version": "2.0.5",
4
4
  "description": "K2HASH addon library for Node.js",
5
5
  "os": "linux",
6
6
  "main": "index.js",
@@ -48,7 +48,7 @@
48
48
  },
49
49
  "scripts": {
50
50
  "help": "echo 'command list:\n npm run install\n npm run install:onlypackages\n npm run build\n npm run build:ts\n npm run build:ts:cjs\n npm run build:ts:esm\n npm run build:ts:tests:cjs\n npm run build:types\n npm run build:checktypes\n npm run build:configure\n npm run build:rebuild\n npm run build:prebuild\n npm run build:prebuild:pure\n npm run build:bundle:esm\n npm run prepublishOnly\n npm run lint\n npm run test\n npm run test:ci\n npm run test:all\n npm run test:smoke\n npm run test:smoke:cjs\n npm run test:smoke:esm\n npm run test:smoke:ts\n npm run test:k2hash\n npm run test:k2hqueue\n npm run test:k2hkeyqueue\n'",
51
- "install": "export NPM_CONFIG_LOGLEVEL=silent && echo '[START] Install' && ./buildutils/node_prebuild_install.sh || (echo '[INFO] No binaries found, so building from source\n' && if [ -d build/cjs ] && [ -d build/esm ]; then npm run build:rebuild; else npm run build; fi) && echo '-> [DONE] Install\n'",
51
+ "install": "export NPM_CONFIG_LOGLEVEL=silent && echo '[START] Install' && ./buildutils/node_prebuild_install.sh || (echo '[INFO] No binaries found, so building from source\n' && if [ -d build/cjs ] && [ -d build/esm ]; then mv build/cjs ./cjs.backup; mv build/esm ./esm.backup; npm run build:rebuild; rm -rf build/cjs.backup build/esm; mv ./cjs.backup build/cjs; mv ./esm.backup build/esm; else npm run build; fi) && echo '-> [DONE] Install\n'",
52
52
  "install:onlypackages": "export NPM_CONFIG_LOGLEVEL=silent && echo '[START] Install:onlypackages' && npm install --ignore-scripts && echo '-> [DONE] Install:onlypackages\n'",
53
53
  "build": "export NPM_CONFIG_LOGLEVEL=silent && echo '[START] Build' && npm run build:checktypes && npm run build:configure && npm run build:rebuild && npm run build:ts && echo '-> [DONE] Build\n'",
54
54
  "build:ts": "export NPM_CONFIG_LOGLEVEL=silent && echo '[START] Build:ts' && npm run build:ts:cjs && npm run build:ts:esm && echo '-> [DONE] Build:ts\n'",