midipix / build / midipix_build

Forked from build/midipix_build 4 years ago
Clone

Blame subr/pkg_install.subr

Lucio Andrés Illanes Albornoz (arab, vxp) 570129
#
Lucio Andrés Illanes Albornoz 2b85d0
# set +o errexit -o noglob is assumed.
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
#
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
Lucio Andrés Illanes Albornoz (arab, vxp) f539a4
pkg_install() {
Lucio Andrés Illanes Albornoz 9f1c89
	local _pkglist_name="";
Lucio Andrés Illanes Albornoz c6d6e0
	if ! rtl_fileop mkdir "${PKG_PREFIX}"\
Lucio Andrés Illanes Albornoz 2b85d0
	|| ! find "${PKG_DESTDIR}" -type d -exec chmod 0755 {} \;\
Lucio Andrés Illanes Albornoz 2b85d0
	|| ! find "${PKG_DESTDIR}" \( -not -perm /0111 \) -type f -exec chmod 0644 {} \;\
Lucio Andrés Illanes Albornoz 2b85d0
	|| ! find "${PKG_DESTDIR}" -perm /0111 -type f -exec chmod 0755 {} \;\
Lucio Andrés Illanes Albornoz 2b85d0
	|| ! tar -C "${PKG_DESTDIR}" -cpf - . | tar -C "${PKG_PREFIX}" --overwrite -xpf -; then
Lucio Andrés Illanes Albornoz 2b85d0
		return "${?}";
Lucio Andrés Illanes Albornoz 2b85d0
	else
Lucio Andrés Illanes Albornoz c6d6e0
		if rtl_lmatch "${ARG_DIST}" "pkg" ","; then
Lucio Andrés Illanes Albornoz 2b85d0
			tar -C "${PKG_DESTDIR}" -cpf - . |\
Lucio Andrés Illanes Albornoz 2b85d0
				gzip -c -9 - > "${PKG_BASE_DIR}/${PKG_NAME}.tgz" || return "${?}";
Lucio Andrés Illanes Albornoz 2b85d0
		fi;
Lucio Andrés Illanes Albornoz 2b85d0
		if [ "${PKG_PKGLIST_DISABLE:-0}" -eq 0 ]; then
Lucio Andrés Illanes Albornoz 2b85d0
			if [ ! -e "${PREFIX}/pkglist.${PKG_BUILD_TYPE}" ]; then
Lucio Andrés Illanes Albornoz 2b85d0
				touch "${PREFIX}/pkglist.${PKG_BUILD_TYPE}" || return "${?}";
Lucio Andrés Illanes Albornoz 2b85d0
			fi;
Lucio Andrés Illanes Albornoz 2b85d0
			_pkglist_name="${PKG_BASE_DIR##*/}"; _pkglist_name="${_pkglist_name%%-*}";
Lucio Andrés Illanes Albornoz 2b85d0
			echo "${_pkglist_name}" >> "${PREFIX}/pkglist.${PKG_BUILD_TYPE}" || return "${?}";
Lucio Andrés Illanes Albornoz d02931
		fi;
Lucio Andrés Illanes Albornoz (arab, vxp) 435d7a
	fi;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
};
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
# vim:filetype=sh