diff options
author | Lucía Andrea Illanes Albornoz <lucia@luciaillanes.de> | 2023-02-17 19:29:28 +0100 |
---|---|---|
committer | Lucía Andrea Illanes Albornoz <lucia@luciaillanes.de> | 2023-02-17 19:29:28 +0100 |
commit | e9fa0774ed2e7e030a68f5b0ae51fe6dd69fe492 (patch) | |
tree | 37e46c2578bd8f4f435073db01abc514976da8a8 /dist | |
parent | 56495632fc8bf612766a9c431e37ff27a903e8c6 (diff) | |
download | midipix_build-e9fa0774ed2e7e030a68f5b0ae51fe6dd69fe492.tar.bz2 midipix_build-e9fa0774ed2e7e030a68f5b0ae51fe6dd69fe492.tar.xz |
Make everything a bit faster.
0) Issues several prayers and sacrifices to Enki under threat of a terrible deluge sent down by Ellil
1) Convert fork-write/read exprs to be non-forking
2) Pass mostly everything by reference
3) Don't bother cleaning the variable namespace because Bourne shell is an abomination
4) Removes broken ./pkgtool.sh -s, --restart-at, --update-diff & ./build.sh --dump-{in,on-abort}
5) Cleanup
Diffstat (limited to 'dist')
-rw-r--r-- | dist/dist_gitref.dist | 6 | ||||
-rw-r--r-- | dist/dist_minipix.dist | 23 | ||||
-rw-r--r-- | dist/dist_zipdist.dist | 101 |
3 files changed, 76 insertions, 54 deletions
diff --git a/dist/dist_gitref.dist b/dist/dist_gitref.dist index 4ebd4124..3d8426bc 100644 --- a/dist/dist_gitref.dist +++ b/dist/dist_gitref.dist @@ -3,7 +3,11 @@ # pkg_dist_gitref_all() { - (rtl_fileop cd "${MIDIPIX_BUILD_PWD}" && git rev-parse HEAD > "${PREFIX}/build.gitref"); + local _pdga_group_name="${1}" _pdga_pkg_name="${2}" _pdga_restart_at="${3}"; + + (rtl_fileop cd "${MIDIPIX_BUILD_PWD}" &&\ + git rev-parse HEAD > "${PREFIX}/build.gitref"); + return "${?}"; }; # vim:filetype=sh diff --git a/dist/dist_minipix.dist b/dist/dist_minipix.dist index 86ec026f..fe5acb29 100644 --- a/dist/dist_minipix.dist +++ b/dist/dist_minipix.dist @@ -75,20 +75,25 @@ "}; pkg_dist_minipix_all() { - local _vflag=""; + local _pdma_group_name="${1}" _pdma_pkg_name="${2}" _pdma_restart_at="${3}" \ + _pdma_status="" _pdma_vflag=""; - if rtl_lmatch "${ARG_VERBOSE_TAGS}" "install" ","; then - _vflag="-v"; + if rtl_lmatch \$ARG_VERBOSE_TAGS "install" ","; then + _pdma_vflag="-v"; fi; - if rtl_lmatch "${ARG_DIST}" "minipix" "," \ - && ! rtl_install_v2 \ - -p "_minipix=${PREFIX_MINIPIX##*/}" \ - -p "_minipix_dist=${PREFIX}/minipix_dist" \ - -p "_native=${PREFIX_NATIVE##*/}" \ - ${_vflag} -- "${PREFIX}" \ + + if rtl_lmatch \$ARG_DIST "minipix" "," \ + && ! rtl_install_v2 \ + \$_pdma_status \ + -p "_minipix=${PREFIX_MINIPIX##*/}" \ + -p "_minipix_dist=${PREFIX}/minipix_dist" \ + -p "_native=${PREFIX_NATIVE##*/}" \ + ${_pdma_vflag} -- "${PREFIX}" \ "${PKG_INSTALL_FILES_V2}"; then return 1; fi; + + return 0; }; # vim:filetype=sh diff --git a/dist/dist_zipdist.dist b/dist/dist_zipdist.dist index 1b0c193a..7678c8e2 100644 --- a/dist/dist_zipdist.dist +++ b/dist/dist_zipdist.dist @@ -3,53 +3,66 @@ # pkg_dist_zipdist_all() { - local _dist_fname="" _pkg_name="" _pkglist_fname="${PREFIX}/pkglist.native"; - if rtl_lmatch "${ARG_DIST}" "zipdist" ","; then - echo "msg_pkg dist dist_zipdist ${MSG_zipdist_begin}" >&3; - rtl_log_msg "zipdist" "${MSG_zipdist_begin}"; - for _pkg_name in $(cat "${_pkglist_fname}"); do - if [ ! -e "${BUILD_WORKDIR}/${_pkg_name}-native-${DEFAULT_TARGET}" ]; then - rtl_log_msg "fatalexit" "${MSG_zipdist_missing_pkg_build_dir}" "${_pkg_name}"; - fi; - done; - _dist_fname="${DEFAULT_ZIPDIST_FNAME_PREFIX}${BUILD_USER}@${BUILD_HNAME}-${BUILD_DATE_START}.zip"; - if [ -e "${BUILD_WORKDIR}/zipdist" ]\ - && ! rtl_fileop rm "${BUILD_WORKDIR}/zipdist"; then - return 1; - elif ! rtl_fileop mkdir "${BUILD_WORKDIR}/zipdist"; then - return 1; - elif ! "${BUILD_WORKDIR}/mpackage/mpackage.sh" \ - --defroot="${DEFAULT_ZIPDIST_DEFROOT}" \ - --flysyms \ - --minroot="${PREFIX_MINIPIX}" \ - --objroot="${BUILD_WORKDIR}" \ - --pkgroot="${BUILD_WORKDIR}/zipdist/pkgroot" \ - --product=Midipix \ - --subset="${_pkglist_fname}" \ - --symbols \ - --sysroot="${BUILD_WORKDIR}/zipdist/sysroot" \ - --target="${DEFAULT_TARGET}" \ - --tmproot="${BUILD_WORKDIR}/zipdist/tmproot" \ - --zipfile="${PREFIX}/${_dist_fname}"; then + local _pdza_group_name="${1}" _pdza_pkg_name="${2}" _pdza_restart_at="${3}" \ + _pdza_dist_fname="" _pdza_pkg_name="" _pdza_pkglist_fname="${PREFIX}/pkglist.native"; + + if ! rtl_lmatch \$ARG_DIST "zipdist" ","; then + return 0; + fi; + + echo "msg_pkg dist dist_zipdist ${MSG_zipdist_begin}" >&3; + rtl_log_msg "zipdist" "${MSG_zipdist_begin}"; + + for _pdza_pkg_name in $(cat "${_pdza_pkglist_fname}"); do + if [ ! -e "${BUILD_WORKDIR}/${_pdza_pkg_name}-native-${DEFAULT_TARGET}" ]; then + rtl_log_msg "fatalexit" "${MSG_zipdist_missing_pkg_build_dir}" "${_pdza_pkg_name}"; + fi; + done; + + _pdza_dist_fname="${DEFAULT_ZIPDIST_FNAME_PREFIX}${BUILD_USER}@${BUILD_HNAME}-${BUILD_DATE_START}.zip"; + + if [ -e "${BUILD_WORKDIR}/zipdist" ]\ + && ! rtl_fileop rm "${BUILD_WORKDIR}/zipdist"; then + return 1; + elif ! rtl_fileop mkdir "${BUILD_WORKDIR}/zipdist"; then + return 1; + elif ! "${BUILD_WORKDIR}/mpackage/mpackage.sh" \ + --defroot="${DEFAULT_ZIPDIST_DEFROOT}" \ + --flysyms \ + --minroot="${PREFIX_MINIPIX}" \ + --objroot="${BUILD_WORKDIR}" \ + --pkgroot="${BUILD_WORKDIR}/zipdist/pkgroot" \ + --product=Midipix \ + --subset="${_pdza_pkglist_fname}" \ + --symbols \ + --sysroot="${BUILD_WORKDIR}/zipdist/sysroot" \ + --target="${DEFAULT_TARGET}" \ + --tmproot="${BUILD_WORKDIR}/zipdist/tmproot" \ + --zipfile="${PREFIX}/${_pdza_dist_fname}"; then + return 1; + fi; + + echo "msg_pkg dist dist_zipdist ${MSG_zipdist_finished}" >&3; + rtl_log_msg "zipdist" "${MSG_zipdist_finished}"; + + if [ "${DEFAULT_ZIPDIST_SIGN_GPG_KEY:+}" = 1 ]\ + && command which gpg >/dev/null 2>&1\ + && gpg --list-keys "${DEFAULT_ZIPDIST_SIGN_GPG_KEY}" >/dev/null 2>&1; + then + echo "msg_pkg dist dist_zipdist ${MSG_zipdist_signing}" >&3; + rtl_log_msg "zipdist" "${MSG_zipdist_signing}"; + + if ! gpg --armor --passphrase-file /dev/null \ + --local-user "${DEFAULT_ZIPDIST_SIGN_GPG_KEY}" \ + --sign "${PREFIX}/${_pdza_dist_fname}"; then return 1; - else - echo "msg_pkg dist dist_zipdist ${MSG_zipdist_finished}" >&3; - rtl_log_msg "zipdist" "${MSG_zipdist_finished}"; - if [ -n "${DEFAULT_ZIPDIST_SIGN_GPG_KEY:-}" ]\ - && [ -x "$(which gpg 2>/dev/null)" ]\ - && gpg --list-keys "${DEFAULT_ZIPDIST_SIGN_GPG_KEY}" >/dev/null 2>&1; then - echo "msg_pkg dist dist_zipdist ${MSG_zipdist_signing}" >&3; - rtl_log_msg "zipdist" "${MSG_zipdist_signing}"; - if ! gpg --armor --passphrase-file /dev/null \ - --local-user "${DEFAULT_ZIPDIST_SIGN_GPG_KEY}" \ - --sign "${PREFIX}/${_dist_fname}"; then - return 1; - fi; - echo "msg_pkg dist dist_zipdist ${MSG_zipdist_signed}" >&3; - rtl_log_msg "zipdist" "${MSG_zipdist_signed}"; - fi; fi; + + echo "msg_pkg dist dist_zipdist ${MSG_zipdist_signed}" >&3; + rtl_log_msg "zipdist" "${MSG_zipdist_signed}"; fi; + + return 0; }; # vim:filetype=sh |