From bf9edfaed49c4387e181be454602e0cc65fe4382 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Sun, 1 Mar 2020 21:09:37 +0000 Subject: General cleanup, pt. III. dist/dist_digest.dist: removes obsolete dist file. etc/{build.usage,README.md}: updated. groups/000.host_tools.group:{autoconf,automake,gettext_tiny,install_strip,libtool,m4}_host: moved from groups/010.host_deps.group. groups/221.native_packages_dev.group:lua: moved from groups/231.native_packages_etc.group. groups/221.native_packages_dev.group:lua:${PKG_FORCE_AUTORECONF}: set. groups/231.native_packages_etc.group:{mlogin,tdnf}:${PKG_FORCE_AUTORECONF}: set. groups/241.native_packages_inet.group:nullmailer:${PKG_FORCE_AUTORECONF}: set. groups/251.native_packages_lib.group:lib{asr,gpg_error}:${PKG_FORCE_AUTORECONF}: set. midipix.env, etc/README.md, subr/pkg_configure_autotools.subr: adds FORCE_NO_AUTORECONF. subr/rtl_fileop.subr: adds ch{mod,own} fileops. vars/{check_updates,jamvm,lib{asr,gpg_error},lua,mlogin,tdnf}.vars: removes obsolete vars file. --- subr/pkg_install.subr | 50 +++++++++++++++++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 17 deletions(-) (limited to 'subr/pkg_install.subr') diff --git a/subr/pkg_install.subr b/subr/pkg_install.subr index 87182d9c..4afd0750 100644 --- a/subr/pkg_install.subr +++ b/subr/pkg_install.subr @@ -3,24 +3,40 @@ # pkg_install() { - local _pkglist_name=""; - if ! rtl_fileop mkdir "${PKG_PREFIX}"\ - || ! find "${PKG_DESTDIR}" -type d -exec chmod 0755 {} \;\ - || ! find "${PKG_DESTDIR}" \( -not -perm /0111 \) -type f -exec chmod 0644 {} \;\ - || ! find "${PKG_DESTDIR}" -perm /0111 -type f -exec chmod 0755 {} \;\ - || ! tar -C "${PKG_DESTDIR}" -cpf - . | tar -C "${PKG_PREFIX}" --overwrite -xpf -; then - return "${?}"; - else - if rtl_lmatch "${ARG_DIST}" "pkg" ","; then - tar -C "${PKG_DESTDIR}" -cpf - . |\ - gzip -c -9 - > "${PKG_BASE_DIR}/${PKG_NAME}.tgz" || return "${?}"; - fi; - if [ "${PKG_PKGLIST_DISABLE:-0}" -eq 0 ]; then - if [ ! -e "${PREFIX}/pkglist.${PKG_BUILD_TYPE}" ]; then - touch "${PREFIX}/pkglist.${PKG_BUILD_TYPE}" || return "${?}"; + local _fname="" _ifs_old="${IFS}" _pkglist_name="" IFS; + if ! rtl_fileop mkdir "${PKG_PREFIX}"; then + return 1; + else IFS=" +"; for _fname in $(find "${PKG_DESTDIR}" -type d); do + if ! rtl_fileop chmod 0755 "${_fname}"; then + return 1; + fi; + done; + for _fname in $(find "${PKG_DESTDIR}" \( -not -perm /0111 \) -type f); do + if ! rtl_fileop chmod 0644 "${_fname}"; then + return 1; + fi; + done; + for _fname in $(find "${PKG_DESTDIR}" -perm /0111 -type f); do + if ! rtl_fileop chmod 0755 "${_fname}"; then + return 1; + fi; + done; IFS="${_ifs_old}"; + if ! tar -C "${PKG_DESTDIR}" -cpf - . | tar -C "${PKG_PREFIX}" --overwrite -xpf -; then + return 1; + elif rtl_lmatch "${ARG_DIST}" "pkg" ","\ + && ! tar -C "${PKG_DESTDIR}" -cpf - . | gzip -c -9 - > "${PKG_BASE_DIR}/${PKG_NAME}.tgz"; then + return 1; + elif [ "${PKG_PKGLIST_DISABLE:-0}" -eq 0 ]; then + if [ ! -e "${PREFIX}/pkglist.${PKG_BUILD_TYPE}" ]\ + && ! touch "${PREFIX}/pkglist.${PKG_BUILD_TYPE}"; then + return 1; + else + _pkglist_name="${PKG_BASE_DIR##*/}"; _pkglist_name="${_pkglist_name%%-*}"; + if ! echo "${_pkglist_name}" >> "${PREFIX}/pkglist.${PKG_BUILD_TYPE}"; then + return 1; + fi; fi; - _pkglist_name="${PKG_BASE_DIR##*/}"; _pkglist_name="${_pkglist_name%%-*}"; - echo "${_pkglist_name}" >> "${PREFIX}/pkglist.${PKG_BUILD_TYPE}" || return "${?}"; fi; fi; }; -- cgit v1.2.3