From 4e7360d87ed225a9e760eca32382666b6d395c95 Mon Sep 17 00:00:00 2001 From: Lucio Andrés Illanes Albornoz (arab, vxp) Date: Mar 01 2016 13:11:32 +0000 Subject: - Fix tarball creation procedures and use xz(1) instead of bzip2(1). - Honour $ARG_NO_DOWNLOAD in fetch_git() (reported by daurnimator.) - Fix libressl installation issue (reported by noninc.) --- diff --git a/build.sh b/build.sh index 8cc64b5..26879b1 100755 --- a/build.sh +++ b/build.sh @@ -76,9 +76,13 @@ for BUILD_LVL in 0 1 2 3; do PKG_FNAME=${PKG_URL##*/}; PKG_SUBDIR=${PKG_FNAME%%.tar*}; fi; - BUILD_DEBUG_TARBALL_FNAME=${PREFIX}/midipix-debug-${BUILD_USER}@${BUILD_HNAME}_$(date %Y-%m-%d-%H-%M-%S).tar.bz2; - tar -C ${PREFIX} -cpf - build.log $(cd ${PREFIX} && find ${WORKDIR#${PREFIX}/} -mindepth 1 -maxdepth 1 -type d -iname ${PKG_SUBDIR}-*) |\ - bzip2 -c - > ${BUILD_DEBUG_TARBALL_FNAME}; + BUILD_DEBUG_TARBALL_FNAME=${PREFIX}/midipix-debug-${BUILD_USER}@${BUILD_HNAME}_$(date %Y-%m-%d-%H-%M-%S).tar.xz; + tar -C ${PREFIX} -cJp \ + -f ${BUILD_DEBUG_TARBALL_FNAME} \ + build.log $(cd ${PREFIX} && \ + find ${WORKDIR#${PREFIX}/} \ + -mindepth 1 -maxdepth 1 \ + -type d -iname ${PKG_SUBDIR}-*); log_msg info "Please upload ${BUILD_DEBUG_TARBALL_FNAME} and provide an URL to it in ."; fi; : $((BUILD_NFAIL+=1)); break; ;; @@ -105,10 +109,10 @@ if [ $(( ${BUILD_NFINI} + ${BUILD_NSKIP} )) -ge 0 ] \ -exec sh -c 'DEST=$(readlink -- "${0}") && \ rm -f -- "${0}" && ln -- "${DEST}" "${0}"' {} \;); wait; log_msg info "Converted symbolic links in ${PREFIX_BASENAME}/lib to hard links."; - tar -cpf - $(find . \ - -mindepth 1 -maxdepth 1 -type d \ - $(echo ${TARBALL_EXCLUDE_PATHS} lib | sed 's/\(^\| \)/ -not -path /g')) |\ - bzip2 -9c - > ${TARBALL_FNAME_PREFIX}${BUILD_USER}@${BUILD_HNAME}-${BUILD_DATE_START}${TARBALL_FNAME_SUFFIX}; + TARBALL_FNAME=${TARBALL_FNAME_PREFIX}${BUILD_USER}@${BUILD_HNAME}-${BUILD_DATE_START}.tar.xz; + tar -cJpf ${TARBALL_FNAME} \ + $(find_with_no_paths "${TARBALL_EXCLUDE_PATHS} native/lib.bak" . \ + -mindepth 1 -maxdepth 2 -type d); rm -rf ${PREFIX_BASENAME}/lib; mv ${PREFIX_BASENAME}/lib.bak ${PREFIX_BASENAME}/lib); wait; log_msg info "Finished building distribution tarball."; update_build_status tarball_finish; diff --git a/build.subr b/build.subr index 9899240..4856077 100644 --- a/build.subr +++ b/build.subr @@ -58,11 +58,20 @@ export_vars_subst() { }; fetch_git() { - rm_if_exists ${1}; + [ ${ARG_NO_DOWNLOAD:-0} -eq 0 ] &&\ + rm_if_exists ${1}; [ -d ${1} ] && (cd ${1} && git pull origin main)\ || git clone ${3} ${2} ${1}; }; +find_with_no_paths() { + for _fwnp_not_path in ${1}; do + _fwnp_args="${_fwnp_args:+${_fwnp_args} }-not -path ./${_fwnp_not_path} -not -path ./${_fwnp_not_path}/*"; + done; shift; + set -f; find "${@}" ${_fwnp_args}; _rc=${?}; set +f; + unset _fwnp_args _fwnp_not_path; return ${_rc}; +}; + rm_if_exists() { [ -z "${1#-m}" ] && { _rie_arg_m=1; shift; }; [ -z "${1#-c}" ] && { _rie_arg_c=1; shift; }; diff --git a/build.vars b/build.vars index 45e72bd..712e8b9 100644 --- a/build.vars +++ b/build.vars @@ -14,7 +14,7 @@ : ${BUILD_STATUS_FINISHED_AT_CURRENT_FNAME:=${PREFIX}/BUILD_FINISHED_AT}; : ${BUILD_STATUS_IN_PROGRESS_FNAME:=${PREFIX}/BUILD_IN_PROGRESS}; : ${CFLAGS_DEFAULT:=-g3 -O0}; -: ${CHECK_PREREQ_CMDS:="bzip2 flex git make mktemp openssl patch pkg-config sed sort tar tee tr wget"}; +: ${CHECK_PREREQ_CMDS:="bunzip2 flex git gunzip make mktemp openssl patch pkg-config sed sort tar tee tr wget xz"}; : ${CHECK_PATH_VARS:="PREFIX PREFIX_NATIVE WORKDIR"}; : ${CLEAR_ENV_VARS_EXCEPT:="HOME PATH SHELL TERM USER"}; : ${GITROOT:=git://midipix.org}; @@ -26,7 +26,6 @@ : ${LOG_MSG_SUCC_COLOUR:=92}; : ${MAKEFLAGS_DEFAULT:=-j8}; : ${TARBALL_FNAME_PREFIX:=midipix.}; -: ${TARBALL_FNAME_SUFFIX:=.tar.bz2}; : ${TARBALL_EXCLUDE_PATHS:="src tmp"}; : ${TARGET:=x86_64-nt64-midipix}; : ${PREFIX_NATIVE:=${PREFIX}/native};