diff --git a/subr/pkg_install.subr b/subr/pkg_install.subr index a378499..b965a9a 100644 --- a/subr/pkg_install.subr +++ b/subr/pkg_install.subr @@ -2,26 +2,6 @@ # set +o errexit -o noglob -o nounset is assumed. # -pkgp_install_perms() { - local _destdir="${1}" _fname="" IFS; - rtl_set_IFS_nl; - for _fname in $(find "${_destdir}" -type d); do - if ! rtl_fileop chmod 0755 "${_fname}"; then - return 1; - fi; - done; - for _fname in $(find "${_destdir}" \( -not -perm /0111 \) -type f); do - if ! rtl_fileop chmod 0644 "${_fname}"; then - return 1; - fi; - done; - for _fname in $(find "${_destdir}" -perm /0111 -type f); do - if ! rtl_fileop chmod 0755 "${_fname}"; then - return 1; - fi; - done; -}; - pkg_install() { local _destdir="" _destdir_prefix="" _pkglist_name=""; if ! rtl_fileop mkdir "${PKG_PREFIX}"; then @@ -29,7 +9,6 @@ pkg_install() { else for _destdir in "${PKG_DESTDIR}:${PKG_PREFIX}" "${PKG_DESTDIR_HOST}:${PREFIX}"; do rtl_lassign "_destdir _destdir_prefix" ":" "${_destdir}"; if [ -e "${_destdir}" ]; then - pkgp_install_perms "${_destdir}"; (set +o errexit -o noglob; rtl_flock_acquire 4 || exit "${?}"; date; trap "rm -f \"${BUILD_WORKDIR}/install.lock\"" EXIT; if ! tar -C "${_destdir}" -cpf - . | tar -C "${_destdir_prefix}" --overwrite -xpf -; then diff --git a/subr/pkg_install_files.subr b/subr/pkg_install_files.subr index 19c1a15..7bfedb7 100644 --- a/subr/pkg_install_files.subr +++ b/subr/pkg_install_files.subr @@ -10,6 +10,30 @@ pkgp_install_files() { fi; }; +pkgp_install_files_perms() { + local _destdir="" _fname="" IFS; + for _destdir in "${PKG_DESTDIR}" "${PKG_DESTDIR_HOST}"; do + if [ -e "${_destdir}" ]; then + rtl_set_IFS_nl; + for _fname in $(find "${_destdir}" -type d); do + if ! rtl_fileop chmod 0755 "${_fname}"; then + return 1; + fi; + done; + for _fname in $(find "${_destdir}" \( -not -perm /0111 \) -type f); do + if ! rtl_fileop chmod 0644 "${_fname}"; then + return 1; + fi; + done; + for _fname in $(find "${_destdir}" -perm /0111 -type f); do + if ! rtl_fileop chmod 0755 "${_fname}"; then + return 1; + fi; + done; + fi; + done; +}; + pkgp_install_files_pkgconfig() { local _pc_path=""; for _pc_path in $(find "${PKG_DESTDIR}" -name \*.pc); do @@ -44,6 +68,7 @@ pkgp_install_files_strip() { pkg_install_files() { if ! pkgp_install_files\ + || ! pkgp_install_files_perms\ || ! pkgp_install_files_pkgconfig\ || ! pkgp_install_files_strip; then return 1;