Skip to content

Commit fe7a7f4

Browse files
committed
Fix build scripts when used on Ubuntu 21.04
1 parent cb0b32f commit fe7a7f4

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

scripts/build-container.sh

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#/bin/bash -e
22

3-
function usage {
3+
usage() {
44
echo "Usage: $0 [OPTIONS]"
55
echo " -c: command --> default [build]"
66
echo " | delete --> Delete the container, Dockerfile isn't mandatory"
@@ -13,7 +13,7 @@ function usage {
1313
}
1414

1515
# Attempt to turn relative paths into absolute paths
16-
function absolute_path() {
16+
absolute_path() {
1717
RELATIVE_PATH=$1
1818
if which realpath >/dev/null 2>/dev/null
1919
then
@@ -28,7 +28,7 @@ function absolute_path() {
2828
CONTAINER_NAME=sunshine
2929
COMMAND=BUILD
3030

31-
function build_container() {
31+
build_container() {
3232
CONTAINER_NAME=$1
3333
DOCKER_FILE=$2
3434

@@ -42,9 +42,9 @@ function build_container() {
4242
docker build . -t "$CONTAINER_NAME" -f "$DOCKER_FILE"
4343
}
4444

45-
function delete() {
45+
delete() {
4646
CONTAINER_NAME_UPPER=$(echo "$CONTAINER_NAME" | tr '[:lower:]' '[:upper:]')
47-
if [ "$CONTAINER_NAME_UPPER" == "ALL" ]
47+
if [ "$CONTAINER_NAME_UPPER" = "ALL" ]
4848
then
4949
shopt -s nullglob
5050
for file in $(find . -maxdepth 1 -iname "Dockerfile-*" -type f)
@@ -67,9 +67,9 @@ function delete() {
6767
fi
6868
}
6969

70-
function build() {
70+
build() {
7171
CONTAINER_NAME_UPPER=$(echo "$CONTAINER_NAME" | tr '[:lower:]' '[:upper:]')
72-
if [ "$CONTAINER_NAME_UPPER" == "ALL" ]
72+
if [ "$CONTAINER_NAME_UPPER" = "ALL" ]
7373
then
7474
shopt -s nullglob
7575
for file in $(find . -maxdepth 1 -iname "Dockerfile-*" -type f)
@@ -89,14 +89,14 @@ function build() {
8989
fi
9090
}
9191

92-
function abort() {
92+
abort() {
9393
echo "$1"
9494
exit 10
9595
}
9696

97-
function compile() {
97+
compile() {
9898
CONTAINER_NAME_UPPER=$(echo "$CONTAINER_NAME" | tr '[:lower:]' '[:upper:]')
99-
if [ "$CONTAINER_NAME_UPPER" == "ALL" ]
99+
if [ "$CONTAINER_NAME_UPPER" = "ALL" ]
100100
then
101101
shopt -s nullglob
102102

@@ -152,18 +152,18 @@ done
152152

153153
echo "$0 set to $(echo $COMMAND | tr '[:upper:]' '[:lower:]')"
154154

155-
if [[ "$COMMAND" == "BUILD" ]]
155+
if [ "$COMMAND" = "BUILD" ]
156156
then
157157
echo "Start building..."
158158
delete
159159
build
160160
echo "Done."
161-
elif [[ "$COMMAND" == "COMPILE" ]]
161+
elif [ "$COMMAND" = "COMPILE" ]
162162
then
163163
echo "Start compiling..."
164164
compile
165165
echo "Done."
166-
elif [[ "$COMMAND" == "DELETE" ]]
166+
elif [ "$COMMAND" = "DELETE" ]
167167
then
168168
echo "Start deleting..."
169169
delete

scripts/build-sunshine.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#/bin/bash -e
22

3-
function usage {
3+
usage() {
44
echo "Usage: $0"
55
echo " -d: Generate a debug build"
66
echo " -p: Generate a debian package"
@@ -11,7 +11,7 @@ function usage {
1111
}
1212

1313
# Attempt to turn relative paths into absolute paths
14-
function absolute_path() {
14+
absolute_path() {
1515
RELATIVE_PATH=$1
1616
if which realpath >/dev/null 2>/dev/null
1717
then
@@ -81,7 +81,7 @@ while getopts ":dpuhc:s:n:" arg; do
8181
esac
8282
done
8383

84-
[ "$USERNAME" == "" ] && USERNAME=$(logname)
84+
[ "$USERNAME" = "" ] && USERNAME=$(logname)
8585

8686
BUILD_DIR="$PWD/$CONTAINER_NAME-build"
8787
SUNSHINE_ASSETS_DIR="-e SUNSHINE_ASSETS_DIR=$BUILD_DIR/assets"

0 commit comments

Comments
 (0)