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) 570129
pkg_extract() {
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) d01c02
		build_fileop rm "${PKG_BASE_DIR}/${PKG_SUBDIR}";
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		if [ "${PKG_FNAME##*.tar.}" = "bz2" ]; then
Lucio Andrés Illanes Albornoz (arab, vxp) d01c02
			bunzip2 -d < "${DLCACHEDIR}/${PKG_FNAME}" | tar -C "${PKG_BASE_DIR}" -xf -;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		elif [ "${PKG_FNAME##*.tar.}" = "gz" ]; then
Lucio Andrés Illanes Albornoz (arab, vxp) d01c02
			gunzip -d < "${DLCACHEDIR}/${PKG_FNAME}" | tar -C "${PKG_BASE_DIR}" -xf -;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		elif [ "${PKG_FNAME##*.tar.}" = "xz" ]; then
Lucio Andrés Illanes Albornoz (arab, vxp) d01c02
			xz -d < "${DLCACHEDIR}/${PKG_FNAME}" | tar -C "${PKG_BASE_DIR}" -xf -;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		elif [ "${PKG_FNAME##*.t}" = "bz2" ]; then
Lucio Andrés Illanes Albornoz (arab, vxp) d01c02
			bunzip2 -d < "${DLCACHEDIR}/${PKG_FNAME}" | tar -C "${PKG_BASE_DIR}" -xf -;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		elif [ "${PKG_FNAME##*.t}" = "gz" ]; then
Lucio Andrés Illanes Albornoz (arab, vxp) d01c02
			gunzip -d < "${DLCACHEDIR}/${PKG_FNAME}" | tar -C "${PKG_BASE_DIR}" -xf -;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		elif [ "${PKG_FNAME##*.t}" = "xz" ]; then
Lucio Andrés Illanes Albornoz (arab, vxp) d01c02
			xz -d < "${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) d01c02
			tar -C "${PKG_BASE_DIR}" -xf "${DLCACHEDIR}/${PKG_FNAME}";
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		fi;
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