Skip to content

Commit

Permalink
tools: fix lint + single indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
fasenderos committed May 25, 2023
1 parent 1596c43 commit af728dd
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 39 deletions.
6 changes: 3 additions & 3 deletions doc/contributing/maintaining/maintaining-dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ This a list of all the dependencies:
* [simdutf 3.2.9][]
* [undici 5.22.1][]
* [uvwasi 0.0.16][]
* [V8 11.3.244.8][]
* [v8 11.3.244.8][]
* [zlib 1.2.13][]

Any code which meets one or more of these conditions should
Expand Down Expand Up @@ -305,7 +305,7 @@ implement WASI calls.
Under the hood, uvwasi leverages libuv where possible for maximum portability.
See [maintaining-web-assembly][] for more informations.

### V8 11.3.244.8
### v8 11.3.244.8

[V8](https://chromium.googlesource.com/v8/v8.git/) is Google's open source
high-performance JavaScript and WebAssembly engine, written in C++.
Expand Down Expand Up @@ -348,5 +348,5 @@ performance improvements not currently available in standard zlib.
[undici 5.22.1]: #undici-5221
[update-openssl-action]: ../../../.github/workflows/update-openssl.yml
[uvwasi 0.0.16]: #uvwasi-0016
[V8 11.3.244.8]: #V8-1132448
[v8 11.3.244.8]: #v8-1132448
[zlib 1.2.13]: #zlib-1213
2 changes: 1 addition & 1 deletion tools/dep_updaters/update-v8-patch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ NEW_VERSION="$CURRENT_MAJOR_VERSION.$CURRENT_MINOR_VERSION.$CURRENT_BUILD_VERSIO


# Update the version number
update_dependency_version "V8" "$NEW_VERSION"
update_dependency_version "v8" "$NEW_VERSION"

echo "All done!"
echo ""
Expand Down
72 changes: 37 additions & 35 deletions tools/dep_updaters/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,47 @@

ROOT=$(cd "$(dirname "$0")/../.." && pwd)

# This function compare new version with current version of a depdendency and exit
# the script if the versions are the same
# This function compare new version with current version of a depdendency and
# exit the script if the versions are the same
#
# $1 is the package name e.g. 'acorn', 'ada', 'base64' etc. See that file
# for a complete list of package name
# $1 is the package name e.g. 'acorn', 'ada', 'base64' etc. See the file
# doc/contributing/maintaining/maintaining-dependencies.md for a complete list
# of package name
# $2 is the new version.
compare_dependency_version() {
package_name="$1"
new_version="$2"
current_version="$3"
echo "Comparing $new_version with $current_version"
if [ "$new_version" = "$current_version" ]; then
echo "Skipped because $package_name is on the latest version."
exit 0
fi
package_name="$1"
new_version="$2"
current_version="$3"
echo "Comparing $new_version with $current_version"
if [ "$new_version" = "$current_version" ]; then
echo "Skipped because $package_name is on the latest version."
exit 0
fi
}

# This function inform to commit the new version of a maintained dependency
# and print the last line of the script "NEW_VERSION=$NEW_VERSION" as we need
# to add it to $GITHUB_ENV variable.
#
# $1 is the package name e.g. 'acorn', 'ada', 'base64' etc. See that file
# for a complete list of package name
# $1 is the package name e.g. 'acorn', 'ada', 'base64' etc. See the file
# doc/contributing/maintaining/maintaining-dependencies.md for a complete list
# of package name
# $2 is the new version.
finalize_version_update() {
package_name="$1"
new_version="$2"
echo "All done!"
echo ""
echo "Please git add $package_name, commit the new version:"
echo ""
echo "$ git add -A deps/$package_name"
echo "$ git add doc/contributing/maintaining/maintaining-dependencies.md"
echo "$ git commit -m \"deps: update $package_name to $new_version\""
echo ""
package_name="$1"
new_version="$2"
echo "All done!"
echo ""
echo "Please git add $package_name, commit the new version:"
echo ""
echo "$ git add -A deps/$package_name"
echo "$ git add doc/contributing/maintaining/maintaining-dependencies.md"
echo "$ git commit -m \"deps: update $package_name 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"
# 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"
}

# This function update the version of a maintained dependency in
Expand All @@ -50,12 +52,12 @@ finalize_version_update() {
# for a complete list of package name
# $2 is the new version.
update_dependency_version() {
package_name="$1"
new_version="$2"
deps_file_path="$ROOT/doc/contributing/maintaining/maintaining-dependencies.md"
# Remove version dots for anchor markdown
version_no_dots=$(echo "$new_version" | sed -e 's/\.//g')
perl -i -pe 's|^\* \['"$package_name"'.*|* ['"$package_name"' '"$new_version"'][]|' "$deps_file_path"
perl -i -pe 's|^\['"$package_name"'.*\]: #'"$package_name"'.*|['"$package_name"' '"$new_version"']: #'"$package_name"'-'"$version_no_dots"'|' "$deps_file_path"
perl -i -pe 's|^### '"$package_name"'.*|### '"$package_name"' '"$new_version"'|' "$deps_file_path"
package_name="$1"
new_version="$2"
deps_file_path="$ROOT/doc/contributing/maintaining/maintaining-dependencies.md"
# Remove version dots for anchor markdown
version_no_dots=$(echo "$new_version" | sed -e 's/\.//g')
perl -i -pe 's|^\* \['"$package_name"'.*|* ['"$package_name"' '"$new_version"'][]|' "$deps_file_path"
perl -i -pe 's|^\['"$package_name"'.*\]: #'"$package_name"'.*|['"$package_name"' '"$new_version"']: #'"$package_name"'-'"$version_no_dots"'|' "$deps_file_path"
perl -i -pe 's|^### '"$package_name"'.*|### '"$package_name"' '"$new_version"'|' "$deps_file_path"
}

0 comments on commit af728dd

Please sign in to comment.