Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 29492e2

Browse filesBrowse files
richardlautargos
authored andcommitted
tools: fix version parsing in brotli update script
Update `tools/dep_updaters/update-brotli.sh` to parse the current version of brotli from the newer macros `BROTLI_VERSION_MAJOR`, `BROTLI_VERSION_MINOR` and `BROTLI_VERSION_PATCH`. PR-URL: #51373 Refs: #50804 Refs: nodejs/security-wg#1181 Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
1 parent d7658ca commit 29492e2
Copy full SHA for 29492e2

File tree

Expand file treeCollapse file tree

1 file changed

+4
-6
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-6
lines changed
Open diff view settings
Collapse file

‎tools/dep_updaters/update-brotli.sh‎

Copy file name to clipboardExpand all lines: tools/dep_updaters/update-brotli.sh
+4-6Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,10 @@ console.log(tag_name.replace('v', ''));
2424
EOF
2525
)"
2626

27-
VERSION_HEX=$(grep "#define BROTLI_VERSION" ./deps/brotli/c/common/version.h | sed 's/.* //')
28-
29-
major=$(( ($VERSION_HEX >> 24) & 0xff ))
30-
minor=$(( ($VERSION_HEX >> 12) & 0xfff ))
31-
patch=$(( $VERSION_HEX & 0xfff ))
32-
CURRENT_VERSION="${major}.${minor}.${patch}"
27+
CURRENT_MAJOR_VERSION=$(grep "#define BROTLI_VERSION_MAJOR" ./deps/brotli/c/common/version.h | sed -n "s/^.*MAJOR \(.*\)/\1/p")
28+
CURRENT_MINOR_VERSION=$(grep "#define BROTLI_VERSION_MINOR" ./deps/brotli/c/common/version.h | sed -n "s/^.*MINOR \(.*\)/\1/p")
29+
CURRENT_PATCH_VERSION=$(grep "#define BROTLI_VERSION_PATCH" ./deps/brotli/c/common/version.h | sed -n "s/^.*PATCH \(.*\)/\1/p")
30+
CURRENT_VERSION="$CURRENT_MAJOR_VERSION.$CURRENT_MINOR_VERSION.$CURRENT_PATCH_VERSION"
3331

3432
# This function exit with 0 if new version and current version are the same
3533
compare_dependency_version "brotli" "$NEW_VERSION" "$CURRENT_VERSION"

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.