From e1a4743914675267e94b3510bea6d8c8c357a32e Mon Sep 17 00:00:00 2001 From: Lucio Andrés Illanes Albornoz Date: May 07 2021 18:51:08 +0000 Subject: vars/autoconf_2_64_host.vars: updated. subr.rtl/rtl_install.subr: implements -* (rm,) !*=* (mv,) m[0-7]{4}= (chmod,) and o*=* (chown.) --- diff --git a/subr.rtl/rtl_install.subr b/subr.rtl/rtl_install.subr index be940cd..db305cd 100644 --- a/subr.rtl/rtl_install.subr +++ b/subr.rtl/rtl_install.subr @@ -3,17 +3,46 @@ # rtl_install() { - local _verbose="" _prefix="" _ln_target="" _ln_fname="" \ - _mkdir_fname="" _file_fname_src="" _file_fname_dst=""; - if [ "${1}" = "-v" ]; then - _verbose=1; shift; - fi; _prefix="${1}"; shift; + local _verbose="" _prefix="" _chmod_mode="" _dname="" _file_fname_dst="" \ + _file_fname_src="" _fname="" _ln_fname="" _ln_target="" _owner_spec="" \ + _pname=""; + [ "${1}" = "-v" ] && { _verbose=1; shift; }; _prefix="${1}"; shift; + while [ ${#} -gt 0 ]; do case "${1}" in + -*) + _pname="${1#-}"; + if [ "${_pname#/}" = "${_pname}" ]; then + _pname="${_prefix:+${_prefix}/}${_pname}"; + fi; + if ! rtl_fileop rm "${_pname}"; then + return 1; + fi; ;; + + !*=*) + _file_fname_src="${1#!}"; _file_fname_src="${_file_fname_src%=*}"; + _file_fname_dst="${1#!}"; _file_fname_dst="${_file_fname_dst#*=}"; + if [ "${_file_fname_src#/}" = "${_file_fname_src}" ]; then + _file_fname_src="${_prefix:+${_prefix}/}${_file_fname_src}"; + fi; + if [ "${_file_fname_dst#/}" = "${_file_fname_dst}" ]; then + _file_fname_dst="${_prefix:+${_prefix}/}${_file_fname_dst}"; + fi; + if ! rtl_fileop mv "${_file_fname_src}" "${_file_fname_dst}"; then + return 1; + fi; ;; + + /=*) + _dname="${1#/=}"; + if [ "${_dname#/}" = "${_dname}" ]; then + _dname="${_prefix:+${_prefix}/}${_dname}"; + fi; + if ! rtl_fileop mkdir "${_dname}"; then + return 1; + fi; ;; + @*=*) - _ln_target="${1%=*}"; - _ln_target="${_ln_target#@}"; - _ln_fname="${1#*=}"; + _ln_target="${1%=*}"; _ln_target="${_ln_target#@}"; _ln_fname="${1#*=}"; if [ "${_ln_fname#/}" = "${_ln_fname}" ]; then _ln_fname="${_prefix:+${_prefix}/}${_ln_fname}"; fi; @@ -22,20 +51,22 @@ rtl_install() { fi; if ! rtl_fileop ln_symbolic "${_ln_target}" "${_ln_fname}"; then return 1; - fi; - ;; - /=*) - _mkdir_fname="${1#/=}"; - if [ "${_mkdir_fname#/}" = "${_mkdir_fname}" ]; then - _mkdir_fname="${_prefix:+${_prefix}/}${_mkdir_fname}"; - fi; - if ! rtl_fileop mkdir "${_mkdir_fname}"; then + fi; ;; + + m[0-7][0-7][0-7][0-7]=*) + _fname="${1#m[0-7][0-7][0-7][0-7]=}"; _chmod_mode="${1%%=*}"; _chmod_mode="${_chmod_mode#m}"; + if ! rtl_fileop chmod "${_chmod_mode}" "${_fname}"; then return 1; - fi; - ;; - *) - _file_fname_src="${1%=*}"; - _file_fname_dst="${1#*=}"; + fi; ;; + + o*=*) + _fname="${1#o*=}"; _owner_spec="${1%%=*}"; _owner_spec="${_owner_spec#o}"; + if ! rtl_fileop chown "${_owner_spec}" "${_fname}"; then + return 1; + fi; ;; + + *=*) + _file_fname_src="${1%=*}"; _file_fname_dst="${1#*=}"; if [ "${_file_fname_src#/}" = "${_file_fname_src}" ]; then _file_fname_src="${_prefix:+${_prefix}/}${_file_fname_src}"; fi; @@ -44,8 +75,7 @@ rtl_install() { fi; if ! rtl_fileop cp "${_file_fname_src}" "${_file_fname_dst}"; then return 1; - fi; - ;; + fi; ;; esac; shift; done; }; diff --git a/vars/autoconf_2_64_host.vars b/vars/autoconf_2_64_host.vars index 35a17bb..31166de 100644 --- a/vars/autoconf_2_64_host.vars +++ b/vars/autoconf_2_64_host.vars @@ -2,14 +2,37 @@ # set +o errexit -o noglob -o nounset is assumed. # -pkg_autoconf_2_64_host_install_make_post() { +: ${PKG_AUTOCONF_2_64_HOST_INSTALL_FILES:=" \ + /=libexec/autoconf-2.64 \ + !bin/autoconf=libexec/autoconf-2.64/ \ + !bin/autoheader=libexec/autoconf-2.64/ \ + !bin/autom4te=libexec/autoconf-2.64/ \ + !bin/autoreconf=libexec/autoconf-2.64/ \ + !bin/autoscan=libexec/autoconf-2.64/ \ + !bin/autoupdate=libexec/autoconf-2.64/ \ + !bin/ifnames=libexec/autoconf-2.64/ \ + !share/autoconf-2.64/autom4te.cfg=share/autoconf/ \ + -share/autoconf-2.64/ \ + !share/autoconf=share/autoconf-2.64/ \ + -share/info/dir \ + !share/info/autoconf.info=share/info/autoconf-2.64.info \ + !share/info/standards.info=share/info/standards-2.64.info \ + !share/man/man1/autoconf.1=share/man/man1/autoconf-2.64.1 \ + !share/man/man1/autoheader.1=share/man/man1/autoheader-2.64.1 \ + !share/man/man1/autom4te.1=share/man/man1/autom4te-2.64.1 \ + !share/man/man1/autoreconf.1=share/man/man1/autoreconf-2.64.1 \ + !share/man/man1/autoscan.1=share/man/man1/autoscan-2.64.1 \ + !share/man/man1/autoupdate.1=share/man/man1/autoupdate-2.64.1 \ + !share/man/man1/config.guess.1=share/man/man1/config.guess-2.64.1 \ + !share/man/man1/config.sub.1=share/man/man1/config.sub-2.64.1 \ + !share/man/man1/ifnames.1=share/man/man1/ifnames-2.64.1 \ +"}; + +pkg_autoconf_2_64_host_install_files_post() { local _bin_fname="" _fname=""; - rtl_fileop mkdir "${PKG_DESTDIR}/libexec/autoconf-${PKG_VERSION}" || return 1; - for _bin_fname in \ - $(find "${PKG_DESTDIR}/bin" -type f -perm /0111); do - rtl_fileop mv "${_bin_fname}" "${PKG_DESTDIR}/libexec/autoconf-${PKG_VERSION}" || return 1; - cat >"${_bin_fname}-${PKG_VERSION}" <"${PKG_DESTDIR}/bin/${_bin_fname##*/}-${PKG_VERSION}" <