From 2fac0415088c08c71beaa0070573d415ada1ff7e Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Mon, 29 May 2023 12:59:52 +0200 Subject: [PATCH] tools: harmonize `dep_updaters` scripts PR-URL: https://github.com/nodejs/node/pull/48201 Reviewed-By: Marco Ippolito Reviewed-By: Luigi Pinca Reviewed-By: Mestery Reviewed-By: Rafael Gonzaga --- tools/dep_updaters/update-acorn.sh | 21 ++++++++------- tools/dep_updaters/update-base64.sh | 16 ++++++------ tools/dep_updaters/update-cjs-module-lexer.sh | 16 ++++++------ tools/dep_updaters/update-undici.sh | 26 +++++++++++++------ 4 files changed, 45 insertions(+), 34 deletions(-) diff --git a/tools/dep_updaters/update-acorn.sh b/tools/dep_updaters/update-acorn.sh index 4f6bf6b0dd7a43..21b2e018c0221d 100755 --- a/tools/dep_updaters/update-acorn.sh +++ b/tools/dep_updaters/update-acorn.sh @@ -34,17 +34,18 @@ rm -rf deps/acorn/acorn "$NODE" "$NPM" init --yes "$NODE" "$NPM" install --global-style --no-bin-links --ignore-scripts "acorn@$NEW_VERSION" - cd node_modules/acorn - # update this version information in src/acorn_version.h - FILE_PATH="$ROOT/src/acorn_version.h" - echo "// This is an auto generated file, please do not edit." > "$FILE_PATH" - echo "// Refer to tools/update-acorn.sh" >> "$FILE_PATH" - echo "#ifndef SRC_ACORN_VERSION_H_" >> "$FILE_PATH" - echo "#define SRC_ACORN_VERSION_H_" >> "$FILE_PATH" - echo "#define ACORN_VERSION \"$NEW_VERSION\"" >> "$FILE_PATH" - echo "#endif // SRC_ACORN_VERSION_H_" >> "$FILE_PATH" ) +# update version information in src/acorn_version.h +cat > "$ROOT/src/acorn_version.h" <> "$DEPS_DIR/base64/base64/lib/config.h" -echo "All done!" -echo "" -echo "Please git add base64/base64, commit the new version:" -echo "" -echo "$ git add -A deps/base64/base64" -echo "$ git commit -m \"deps: update base64 to $NEW_VERSION\"" -echo "" - # update the base64_version.h cat > "$BASE_DIR/src/base64_version.h" << EOL // This is an auto generated file, please do not edit. @@ -82,6 +74,14 @@ cat > "$BASE_DIR/src/base64_version.h" << EOL #endif // SRC_BASE64_VERSION_H_ EOL +echo "All done!" +echo "" +echo "Please git add base64/base64, commit the new version:" +echo "" +echo "$ git add -A deps/base64/base64 src/base64_version.h" +echo "$ git commit -m \"deps: update base64 to $NEW_VERSION\"" +echo "" + # The last line of the script should always print the new version, # as we need to add it to $GITHUB_ENV variable. echo "NEW_VERSION=$NEW_VERSION" diff --git a/tools/dep_updaters/update-cjs-module-lexer.sh b/tools/dep_updaters/update-cjs-module-lexer.sh index 94adeea05e1a16..c3a5cd367063ce 100755 --- a/tools/dep_updaters/update-cjs-module-lexer.sh +++ b/tools/dep_updaters/update-cjs-module-lexer.sh @@ -55,14 +55,6 @@ rm -rf "$DEPS_DIR/cjs-module-lexer" mv node_modules/cjs-module-lexer "$DEPS_DIR/cjs-module-lexer" -echo "All done!" -echo "" -echo "Please git add cjs-module-lexer, commit the new version:" -echo "" -echo "$ git add -A deps/cjs-module-lexer" -echo "$ git commit -m \"deps: update cjs-module-lexer to $NEW_VERSION\"" -echo "" - # update cjs_module_lexer_version.h cat > "$BASE_DIR/src/cjs_module_lexer_version.h" << EOL // This is an auto generated file, please do not edit. @@ -73,6 +65,14 @@ cat > "$BASE_DIR/src/cjs_module_lexer_version.h" << EOL #endif // SRC_CJS_MODULE_LEXER_VERSION_H_ EOL +echo "All done!" +echo "" +echo "Please git add cjs-module-lexer, commit the new version:" +echo "" +echo "$ git add -A deps/cjs-module-lexer src/cjs_module_lexer_version.h" +echo "$ git commit -m \"deps: update cjs-module-lexer to $NEW_VERSION\"" +echo "" + # The last line of the script should always print the new version, # as we need to add it to $GITHUB_ENV variable. echo "NEW_VERSION=$NEW_VERSION" diff --git a/tools/dep_updaters/update-undici.sh b/tools/dep_updaters/update-undici.sh index f9d40fd3fa1e9e..7879e373267bd8 100755 --- a/tools/dep_updaters/update-undici.sh +++ b/tools/dep_updaters/update-undici.sh @@ -36,22 +36,32 @@ rm -f deps/undici/undici.js "$NODE" "$NPM" install --global-style --no-bin-links --ignore-scripts "undici@$NEW_VERSION" cd node_modules/undici "$NODE" "$NPM" run build:node - # update this version information in src/undici_version.h - FILE_PATH="$ROOT/src/undici_version.h" - echo "// This is an auto generated file, please do not edit." > "$FILE_PATH" - echo "// Refer to tools/update-undici.sh" >> "$FILE_PATH" - echo "#ifndef SRC_UNDICI_VERSION_H_" >> "$FILE_PATH" - echo "#define SRC_UNDICI_VERSION_H_" >> "$FILE_PATH" - echo "#define UNDICI_VERSION \"$NEW_VERSION\"" >> "$FILE_PATH" - echo "#endif // SRC_UNDICI_VERSION_H_" >> "$FILE_PATH" ) +# update version information in src/undici_version.h +cat > "$ROOT/src/undici_version.h" <