diff options
author | Tim Harder <radhermit@gmail.com> | 2018-01-01 14:46:36 -0500 |
---|---|---|
committer | Tim Harder <radhermit@gmail.com> | 2018-03-24 13:19:01 -0400 |
commit | 8a5c0f7c6065d1f02e5f3cf425656bb9ea04f923 (patch) | |
tree | 916c1e73ccf5dc8ab8bcfa8dbca7295ec9749abd | |
parent | ebd/helpers/common/pkgcore-ebuild-helper: add support for checking cmd pipes (diff) | |
download | pkgcore-8a5c0f7c6065d1f02e5f3cf425656bb9ea04f923.tar.gz pkgcore-8a5c0f7c6065d1f02e5f3cf425656bb9ea04f923.tar.bz2 pkgcore-8a5c0f7c6065d1f02e5f3cf425656bb9ea04f923.zip |
ebd/helpers/common/doexe: use xargs to limit install calls
-rwxr-xr-x | ebd/helpers/common/doexe | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/ebd/helpers/common/doexe b/ebd/helpers/common/doexe index 7ea5ebff..d8146ad9 100755 --- a/ebd/helpers/common/doexe +++ b/ebd/helpers/common/doexe @@ -4,19 +4,26 @@ check_args 1 - -check_command_or_stop install -d "${ED}${PKGCORE_EXEDESTTREE}" +# create tempdir for handling symlinks +TMP=$(mktemp -d "${T}/.${HELPER_NAME}_tmp_XXXXXX") -for x in "$@"; do - if [[ -L ${x} ]]; then - check_command cp -- "${x}" "${T}" || continue - mysrc=${T}/${x##*/} - elif [[ -d ${x} ]]; then - warn "skipping directory ${x}" - continue - else - mysrc=${x} - fi - check_command install ${EXEOPTIONS} -- "${mysrc}" "${ED}${PKGCORE_EXEDESTTREE}" - # cleanup after ourselves... - [[ ${mysrc} != ${x} ]] && rm -f "${mysrc}" -done +exes() { + for x in "$@"; do + if [[ -L ${x} ]]; then + check_command cp -- "${x}" "${TMP}" || continue + echo "${TMP}/${x##*/}" + elif [[ -d ${x} ]]; then + warn "skipping directory ${x}" + continue + else + echo "${x}" + fi + done + return 0 +} + +exes "$@" | ${XARGS} install ${EXEOPTIONS} -D -t "${ED}${PKGCORE_EXEDESTTREE}" -- +check_pipe + +# remove tempdir +rm -rf "${TMP}" |