Skip to content

Commit 64fd14e

Browse files
author
Andras Fekete
committed
Simplify with a utils-general.sh
1 parent b8bdba8 commit 64fd14e

File tree

4 files changed

+32
-19
lines changed

4 files changed

+32
-19
lines changed

scripts/build-wolfprovider.sh

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,6 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
66
LOG_FILE=${SCRIPT_DIR}/build-release.log
77
source ${SCRIPT_DIR}/utils-wolfprovider.sh
88

9-
kill_servers() {
10-
if [ "$(jobs -p)" != "" ]; then
11-
kill $(jobs -p)
12-
fi
13-
}
14-
15-
do_cleanup() {
16-
sleep 0.5 # flush buffers
17-
kill_servers
18-
}
19-
20-
do_trap() {
21-
printf "got trap\n"
22-
do_cleanup
23-
date
24-
exit 1
25-
}
26-
trap do_trap INT TERM
27-
289
echo "Using openssl: $OPENSSL_TAG, wolfssl: $WOLFSSL_TAG"
2910

3011
init_wolfprov

scripts/utils-general.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
# This script provides the bare minimum function definitions for compiling
3+
# the wolfProvider library
4+
5+
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
6+
7+
if [ "$UTILS_GENERAL_LOADED" != "yes" ]; then # only set once
8+
kill_servers() {
9+
if [ "$(jobs -p)" != "" ]; then
10+
kill $(jobs -p)
11+
fi
12+
}
13+
14+
do_cleanup() {
15+
sleep 0.5 # flush buffers
16+
kill_servers
17+
}
18+
19+
do_trap() {
20+
printf "got trap\n"
21+
do_cleanup
22+
date
23+
exit 1
24+
}
25+
trap do_trap INT TERM
26+
27+
export UTILS_GENERAL_LOADED=yes
28+
fi

scripts/utils-openssl.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
#
2525

2626
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
27+
source ${SCRIPT_DIR}/utils-general.sh
28+
2729
OPENSSL_GIT="https://github.com/openssl/openssl.git"
2830
OPENSSL_TAG=${OPENSSL_TAG:-"openssl-3.0.0"}
2931
OPENSSL_SOURCE_DIR=${SCRIPT_DIR}/../openssl-source

scripts/utils-wolfssl.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#
2121

2222
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
23+
source ${SCRIPT_DIR}/utils-general.sh
24+
2325
WOLFSSL_GIT=${WOLFSSL_GIT:-"https://github.com/wolfSSL/wolfssl.git"}
2426
WOLFSSL_TAG=${WOLFSSL_TAG:-"v5.7.2-stable"}
2527
WOLFSSL_SOURCE_DIR=${SCRIPT_DIR}/../wolfssl-source

0 commit comments

Comments
 (0)