@@ -9,80 +9,26 @@ cleanup() {
9
9
exit $EXIT_CODE
10
10
}
11
11
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 '
68
14
const res = await fetch('https://api.github.com/repos/quictls/openssl/git/matching-refs/tags/openssl-3.0');
69
15
if (!res.ok) throw new Error(`FetchError: ${res.status} ${res.statusText}`, { cause: res });
70
16
const releases = await res.json()
71
17
const 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`);
73
19
console.log(latest.ref.replace('refs/tags/',''));
74
20
EOF
75
21
) "
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' )
77
23
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 " ;;
81
27
esac
82
28
VERSION_H=" ./deps/openssl/config/archs/linux-x86_64/asm/include/openssl/opensslv.h"
83
29
CURRENT_VERSION=$( grep " OPENSSL_FULL_VERSION_STR" $VERSION_H | sed -n " s/^.*VERSION_STR \" \(.*\)\" /\1/p" )
84
30
# 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 "
86
32
87
33
echo " Making temporary workspace..."
88
34
93
39
94
40
OPENSSL_TARBALL=" openssl.tar.gz"
95
41
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 "
97
43
98
44
log_and_verify_sha256sum " openssl" " $OPENSSL_TARBALL "
99
45
110
56
echo " Please git add openssl, and commit the new version:"
111
57
echo " "
112
58
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 \" "
114
60
echo " "
115
61
# The last line of the script should always print the new version,
116
62
# as we need to add it to $GITHUB_ENV variable.
117
- echo " NEW_VERSION=$NEW_VERSION_V3 "
63
+ echo " NEW_VERSION=$NEW_VERSION "
118
64
}
119
65
120
66
regenerate () {
@@ -168,7 +114,7 @@ main() {
168
114
. " $BASE_DIR /tools/dep_updaters/utils.sh"
169
115
170
116
case ${1} in
171
- help | regenerate | download_v1 | download_v3 )
117
+ help | regenerate | download )
172
118
$1 " ${2} "
173
119
;;
174
120
* )
0 commit comments