@@ -9,80 +9,26 @@ cleanup() {
99 exit $EXIT_CODE
1010}
1111
12- download_v1 () {
13- LATEST_V1_TAG_NAME=" $( " $NODE " --input-type=module << 'EOF '
14- const res = await fetch('https://api.github.com/repos/quictls/openssl/git/matching-refs/tags/OpenSSL_1');
15- if (!res.ok) throw new Error(`FetchError: ${res.status} ${res.statusText}`, { cause: res });
16- const releases = await res.json()
17- const latest = releases.findLast(({ ref }) => ref.includes('quic'));
18- if(!latest) throw new Error(`Could not find latest release for v1`);
19- console.log(latest.ref.replace('refs/tags/',''));
20- EOF
21- ) "
22-
23- NEW_VERSION_V1=$( echo " $LATEST_V1_TAG_NAME " | sed ' s/OpenSSL_//;s/_/./g;s/-/+/g' )
24-
25- case " $NEW_VERSION_V1 " in
26- * quic1) NEW_VERSION_V1_NO_RELEASE=" ${NEW_VERSION_V1% 1} " ;;
27- * ) NEW_VERSION_V1_NO_RELEASE=" $NEW_VERSION_V1 " ;;
28- esac
29-
30- VERSION_H=" $DEPS_DIR /openssl/openssl/include/openssl/opensslv.h"
31- CURRENT_VERSION=$( grep " OPENSSL_VERSION_TEXT" " $VERSION_H " | sed -n " s/.*OpenSSL \([^\" ]*\).*/\1/p" | cut -d ' ' -f 1)
32-
33- # This function exit with 0 if new version and current version are the same
34- compare_dependency_version " openssl" " $NEW_VERSION_V1_NO_RELEASE " " $CURRENT_VERSION "
35-
36- echo " Making temporary workspace..."
37- WORKSPACE=$( mktemp -d 2> /dev/null || mktemp -d -t ' tmp' )
38- cd " $WORKSPACE "
39-
40- echo " Fetching OpenSSL source archive..."
41- OPENSSL_TARBALL=" openssl.tar.gz"
42- curl -sL -o " $OPENSSL_TARBALL " " https://api.github.com/repos/quictls/openssl/tarball/$LATEST_V1_TAG_NAME "
43- log_and_verify_sha256sum " openssl" " $OPENSSL_TARBALL "
44- gzip -dc " $OPENSSL_TARBALL " | tar xf -
45- rm " $OPENSSL_TARBALL "
46-
47- mv quictls-openssl-* openssl
48-
49- echo " Replacing existing OpenSSL..."
50- rm -rf " $DEPS_DIR /openssl/openssl"
51- mv " $WORKSPACE /openssl" " $DEPS_DIR /openssl/"
52-
53- echo " All done!"
54- echo " "
55- echo " Please git add openssl, and commit the new version:"
56- echo " "
57- echo " $ git add -A deps/openssl/openssl"
58- echo " $ git add doc/contributing/maintaining/maintaining-dependencies.md"
59- echo " $ git commit -m \" deps: upgrade openssl sources to quictls/openssl-$NEW_VERSION_V1 \" "
60- echo " "
61- # The last line of the script should always print the new version,
62- # as we need to add it to $GITHUB_ENV variable.
63- echo " NEW_VERSION=$NEW_VERSION_V1 "
64- }
65-
66- download_v3 () {
67- LATEST_V3_TAG_NAME=" $( " $NODE " --input-type=module << 'EOF '
12+ download () {
13+ LATEST_TAG_NAME=" $( " $NODE " --input-type=module << 'EOF '
6814const res = await fetch('https://api.github.com/repos/quictls/openssl/git/matching-refs/tags/openssl-3.0');
6915if (!res.ok) throw new Error(`FetchError: ${res.status} ${res.statusText}`, { cause: res });
7016const releases = await res.json()
7117const latest = releases.findLast(({ ref }) => ref.includes('quic'));
72- if(!latest) throw new Error(`Could not find latest release for v3.0 `);
18+ if(!latest) throw new Error(`Could not find latest release`);
7319console.log(latest.ref.replace('refs/tags/',''));
7420EOF
7521) "
76- NEW_VERSION_V3 =$( echo " $LATEST_V3_TAG_NAME " | sed ' s/openssl-//;s/-/+/g' )
22+ NEW_VERSION =$( echo " $LATEST_TAG_NAME " | sed ' s/openssl-//;s/-/+/g' )
7723
78- case " $NEW_VERSION_V3 " in
79- * quic1) NEW_VERSION_V3_NO_RELEASE =" ${NEW_VERSION_V3 % 1} " ;;
80- * ) NEW_VERSION_V3_NO_RELEASE =" $NEW_VERSION_V3 " ;;
24+ case " $NEW_VERSION " in
25+ * quic1) NEW_VERSION_NO_RELEASE =" ${NEW_VERSION % 1} " ;;
26+ * ) NEW_VERSION_NO_RELEASE =" $NEW_VERSION " ;;
8127 esac
8228 VERSION_H=" ./deps/openssl/config/archs/linux-x86_64/asm/include/openssl/opensslv.h"
8329 CURRENT_VERSION=$( grep " OPENSSL_FULL_VERSION_STR" $VERSION_H | sed -n " s/^.*VERSION_STR \" \(.*\)\" /\1/p" )
8430 # This function exit with 0 if new version and current version are the same
85- compare_dependency_version " openssl" " $NEW_VERSION_V3_NO_RELEASE " " $CURRENT_VERSION "
31+ compare_dependency_version " openssl" " $NEW_VERSION_NO_RELEASE " " $CURRENT_VERSION "
8632
8733 echo " Making temporary workspace..."
8834
9339
9440 OPENSSL_TARBALL=" openssl.tar.gz"
9541
96- curl -sL -o " $OPENSSL_TARBALL " " https://api.github.com/repos/quictls/openssl/tarball/$LATEST_V3_TAG_NAME "
42+ curl -sL -o " $OPENSSL_TARBALL " " https://api.github.com/repos/quictls/openssl/tarball/$LATEST_TAG_NAME "
9743
9844 log_and_verify_sha256sum " openssl" " $OPENSSL_TARBALL "
9945
11056 echo " Please git add openssl, and commit the new version:"
11157 echo " "
11258 echo " $ git add -A deps/openssl/openssl"
113- echo " $ git commit -m \" deps: upgrade openssl sources to quictls/openssl-$NEW_VERSION_V3 \" "
59+ echo " $ git commit -m \" deps: upgrade openssl sources to quictls/openssl-$NEW_VERSION \" "
11460 echo " "
11561 # The last line of the script should always print the new version,
11662 # as we need to add it to $GITHUB_ENV variable.
117- echo " NEW_VERSION=$NEW_VERSION_V3 "
63+ echo " NEW_VERSION=$NEW_VERSION "
11864}
11965
12066regenerate () {
@@ -168,7 +114,7 @@ main() {
168114 . " $BASE_DIR /tools/dep_updaters/utils.sh"
169115
170116 case ${1} in
171- help | regenerate | download_v1 | download_v3 )
117+ help | regenerate | download )
172118 $1 " ${2} "
173119 ;;
174120 * )
0 commit comments