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 907bd3
	local _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 (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 (arab, vxp) 570129
};
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
# vim:filetype=sh