OSDN Git Service

[update] : Unify variable names for option analysis
authorhayao <hayao@fascode.net>
Sun, 7 Mar 2021 01:21:56 +0000 (10:21 +0900)
committerhayao <hayao@fascode.net>
Sun, 7 Mar 2021 01:21:56 +0000 (10:21 +0900)
build.sh
tools/allpkglist.sh
tools/alteriso-info.sh
tools/channel.sh
tools/fullbuild.sh
tools/kernel.sh
tools/locale.sh
tools/pkglist.sh
tools/testpkg.sh

index bd539d9..8108546 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -945,7 +945,6 @@ make_efiboot() {
     sed "s|%ARCH%|${arch}|g;" "${script_path}/efiboot/${_use_config_name}/loader.conf" > "${work_dir}/efiboot/loader/loader.conf"
     cp "${isofs_dir}/loader/entries/uefi-shell"* "${work_dir}/efiboot/loader/entries/"
 
-
     local _efi_config_list=() _efi_config
     _efi_config_list+=($(ls "${script_path}/efiboot/${_use_config_name}/archiso-cd"*".conf" | grep -v "rescue"))
 
@@ -1045,15 +1044,15 @@ make_iso() {
 
 # Parse options
 ARGUMENT="${@}"
-OPT_S="a:bc:deg:hjk:l:o:p:rt:u:w:x"
-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"
-if ! OPT=$(getopt -o ${OPT_S} -l ${OPT_L} -- ${DEFAULT_ARGUMENT} ${ARGUMENT}); then
+OPTS="a:bc:deg:hjk:l:o:p:rt:u:w:x"
+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"
+if ! OPT=$(getopt -o ${OPTS} -l ${OPTL} -- ${DEFAULT_ARGUMENT} ${ARGUMENT}); then
     exit 1
 fi
 
 eval set -- "${OPT}"
 msg_debug "Argument: ${OPT}"
-unset OPT opt_short opt_long
+unset OPT OPTS OPTL
 
 while :; do
     case "${1}" in
@@ -1247,7 +1246,6 @@ if [[ -n "${1+SET}" ]]; then
     esac
 else
     channel_dir="${script_path}/channels/${channel_name}"
-
 fi
 
 # Set for special channels
@@ -1270,7 +1268,6 @@ if [[ ! "$(bash "${tools_dir}/channel.sh" --version "${alteriso_version}" ver "$
     fi
 fi
 
-
 set -eu
 
 prepare_env
index a1171ac..bda3ac8 100755 (executable)
@@ -33,12 +33,13 @@ include_aur=false
 
 # Parse options
 ARGUMENT="${@}"
-opt_short="a:o:hs"
-opt_long="arch:,out:,help,stdout,aur"
-OPT=$(getopt -o ${opt_short} -l ${opt_long} -- ${ARGUMENT})
-[[ ${?} != 0 ]] && exit 1
+OPTS="a:o:hs"
+OPTL="arch:,out:,help,stdout,aur"
+if ! OPT=$(getopt -o ${OPTS} -l ${OPTL} -- ${ARGUMENT}); then
+    exit 1
+fi
 eval set -- "${OPT}"
-unset OPT opt_short opt_long
+unset OPT OPTS OPTL
 
 while true; do
     case "${1}" in
index 5a4d4f6..5126786 100755 (executable)
@@ -22,13 +22,14 @@ _help() {
 
 # Parse options
 ARGUMENT="${@}"
-opt_short="a:b:c:d:k:o:p:u:v:h"
-opt_long="arch:,boot-splash:,channel:,developer:,kernel:,os-name:,password:,username:,version:,help"
-OPT=$(getopt -o ${opt_short} -l ${opt_long} -- ${ARGUMENT})
-[[ ${?} != 0 ]] && exit 1
+OPTS="a:b:c:d:k:o:p:u:v:h"
+OPTL="arch:,boot-splash:,channel:,developer:,kernel:,os-name:,password:,username:,version:,help"
+if ! OPT=$(getopt -o ${OPTS} -l ${OPTL} -- ${ARGUMENT}); then
+    exit 1
+fi
 
 eval set -- "${OPT}"
-unset OPT opt_short opt_long
+unset OPT OPTS OPTL
 
 while true; do
     case ${1} in
index f979e67..4b02ae3 100755 (executable)
@@ -161,13 +161,13 @@ show() {
 
 # Parse options
 ARGUMENT="${@}"
-opt_short="a:bdfk:nov:h"
-opt_long="arch:,nobuiltin,dirname,fullpath,kernel:,only-add,nochkver,version:,help,nocheck"
-OPT=$(getopt -o ${opt_short} -l ${opt_long} -- ${ARGUMENT})
-[[ ${?} != 0 ]] && exit 1
-
+OPTS="a:bdfk:nov:h"
+OPTL="arch:,nobuiltin,dirname,fullpath,kernel:,only-add,nochkver,version:,help,nocheck"
+if ! OPT=$(getopt -o ${OPTS} -l ${OPTL} -- ${ARGUMENT}); then
+    exit 1
+fi
 eval set -- "${OPT}"
-unset OPT opt_short opt_long
+unset OPT OPTS OPTL
 
 while true; do
     case ${1} in
index 6cd3727..aeaa9b5 100755 (executable)
@@ -148,13 +148,13 @@ default_options="--boot-splash --cleanup --user alter --password alter"
 
 # Parse options
 ARGUMENT="${@}"
-opt_short="a:dghr:sctm:l:"
-opt_long="help,remove-cache"
-OPT=$(getopt -o ${opt_short} -l ${opt_long} -- ${ARGUMENT})
-[[ ${?} != 0 ]] && exit 1
-
+OPTS="a:dghr:sctm:l:"
+OPTL="help,remove-cache"
+if ! OPT=$(getopt -o ${OPTS} -l ${OPTL} -- ${ARGUMENT}); then
+    exit 1
+fi
 eval set -- "${OPT}"
-unset OPT opt_short opt_long
+unset OPT OPTS OPTL
 
 while true; do
     case ${1} in
index 18a4f6d..d806af1 100755 (executable)
@@ -127,13 +127,13 @@ EOF
 
 # Parse options
 ARGUMENT="${@}"
-opt_short="a:c:hs"
-opt_long="arch:,channel:,help,script"
-OPT=$(getopt -o ${opt_short} -l ${opt_long} -- ${ARGUMENT})
-[[ ${?} != 0 ]] && exit 1
-
+OPTS="a:c:hs"
+OPTL="arch:,channel:,help,script"
+if ! OPT=$(getopt -o ${OPTS} -l ${OPTL} -- ${ARGUMENT}); then
+    exit 1
+fi
 eval set -- "${OPT}"
-unset OPT opt_short opt_long
+unset OPT OPTS OPTL
 
 while true; do
     case ${1} in
index 84dff4f..918d829 100755 (executable)
@@ -118,13 +118,13 @@ EOF
 
 # Parse options
 ARGUMENT="${@}"
-opt_short="a:c:hs"
-opt_long="arch:,channel:,help,script"
-OPT=$(getopt -o ${opt_short} -l ${opt_long} -- ${ARGUMENT})
-[[ ${?} != 0 ]] && exit 1
-
+OPTS="a:c:hs"
+OPTL="arch:,channel:,help,script"
+if ! OPT=$(getopt -o ${OPTS} -l ${OPTL} -- ${ARGUMENT}); then
+    exit 1
+fi
 eval set -- "${OPT}"
-unset OPT opt_short opt_long
+unset OPT OPTS OPTL
 
 while true; do
     case ${1} in
index a25ce8d..cafc6c5 100755 (executable)
@@ -71,14 +71,14 @@ msg_debug() {
 
 # Parse options
 ARGUMENT="${@}"
-opt_short="a:bc:dk:l:mh"
-opt_long="arch:,boot-splash,channel:,debug,kernel:,locale:,memtest86,aur,help,line"
-if ! OPT=$(getopt -o ${opt_short} -l ${opt_long} -- ${ARGUMENT}); then
+OPTS="a:bc:dk:l:mh"
+OPTL="arch:,boot-splash,channel:,debug,kernel:,locale:,memtest86,aur,help,line"
+if ! OPT=$(getopt -o ${OPTS} -l ${OPTL} -- ${ARGUMENT}); then
     exit 1
 fi
 
 eval set -- "${OPT}"
-unset OPT opt_short opt_long
+unset OPT OPTS OPTL
 
 while true; do
     case "${1}" in
index 44fefa7..84ce83d 100755 (executable)
@@ -62,13 +62,13 @@ _help() {
 
 # Parse options
 ARGUMENT="${@}"
-opt_short="dh"
-opt_long="debug,help"
-OPT=$(getopt -o ${opt_short} -l ${opt_long} -- ${ARGUMENT})
-[[ ${?} != 0 ]] && exit 1
-
+OPTS="dh"
+OPTL="debug,help"
+if ! OPT=$(getopt -o ${OPTS} -l ${OPTL} -- ${ARGUMENT}); then
+    exit 1
+fi
 eval set -- "${OPT}"
-unset OPT opt_short opt_long
+unset OPT OPTS OPTL
 
 while true; do
     case "${1}" in