Skip to content

Commit 7b07b6a

Browse files
committed
[update] : Unify variable names for option analysis
1 parent e83e24a commit 7b07b6a

File tree

9 files changed

+50
-51
lines changed

9 files changed

+50
-51
lines changed

build.sh

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -945,7 +945,6 @@ make_efiboot() {
945945
sed "s|%ARCH%|${arch}|g;" "${script_path}/efiboot/${_use_config_name}/loader.conf" > "${work_dir}/efiboot/loader/loader.conf"
946946
cp "${isofs_dir}/loader/entries/uefi-shell"* "${work_dir}/efiboot/loader/entries/"
947947

948-
949948
local _efi_config_list=() _efi_config
950949
_efi_config_list+=($(ls "${script_path}/efiboot/${_use_config_name}/archiso-cd"*".conf" | grep -v "rescue"))
951950

@@ -1045,15 +1044,15 @@ make_iso() {
10451044

10461045
# Parse options
10471046
ARGUMENT="${@}"
1048-
OPT_S="a:bc:deg:hjk:l:o:p:rt:u:w:x"
1049-
OPT_L="arch:,boot-splash,comp-type:,debug,cleaning,cleanup,gpgkey:,help,lang:,japanese,kernel:,out:,password:,comp-opts:,user:,work:,bash-debug,nocolor,noconfirm,nodepend,gitversion,shmkalteriso,msgdebug,noloopmod,tarball,noiso,noaur,nochkver,channellist,config:,noefi,nodebug,nosigcheck"
1050-
if ! OPT=$(getopt -o ${OPT_S} -l ${OPT_L} -- ${DEFAULT_ARGUMENT} ${ARGUMENT}); then
1047+
OPTS="a:bc:deg:hjk:l:o:p:rt:u:w:x"
1048+
OPTL="arch:,boot-splash,comp-type:,debug,cleaning,cleanup,gpgkey:,help,lang:,japanese,kernel:,out:,password:,comp-opts:,user:,work:,bash-debug,nocolor,noconfirm,nodepend,gitversion,shmkalteriso,msgdebug,noloopmod,tarball,noiso,noaur,nochkver,channellist,config:,noefi,nodebug,nosigcheck"
1049+
if ! OPT=$(getopt -o ${OPTS} -l ${OPTL} -- ${DEFAULT_ARGUMENT} ${ARGUMENT}); then
10511050
exit 1
10521051
fi
10531052

10541053
eval set -- "${OPT}"
10551054
msg_debug "Argument: ${OPT}"
1056-
unset OPT opt_short opt_long
1055+
unset OPT OPTS OPTL
10571056

10581057
while :; do
10591058
case "${1}" in
@@ -1247,7 +1246,6 @@ if [[ -n "${1+SET}" ]]; then
12471246
esac
12481247
else
12491248
channel_dir="${script_path}/channels/${channel_name}"
1250-
12511249
fi
12521250

12531251
# Set for special channels
@@ -1270,7 +1268,6 @@ if [[ ! "$(bash "${tools_dir}/channel.sh" --version "${alteriso_version}" ver "$
12701268
fi
12711269
fi
12721270

1273-
12741271
set -eu
12751272

12761273
prepare_env

tools/allpkglist.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,13 @@ include_aur=false
3333

3434
# Parse options
3535
ARGUMENT="${@}"
36-
opt_short="a:o:hs"
37-
opt_long="arch:,out:,help,stdout,aur"
38-
OPT=$(getopt -o ${opt_short} -l ${opt_long} -- ${ARGUMENT})
39-
[[ ${?} != 0 ]] && exit 1
36+
OPTS="a:o:hs"
37+
OPTL="arch:,out:,help,stdout,aur"
38+
if ! OPT=$(getopt -o ${OPTS} -l ${OPTL} -- ${ARGUMENT}); then
39+
exit 1
40+
fi
4041
eval set -- "${OPT}"
41-
unset OPT opt_short opt_long
42+
unset OPT OPTS OPTL
4243

4344
while true; do
4445
case "${1}" in

tools/alteriso-info.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,14 @@ _help() {
2222

2323
# Parse options
2424
ARGUMENT="${@}"
25-
opt_short="a:b:c:d:k:o:p:u:v:h"
26-
opt_long="arch:,boot-splash:,channel:,developer:,kernel:,os-name:,password:,username:,version:,help"
27-
OPT=$(getopt -o ${opt_short} -l ${opt_long} -- ${ARGUMENT})
28-
[[ ${?} != 0 ]] && exit 1
25+
OPTS="a:b:c:d:k:o:p:u:v:h"
26+
OPTL="arch:,boot-splash:,channel:,developer:,kernel:,os-name:,password:,username:,version:,help"
27+
if ! OPT=$(getopt -o ${OPTS} -l ${OPTL} -- ${ARGUMENT}); then
28+
exit 1
29+
fi
2930

3031
eval set -- "${OPT}"
31-
unset OPT opt_short opt_long
32+
unset OPT OPTS OPTL
3233

3334
while true; do
3435
case ${1} in

tools/channel.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,13 @@ show() {
161161

162162
# Parse options
163163
ARGUMENT="${@}"
164-
opt_short="a:bdfk:nov:h"
165-
opt_long="arch:,nobuiltin,dirname,fullpath,kernel:,only-add,nochkver,version:,help,nocheck"
166-
OPT=$(getopt -o ${opt_short} -l ${opt_long} -- ${ARGUMENT})
167-
[[ ${?} != 0 ]] && exit 1
168-
164+
OPTS="a:bdfk:nov:h"
165+
OPTL="arch:,nobuiltin,dirname,fullpath,kernel:,only-add,nochkver,version:,help,nocheck"
166+
if ! OPT=$(getopt -o ${OPTS} -l ${OPTL} -- ${ARGUMENT}); then
167+
exit 1
168+
fi
169169
eval set -- "${OPT}"
170-
unset OPT opt_short opt_long
170+
unset OPT OPTS OPTL
171171

172172
while true; do
173173
case ${1} in

tools/fullbuild.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,13 @@ default_options="--boot-splash --cleanup --user alter --password alter"
148148

149149
# Parse options
150150
ARGUMENT="${@}"
151-
opt_short="a:dghr:sctm:l:"
152-
opt_long="help,remove-cache"
153-
OPT=$(getopt -o ${opt_short} -l ${opt_long} -- ${ARGUMENT})
154-
[[ ${?} != 0 ]] && exit 1
155-
151+
OPTS="a:dghr:sctm:l:"
152+
OPTL="help,remove-cache"
153+
if ! OPT=$(getopt -o ${OPTS} -l ${OPTL} -- ${ARGUMENT}); then
154+
exit 1
155+
fi
156156
eval set -- "${OPT}"
157-
unset OPT opt_short opt_long
157+
unset OPT OPTS OPTL
158158

159159
while true; do
160160
case ${1} in

tools/kernel.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,13 @@ EOF
127127

128128
# Parse options
129129
ARGUMENT="${@}"
130-
opt_short="a:c:hs"
131-
opt_long="arch:,channel:,help,script"
132-
OPT=$(getopt -o ${opt_short} -l ${opt_long} -- ${ARGUMENT})
133-
[[ ${?} != 0 ]] && exit 1
134-
130+
OPTS="a:c:hs"
131+
OPTL="arch:,channel:,help,script"
132+
if ! OPT=$(getopt -o ${OPTS} -l ${OPTL} -- ${ARGUMENT}); then
133+
exit 1
134+
fi
135135
eval set -- "${OPT}"
136-
unset OPT opt_short opt_long
136+
unset OPT OPTS OPTL
137137

138138
while true; do
139139
case ${1} in

tools/locale.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,13 @@ EOF
118118

119119
# Parse options
120120
ARGUMENT="${@}"
121-
opt_short="a:c:hs"
122-
opt_long="arch:,channel:,help,script"
123-
OPT=$(getopt -o ${opt_short} -l ${opt_long} -- ${ARGUMENT})
124-
[[ ${?} != 0 ]] && exit 1
125-
121+
OPTS="a:c:hs"
122+
OPTL="arch:,channel:,help,script"
123+
if ! OPT=$(getopt -o ${OPTS} -l ${OPTL} -- ${ARGUMENT}); then
124+
exit 1
125+
fi
126126
eval set -- "${OPT}"
127-
unset OPT opt_short opt_long
127+
unset OPT OPTS OPTL
128128

129129
while true; do
130130
case ${1} in

tools/pkglist.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,14 @@ msg_debug() {
7171

7272
# Parse options
7373
ARGUMENT="${@}"
74-
opt_short="a:bc:dk:l:mh"
75-
opt_long="arch:,boot-splash,channel:,debug,kernel:,locale:,memtest86,aur,help,line"
76-
if ! OPT=$(getopt -o ${opt_short} -l ${opt_long} -- ${ARGUMENT}); then
74+
OPTS="a:bc:dk:l:mh"
75+
OPTL="arch:,boot-splash,channel:,debug,kernel:,locale:,memtest86,aur,help,line"
76+
if ! OPT=$(getopt -o ${OPTS} -l ${OPTL} -- ${ARGUMENT}); then
7777
exit 1
7878
fi
7979

8080
eval set -- "${OPT}"
81-
unset OPT opt_short opt_long
81+
unset OPT OPTS OPTL
8282

8383
while true; do
8484
case "${1}" in

tools/testpkg.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ _help() {
6262

6363
# Parse options
6464
ARGUMENT="${@}"
65-
opt_short="dh"
66-
opt_long="debug,help"
67-
OPT=$(getopt -o ${opt_short} -l ${opt_long} -- ${ARGUMENT})
68-
[[ ${?} != 0 ]] && exit 1
69-
65+
OPTS="dh"
66+
OPTL="debug,help"
67+
if ! OPT=$(getopt -o ${OPTS} -l ${OPTL} -- ${ARGUMENT}); then
68+
exit 1
69+
fi
7070
eval set -- "${OPT}"
71-
unset OPT opt_short opt_long
71+
unset OPT OPTS OPTL
7272

7373
while true; do
7474
case "${1}" in

0 commit comments

Comments
 (0)