Skip to content

Commit 4afdc5e

Browse files
lucacomethresheek
authored andcommitted
Lint update.sh
1 parent abc9db0 commit 4afdc5e

File tree

1 file changed

+30
-22
lines changed

1 file changed

+30
-22
lines changed

update.sh

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ declare -A njs=(
2121

2222
defaultpkg='1'
2323
declare -A pkg=(
24-
# [stable]=2
24+
# [stable]=2
2525
)
2626

2727
defaultdebian='bullseye'
2828
declare -A debian=(
29-
[stable]='buster'
29+
[stable]='buster'
3030
)
3131

3232
defaultalpine='3.14'
@@ -43,26 +43,28 @@ declare -A rev=(
4343
)
4444

4545
get_packages() {
46-
local distro="$1"; shift;
47-
local branch="$1"; shift;
46+
local distro="$1"
47+
shift
48+
local branch="$1"
49+
shift
4850
local perl=
4951
local r=
5052
local sep=
5153

5254
case "$distro:$branch" in
53-
alpine*:*)
54-
r="r"
55-
sep="."
56-
;;
57-
debian*:*)
58-
sep="+"
59-
;;
55+
alpine*:*)
56+
r="r"
57+
sep="."
58+
;;
59+
debian*:*)
60+
sep="+"
61+
;;
6062
esac
6163

6264
case "$distro" in
63-
*-perl)
64-
perl="nginx-module-perl"
65-
;;
65+
*-perl)
66+
perl="nginx-module-perl"
67+
;;
6668
esac
6769

6870
echo -n ' \\\n'
@@ -75,17 +77,21 @@ get_packages() {
7577
}
7678

7779
get_packagerepo() {
78-
local distro="${1%-perl}"; shift;
79-
local branch="$1"; shift;
80+
local distro="${1%-perl}"
81+
shift
82+
local branch="$1"
83+
shift
8084

8185
[ "$branch" = "mainline" ] && branch="$branch/" || branch=""
8286

8387
echo "https://nginx.org/packages/${branch}${distro}/"
8488
}
8589

8690
get_packagever() {
87-
local distro="${1%-perl}"; shift;
88-
local branch="$1"; shift;
91+
local distro="${1%-perl}"
92+
shift
93+
local branch="$1"
94+
shift
8995
local suffix=
9096

9197
[ "${distro}" = "debian" ] && suffix="~${debianver}"
@@ -94,7 +100,7 @@ get_packagever() {
94100
}
95101

96102
generated_warning() {
97-
cat << __EOF__
103+
cat <<__EOF__
98104
#
99105
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
100106
#
@@ -106,16 +112,18 @@ __EOF__
106112
for branch in "${branches[@]}"; do
107113
for variant in \
108114
alpine{,-perl} \
109-
debian{,-perl} \
110-
; do
115+
debian{,-perl}; do
111116
echo "$branch: $variant"
112117
dir="$branch/$variant"
113118
variant="$(basename "$variant")"
114119

115120
[ -d "$dir" ] || continue
116121

117122
template="Dockerfile-${variant%-perl}.template"
118-
{ generated_warning; cat "$template"; } > "$dir/Dockerfile"
123+
{
124+
generated_warning
125+
cat "$template"
126+
} >"$dir/Dockerfile"
119127

120128
debianver="${debian[$branch]:-$defaultdebian}"
121129
alpinever="${alpine[$branch]:-$defaultalpine}"

0 commit comments

Comments
 (0)