summaryrefslogtreecommitdiffhomepage
path: root/subr/pkg_install.subr
diff options
context:
space:
mode:
authorLucio Andrés Illanes Albornoz <lucio@lucioillanes.de>2020-03-01 21:09:37 +0000
committerLucio Andrés Illanes Albornoz <lucio@lucioillanes.de>2020-03-01 21:09:37 +0000
commitbf9edfaed49c4387e181be454602e0cc65fe4382 (patch)
tree2bf582d4f1f0916946bc2285014b193482c52d86 /subr/pkg_install.subr
parent725770754d9f53d5b41d876053a7a993b629472e (diff)
downloadmidipix_build-bf9edfaed49c4387e181be454602e0cc65fe4382.tar.bz2
midipix_build-bf9edfaed49c4387e181be454602e0cc65fe4382.tar.xz
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.
Diffstat (limited to 'subr/pkg_install.subr')
-rw-r--r--subr/pkg_install.subr50
1 files changed, 33 insertions, 17 deletions
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;
};