Blame subr/pkg_fetch_extract.subr

Lucio Andrés Illanes Albornoz (arab, vxp) 570129
#
Lucio Andrés Illanes Albornoz (arab, vxp) 802215
# set -o errexit -o noglob are assumed.
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
#
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
Lucio Andrés Illanes Albornoz (arab, vxp) c27bea
pkg_fetch_extract() {
Lucio Andrés Illanes Albornoz a53c26
	local _chainport_patch_fname="${BUILD_WORKDIR}/chainport/patches/${PKG_NAME%%_*}/${PKG_NAME%%_*}-${PKG_VERSION}.midipix.patch"
Lucio Andrés Illanes Albornoz a53c26
		_chainport_patch_dname="${PKG_BASE_DIR}/${PKG_SUBDIR}/patches/${PKG_NAME%%_*}" _oldpwd="";
Lucio Andrés Illanes Albornoz (arab, vxp) 03a637
	if [ -n "${PKG_URL}" ]\
Lucio Andrés Illanes Albornoz (arab, vxp) 03a637
	&& [ "${PKG_URL_TYPE:-wget}" = wget ]; then
Lucio Andrés Illanes Albornoz (arab, vxp) ec19f0
		_oldpwd="${PWD}"; ex_rtl_fileop cd "${PKG_BASE_DIR}";
Lucio Andrés Illanes Albornoz (arab, vxp) ec19f0
		ex_rtl_fileop rm "${PKG_BASE_DIR}/${PKG_SUBDIR}";
Lucio Andrés Illanes Albornoz (arab, vxp) ec19f0
		if [ "${PKG_FNAME##*.tar.}" = "bz2" ]\
Lucio Andrés Illanes Albornoz (arab, vxp) ec19f0
		|| [ "${PKG_FNAME##*.t}" = "bz2" ]; then
Lucio Andrés Illanes Albornoz (arab, vxp) ec19f0
			bunzip2 -d < "${BUILD_DLCACHEDIR}/${PKG_FNAME}" | tar -C "${PKG_BASE_DIR}" -xf -;
Lucio Andrés Illanes Albornoz (arab, vxp) ec19f0
		elif [ "${PKG_FNAME##*.tar.}" = "gz" ]\
Lucio Andrés Illanes Albornoz (arab, vxp) ec19f0
		|| [ "${PKG_FNAME##*.t}" = "gz" ]; then
Lucio Andrés Illanes Albornoz (arab, vxp) ec19f0
			gunzip -d < "${BUILD_DLCACHEDIR}/${PKG_FNAME}" | tar -C "${PKG_BASE_DIR}" -xf -;
Lucio Andrés Illanes Albornoz 02bd4f
		elif [ "${PKG_FNAME##*.tar.}" = "lz" ]\
Lucio Andrés Illanes Albornoz 02bd4f
		|| [ "${PKG_FNAME##*.t}" = "lz" ]; then
Lucio Andrés Illanes Albornoz 02bd4f
			lzip -d < "${BUILD_DLCACHEDIR}/${PKG_FNAME}" | tar -C "${PKG_BASE_DIR}" -xf -;
Lucio Andrés Illanes Albornoz (arab, vxp) ec19f0
		elif [ "${PKG_FNAME##*.tar.}" = "xz" ]\
Lucio Andrés Illanes Albornoz (arab, vxp) ec19f0
		|| [ "${PKG_FNAME##*.t}" = "xz" ]; then
Lucio Andrés Illanes Albornoz (arab, vxp) ec19f0
			xz -d < "${BUILD_DLCACHEDIR}/${PKG_FNAME}" | tar -C "${PKG_BASE_DIR}" -xf -;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		else
Lucio Andrés Illanes Albornoz (arab, vxp) ec19f0
			tar -C "${PKG_BASE_DIR}" -xf "${BUILD_DLCACHEDIR}/${PKG_FNAME}";
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		fi;
Lucio Andrés Illanes Albornoz (arab, vxp) ec19f0
		ex_rtl_fileop cd "${_oldpwd}";
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
	fi;
Lucio Andrés Illanes Albornoz a53c26
	if [ -e "${_chainport_patch_fname}" ]; then
Lucio Andrés Illanes Albornoz a53c26
		ex_rtl_fileop mkdir "${_chainport_patch_dname}";
Lucio Andrés Illanes Albornoz a53c26
		ex_rtl_fileop cp "${_chainport_patch_fname}" "${_chainport_patch_dname}";
Lucio Andrés Illanes Albornoz a53c26
	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