diff options
author | Lucio Andrés Illanes Albornoz (arab, vxp) <l.illanes@gmx.de> | 2017-02-01 03:09:53 +0100 |
---|---|---|
committer | Lucio Andrés Illanes Albornoz (arab, vxp) <l.illanes@gmx.de> | 2017-02-01 03:09:53 +0100 |
commit | 1548659e9cc2eeffbbd300791f228ae61524c280 (patch) | |
tree | b5c8d203ecde6eba91a9ed33bd5f01323c00e472 | |
parent | 7fa1adbf79cd2757696a2e694f8ce7b935330fbf (diff) | |
download | midipix_build-1548659e9cc2eeffbbd300791f228ae61524c280.tar.bz2 midipix_build-1548659e9cc2eeffbbd300791f228ae61524c280.tar.xz |
build.sh, subr/*: reorganised as subr/{check,mode,pkg,post}_*.subr.
-rwxr-xr-x | build.sh | 9 | ||||
-rw-r--r-- | subr/build.subr | 6 | ||||
-rw-r--r-- | subr/mode_check_updates.subr (renamed from subr/check_updates.subr) | 10 | ||||
-rw-r--r-- | subr/post_copy_etc.subr | 11 | ||||
-rw-r--r-- | subr/post_strip.subr (renamed from subr/strip.subr) | 2 | ||||
-rw-r--r-- | subr/post_tarballs.subr (renamed from subr/tarballs.subr) | 14 |
6 files changed, 30 insertions, 22 deletions
@@ -76,12 +76,12 @@ for BUILD_TARGET_LC in $(subst_tgts ${BUILD_TARGETS_META}); do if [ ${ARG_CHECK_UPDATES:-0} -eq 1 ]\ && [ "${BUILD_PACKAGE#*.*}" = "${BUILD_PACKAGE}" ]; then if [ ${ARG_DRYRUN:-0} -eq 1 ]; then - echo check_pkg_updates "${BUILD_PACKAGE_LC}" \ + echo mode_check_pkg_updates "${BUILD_PACKAGE_LC}" \ "$(get_var_unsafe PKG_${BUILD_PACKAGE}_VERSION)" \ "$(get_var_unsafe PKG_${BUILD_PACKAGE}_URL)" \ "$(get_var_unsafe PKG_${BUILD_PACKAGE}_URL_TYPE)"; else - check_pkg_updates "${BUILD_PACKAGE_LC}" \ + mode_check_pkg_updates "${BUILD_PACKAGE_LC}" \ "$(get_var_unsafe PKG_${BUILD_PACKAGE}_VERSION)" \ "$(get_var_unsafe PKG_${BUILD_PACKAGE}_URL)" \ "$(get_var_unsafe PKG_${BUILD_PACKAGE}_URL_TYPE)"; @@ -147,7 +147,10 @@ for BUILD_TARGET_LC in $(subst_tgts ${BUILD_TARGETS_META}); do break; fi; done; -copy_etc; do_strip; do_tarballs; fini_build_vars; +for __ in copy_etc strip tarballs; do + post_${__}; +done; +fini_build_vars; 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)."; fini_build_progress_file; diff --git a/subr/build.subr b/subr/build.subr index afcad3a1..41cb4d80 100644 --- a/subr/build.subr +++ b/subr/build.subr @@ -63,12 +63,6 @@ clean_prefix() { fi; }; -copy_etc() { - tar -C etc -cpf - midipix.sh README midipix_shortcut.vbs |\ - tar -C ${PREFIX} -xpf -; - chmod +x ${PREFIX}/midipix.sh; -}; - create_dirs() { insecure_mkdir ${PREFIX} ${PREFIX}/x86_64-w64-mingw32 ${PREFIX_NATIVE} ${PREFIX_CROSS} ${PREFIX_TARGET}/lib ${DLCACHEDIR} ${WORKDIR}; for __ in ${PREFIX}/usr ${PREFIX_NATIVE}/usr; do diff --git a/subr/check_updates.subr b/subr/mode_check_updates.subr index e925f891..cc07b67e 100644 --- a/subr/check_updates.subr +++ b/subr/mode_check_updates.subr @@ -3,7 +3,7 @@ # See warning at the top of build.vars. # -cpu_get_fnames() { +modep_cpu_get_fnames() { if test_cmd pkg_${cu_name}_check_updates; then pkg_${cu_name}_check_updates get_fnames; fi; @@ -30,7 +30,7 @@ cpu_get_fnames() { : ${cu_fname_ext:="${cu_fname#${cu_fname_base}-${cu_version}.}"}; }; -cpu_get_version() { +modep_check_cpu_get_version() { unset cu_fname_version; if test_cmd pkg_${cu_name}_check_updates; then pkg_${cu_name}_check_updates get_version; @@ -49,7 +49,7 @@ cpu_get_version() { fi; }; -check_pkg_updates() { +mode_check_pkg_updates() { cu_name="${1}"; cu_version="${2}"; cu_url="${3}"; cu_url_type="${4}"; . vars/check_updates.vars; if match_list "${CHECK_UPDATES_SKIP}" " " "${cu_name}"; then @@ -63,10 +63,10 @@ check_pkg_updates() { return 0; else log_msg vnfo "Checking ${cu_name} v${cu_version} for updates."; - cpu_get_fnames; _cpu_versions=""; + modep_cpu_get_fnames; _cpu_versions=""; fi; for cu_fname in ${cu_fnames}; do - cu_fname="${cu_fname##*/}"; cpu_get_version; + cu_fname="${cu_fname##*/}"; modep_check_cpu_get_version; if [ -z "${cu_fname_version}" ]; then continue; elif ! echo "${cu_fname_version}" | grep -Eq '^[-_.0-9a-zA-Z]+$' \ diff --git a/subr/post_copy_etc.subr b/subr/post_copy_etc.subr new file mode 100644 index 00000000..fe48521b --- /dev/null +++ b/subr/post_copy_etc.subr @@ -0,0 +1,11 @@ +# +# . ./build.vars and set -o errexit -o noglob are assumed. +# + +post_copy_etc() { + tar -C etc -cpf - midipix.sh README midipix_shortcut.vbs |\ + tar -C ${PREFIX} -xpf -; + chmod +x ${PREFIX}/midipix.sh; +}; + +# vim:filetype=sh diff --git a/subr/strip.subr b/subr/post_strip.subr index 64060228..68b8e2e4 100644 --- a/subr/strip.subr +++ b/subr/post_strip.subr @@ -2,7 +2,7 @@ # . ./build.vars and set -o errexit -o noglob are assumed. # -do_strip() { +post_strip() { if [ ${BUILD_SCRIPT_RC:-0} -eq 0 ]\ && [ "${BUILD}" = release ]; then for __ in $(find ${PREFIX_NATIVE}/bin -perm -0100 \( -type f -or -type l \)); do diff --git a/subr/tarballs.subr b/subr/post_tarballs.subr index f0e6e526..12e39401 100644 --- a/subr/tarballs.subr +++ b/subr/post_tarballs.subr @@ -2,7 +2,7 @@ # . ./build.vars and set -o errexit -o noglob are assumed. # -do_tarball_dist() { +postp_tarball_dist() { TARBALL_FNAME=${TARBALL_FNAME_PREFIX}${BUILD_USER}@${BUILD_HNAME}-${BUILD_DATE_START}.tar.${TARBALL_SUFFIX}; tar -cpf - $(find . -maxdepth 2 -mindepth 1 -type d \ -not -path ./${PREFIX_BASENAME} \ @@ -20,7 +20,7 @@ do_tarball_dist() { fi; }; -do_tarball_toolchain() { +postp_tarball_toolchain() { TARBALL_CROSS_FNAME=${TARBALL_CROSS_FNAME_PREFIX}${BUILD_USER}@${BUILD_HNAME}-${BUILD_DATE_START}.tar.${TARBALL_SUFFIX}; tar -cpf - bin include lib lib64 libexec share ${PKG_TARGET} |\ ${TARBALL_COMPRESS_CMD} ${TARBALL_COMPRESS_ARGS} -c > ${TARBALL_CROSS_FNAME}; @@ -33,7 +33,7 @@ do_tarball_toolchain() { fi; }; -do_tarball_minipix() { +postp_tarball_minipix() { TARBALL_MINIPIX_FNAME=${TARBALL_MINIPIX_FNAME_PREFIX}${BUILD_USER}@${BUILD_HNAME}-${BUILD_DATE_START}.tar.${TARBALL_SUFFIX}; tar -cpf - minipix \ midipix_shortcut.vbs midipix.sh README |\ @@ -47,7 +47,7 @@ do_tarball_minipix() { fi; }; -do_tarball_src() { +postp_tarball_src() { TARBALL_SRC_FNAME=${TARBALL_SRC_FNAME_PREFIX}${BUILD_USER}@${BUILD_HNAME}-${BUILD_DATE_START}.tar.${TARBALL_SUFFIX}; log_msg info "Building source tarball..."; tar -cpf - $(find tmp -mindepth 2 -maxdepth 2 \ @@ -65,7 +65,7 @@ do_tarball_src() { fi; }; -do_tarballs() { +post_tarballs() { if [ ${BUILD_SCRIPT_RC:-0} -eq 0 ]\ && [ ${ARG_TARBALL:-0} -eq 1 ]; then log_msg info "Building distribution tarballs..."; @@ -85,9 +85,9 @@ do_tarballs() { *) log_msg failexit "Unknown tarball suffix \`.${TARBALL_SUFFIX}'."; esac; cd ${PREFIX}; PREFIX_BASENAME=${PREFIX_NATIVE##*/}; - do_tarball_dist; do_tarball_toolchain; do_tarball_minipix; + post_tarball_dist; post_tarball_toolchain; post_tarball_minipix; if [ "${BUILD}" = "debug" ]; then - do_tarball_src; + post_tarball_src; fi; fi; }; |