Skip to content

Commit fdf2b77

Browse files
committed
[update] : Added --rerun
1 parent 7974218 commit fdf2b77

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

build.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ ARGUMENT=("${@}")
3131
alteriso_version="3.1"
3232
norepopkg=()
3333
legacy_mode=false
34+
rerun=false
3435

3536
# Load config file
3637
[[ ! -f "${defaultconfig}" ]] && "${tools_dir}/msg.sh" -a 'build.sh' error "${defaultconfig} was not found." && exit 1
@@ -480,8 +481,8 @@ prepare_build() {
480481
if [[ ! "${logging}" = false ]]; then
481482
[[ "${customized_logpath}" = false ]] && logging="${out_dir}/${iso_filename%.iso}.log"
482483
mkdir -p "$(dirname "${logging}")" && touch "${logging}"
483-
msg_warn "Re-run sudo ${0} ${ARGUMENT[*]} --nodepend --nolog --nocolor 2>&1 | tee ${logging}"
484-
sudo "${0}" "${ARGUMENT[@]}" --nolog --nocolor --nodepend 2>&1 | tee "${logging}"
484+
msg_warn "Re-run sudo ${0} ${ARGUMENT[*]} --nodepend --nolog --nocolor --rerun 2>&1 | tee ${logging}"
485+
sudo "${0}" "${ARGUMENT[@]}" --nolog --nocolor --nodepend --rerun 2>&1 | tee "${logging}"
485486
exit "${?}"
486487
fi
487488

@@ -1053,7 +1054,7 @@ make_iso() {
10531054

10541055

10551056
# Parse options
1056-
ARGUMENT=("${DEFAULT_ARGUMENT[@]}" "${@}") OPTS=("a:" "b" "c:" "d" "e" "g:" "h" "j" "k:" "l:" "o:" "p:" "r" "t:" "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" "msgdebug" "noloopmod" "tarball" "noiso" "noaur" "nochkver" "channellist" "config:" "noefi" "nodebug" "nosigcheck" "normwork" "log" "logpath:" "nolog" "nopkgbuild" "pacman-debug" "confirm" "tar-type:" "tar-opts:" "add-module:" "nogitversion" "cowspace:")
1057+
ARGUMENT=("${DEFAULT_ARGUMENT[@]}" "${@}") OPTS=("a:" "b" "c:" "d" "e" "g:" "h" "j" "k:" "l:" "o:" "p:" "r" "t:" "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" "msgdebug" "noloopmod" "tarball" "noiso" "noaur" "nochkver" "channellist" "config:" "noefi" "nodebug" "nosigcheck" "normwork" "log" "logpath:" "nolog" "nopkgbuild" "pacman-debug" "confirm" "tar-type:" "tar-opts:" "add-module:" "nogitversion" "cowspace:" "rerun")
10571058
GETOPT=(-o "$(printf "%s," "${OPTS[@]}")" -l "$(printf "%s," "${OPTL[@]}")" -- "${ARGUMENT[@]}")
10581059
getopt -Q "${GETOPT[@]}" || exit 1 # 引数エラー判定
10591060
readarray -t OPT < <(getopt "${GETOPT[@]}") # 配列に代入
@@ -1156,6 +1157,7 @@ while true; do
11561157
--nopkgbuild ) nopkgbuild=true && shift 1 ;;
11571158
--nogitversion ) gitversion=false && shift 1 ;;
11581159
--cowspace ) cowspace="${2}" && shift 2 ;;
1160+
--rerun ) rerun=true && shift 1 ;;
11591161
-- ) shift 1 && break ;;
11601162
*)
11611163
msg_error "Argument exception error '${1}'"
@@ -1168,7 +1170,7 @@ done
11681170
if (( ! "${EUID}" == 0 )); then
11691171
msg_warn "This script must be run as root." >&2
11701172
msg_warn "Re-run 'sudo ${0} ${ARGUMENT[*]}'"
1171-
sudo "${0}" "${ARGUMENT[@]}"
1173+
sudo "${0}" "${ARGUMENT[@]}" --rerun
11721174
exit "${?}"
11731175
fi
11741176

0 commit comments

Comments
 (0)