diff options
-rwxr-xr-x | build.sh | 28 | ||||
-rw-r--r-- | subr/build.subr | 22 | ||||
-rw-r--r-- | vars/build.vars | 2 |
3 files changed, 26 insertions, 26 deletions
@@ -5,7 +5,7 @@ # # # -for __ in subr/*.subr; do . ${__}; done; +for __ in subr/*.subr; do . "${__}"; done; set -o noglob; while [ ${#} -gt 0 ]; do case ${1} in @@ -13,17 +13,17 @@ case ${1} in -C) ARG_CHECK_UPDATES=1; ;; -N) ARG_OFFLINE=1; ;; -i) ARG_IGNORE_SHA256SUMS=1; ;; --t*) ARG_TARBALL=1; [ "${1#-t.}" != "${1}" ] && TARBALL_SUFFIX=${1#-t.}; ;; +-t*) ARG_TARBALL=1; [ "${1#-t.}" != "${1}" ] && TARBALL_SUFFIX="${1#-t.}"; ;; -v) ARG_VERBOSE=1; ;; -x) ARG_XTRACE=1; set -o xtrace; ;; --a) [ -z "${2}" ] && exec cat etc/build.usage || ARCH=${2}; shift; ;; --b) [ -z "${2}" ] && exec cat etc/build.usage || BUILD=${2}; shift; ;; +-a) [ -z "${2}" ] && exec cat etc/build.usage || ARCH="${2}"; shift; ;; +-b) [ -z "${2}" ] && exec cat etc/build.usage || BUILD="${2}"; shift; ;; -r) if [ -z "${2}" ]; then exec cat build.usage; elif [ "${2%:*}" = "${2}" ]; then - ARG_RESTART=${2}; + ARG_RESTART="${2}"; else - ARG_RESTART=${2%:*}; ARG_RESTART_AT=${2#*:}; + ARG_RESTART="${2%:*}"; ARG_RESTART_AT="${2#*:}"; fi; BUILD_PACKAGES_RESTART="$(echo ${ARG_RESTART} | sed "s/,/ /g")"; shift; ;; @@ -38,15 +38,15 @@ pre_setup_env; pre_prereqs; pre_subdirs; pre_build_files; # # {( -if [ ${ARG_CHECK_UPDATES:-0} -eq 0 ]; then +if [ "${ARG_CHECK_UPDATES:-0}" -eq 0 ]; then log_msg info "Build started by ${BUILD_USER:=${USER}}@${BUILD_HNAME:=$(hostname)} at ${BUILD_DATE_START}."; log_env_vars "build (global)" ${LOG_ENV_VARS}; else log_msg info "Version check run started by ${BUILD_USER:=${USER}}@${BUILD_HNAME:=$(hostname)} at ${BUILD_DATE_START}."; fi; for BUILD_TARGET_LC in $(subst_tgts invariants ${BUILD_TARGETS_META:-world}); do - BUILD_TARGET=$(echo ${BUILD_TARGET_LC} | tr a-z A-Z); - BUILD_PACKAGES=$(get_var_unsafe ${BUILD_TARGET}_PACKAGES); + BUILD_TARGET="$(echo ${BUILD_TARGET_LC} | tr a-z A-Z)"; + BUILD_PACKAGES="$(get_var_unsafe ${BUILD_TARGET}_PACKAGES)"; if [ "${BUILD_TARGET}" != "INVARIANTS" ]\ && [ -n "${BUILD_PACKAGES_RESTART}" ]; then BUILD_PACKAGES="$(lfilter "${BUILD_PACKAGES}" "${BUILD_PACKAGES_RESTART}")"; @@ -55,7 +55,7 @@ for BUILD_TARGET_LC in $(subst_tgts invariants ${BUILD_TARGETS_META:-world}); do # # # - if [ ${ARG_CHECK_UPDATES:-0} -eq 1 ]\ + if [ "${ARG_CHECK_UPDATES:-0}" -eq 1 ]\ && [ "${BUILD_PACKAGE#*.*}" = "${BUILD_PACKAGE}" ]; then (mode_check_pkg_updates "${PKG_NAME}" "${BUILD_PACKAGE}"); continue; @@ -94,24 +94,24 @@ for BUILD_TARGET_LC in $(subst_tgts invariants ${BUILD_TARGETS_META:-world}); do done; shift; done; fi); - case ${BUILD_SCRIPT_RC:=${?}} in + case "${BUILD_SCRIPT_RC:=${?}}" in 0) log_msg succ "Finished \`${PKG_NAME}' build."; : $((BUILD_NFINI+=1)); continue; ;; *) log_msg fail "Build failed in \`${PKG_NAME}' (last return code ${BUILD_SCRIPT_RC}.)."; : $((BUILD_NFAIL+=1)); break; ;; esac; done; - if [ ${BUILD_SCRIPT_RC:-0} -ne 0 ]; then + if [ "${BUILD_SCRIPT_RC:-0}" -ne 0 ]; then break; fi; done; -if [ ${BUILD_SCRIPT_RC:-0} -eq 0 ]; then +if [ "${BUILD_SCRIPT_RC:-0}" -eq 0 ]; then post_copy_etc; post_strip; post_tarballs; fi; post_build_files; log_msg info "${BUILD_NFINI} finished, ${BUILD_NSKIP} skipped, and ${BUILD_NFAIL} failed builds in ${BUILD_NBUILT} build script(s)."; log_msg info "Build time: ${BUILD_TIMES_HOURS} hour(s), ${BUILD_TIMES_MINUTES} minute(s), and ${BUILD_TIMES_SECS} second(s)."; -exit ${BUILD_SCRIPT_RC})} 2>&1 | tee ${BUILD_LOG_FNAME} & TEE_PID=${!}; +exit "${BUILD_SCRIPT_RC}")} 2>&1 | tee "${BUILD_LOG_FNAME}" & TEE_PID="${!}"; trap "rm -f ${BUILD_STATUS_IN_PROGRESS_FNAME}; \ log_msg fail \"Build aborted.\"; \ echo kill ${TEE_PID}; \ diff --git a/subr/build.subr b/subr/build.subr index afd76072..e95bf44d 100644 --- a/subr/build.subr +++ b/subr/build.subr @@ -14,13 +14,13 @@ build_fileop() { local _op="${1}"; shift; if [ "${_op}" = cd ]; then log_msg varn "Changing working directory to \`${1}'."; - [ \( -n "${1}" \) -a \( -e "${1}" \) ] && cd -- ${1}; + [ \( -n "${1}" \) -a \( -e "${1}" \) ] && cd -- "${1}"; elif [ "${_op}" = cp ]; then log_msg varn "Copying \`${1}' to \`${2}' w/ -pPR."; [ ${#} -ge 2 ] && cp -pPR -- "${@}"; elif [ "${_op}" = ln_symbolic ]; then log_msg varn "Linking \`${1}' to \`${2}' w/ -fs"; - [ \( -n "${1}" \) -a \( -n "${2}" \) ] && ln -fs -- ${1} ${2}; + [ \( -n "${1}" \) -a \( -n "${2}" \) ] && ln -fs -- "${1}" "${2}"; elif [ "${_op}" = mkdir ]\ || [ "${_op}" = rm ]; then while [ ${#} -gt 0 ]; do @@ -53,22 +53,22 @@ install_files() { _ln_target="${1%=*}"; _ln_target="${_ln_target#@}"; _ln_fname="${1#*=}"; - if [ -e ${_ln_fname} ]; then + if [ -e "${_ln_fname}" ]; then if [ ${_verbose:-0} -eq 1 ]; then - echo build_fileop rm ${_ln_fname}; + echo build_fileop rm "${_ln_fname}"; fi; - build_fileop rm ${_ln_fname}; + build_fileop rm "${_ln_fname}"; fi; - build_fileop ln_symbolic ${_ln_target} ${_prefix:+${_prefix}/}${_ln_fname}; + build_fileop ln_symbolic "${_ln_target}" "${_prefix:+${_prefix}/}${_ln_fname}"; ;; /=*) _mkdir_fname="${1#/=}"; - build_fileop mkdir ${_prefix:+${_prefix}/}${_mkdir_fname}; + build_fileop mkdir "${_prefix:+${_prefix}/}${_mkdir_fname}"; ;; *) _file_fname_src="${1%=*}"; _file_fname_dst="${1#*=}"; - build_fileop cp ${_file_fname_src} ${_prefix:+${_prefix}/}${_file_fname_dst}; + build_fileop cp "${_file_fname_src}" "${_prefix:+${_prefix}/}${_file_fname_dst}"; ;; esac; shift; done; @@ -179,9 +179,9 @@ subst_tgts() { while [ ${#} -ge 1 ]; do case "${1}" in devroot) - echo ${DEVROOT_PACKAGES}; ;; - world) echo ${WORLD_PACKAGES}; ;; - *) echo ${1}; ;; + echo "${DEVROOT_PACKAGES}"; ;; + world) echo "${WORLD_PACKAGES}"; ;; + *) echo "${1}"; ;; esac; shift; done; }; diff --git a/vars/build.vars b/vars/build.vars index bf3a7db3..4e9d0e42 100644 --- a/vars/build.vars +++ b/vars/build.vars @@ -115,7 +115,7 @@ HOST_TOOLCHAIN_PREFIX="${PREFIX_CROSS}"; : ${PKG_GCC_STAGE1_CROSS_X86_64_W64_MINGW32_TARGET:=x86_64-w64-mingw32}; : ${PKG_GCC_STAGE1_VERSION:=4.6.4}; : ${PKG_PSXSTUB_URLS_GIT:="psxstub=${GITROOT}/psxstub"}; -: ${PKG_PSXSTUB_BUILD_STEPS:="fetch:main install:main"}; +: ${PKG_PSXSTUB_BUILD_STEPS:="000000:always fetch:main install:main"}; : ${PKG_PSXSTUB_SUBDIR:=psxstub}; : ${PKG_MUSL_NO_COMPLEX_VERSION:=1.1.12}; : ${PKG_GCC_RUNTIME_VERSION:=4.6.4}; |