Conan_Kudo / build / midipix_build

Forked from build/midipix_build 4 years ago
Clone

Blame subr/pkg_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) 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) bd97b6
		build_fileop rm ${PKG_SUBDIR};
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		if [ ${PKG_SUBDIR_CREATE:-0} -eq 1 ]; then
Lucio Andrés Illanes Albornoz (arab, vxp) bd97b6
			build_fileop mkdir ${PKG_SUBDIR};
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		fi;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		if [ "${PKG_FNAME##*.tar.}" = "bz2" ]; then
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
			bunzip2 -d < ${DLCACHEDIR}/${PKG_FNAME} | tar ${PKG_SUBDIR_CREATE:+-C ${PKG_SUBDIR}} -xf -;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		elif [ "${PKG_FNAME##*.tar.}" = "gz" ]; then
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
			gunzip -d < ${DLCACHEDIR}/${PKG_FNAME} | tar ${PKG_SUBDIR_CREATE:+-C ${PKG_SUBDIR}} -xf -;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		elif [ "${PKG_FNAME##*.tar.}" = "xz" ]; then
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
			xz -d < ${DLCACHEDIR}/${PKG_FNAME} | tar ${PKG_SUBDIR_CREATE:+-C ${PKG_SUBDIR}} -xf -;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		elif [ "${PKG_FNAME##*.t}" = "bz2" ]; then
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
			bunzip2 -d < ${DLCACHEDIR}/${PKG_FNAME} | tar ${PKG_SUBDIR_CREATE:+-C ${PKG_SUBDIR}} -xf -;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		elif [ "${PKG_FNAME##*.t}" = "gz" ]; then
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
			gunzip -d < ${DLCACHEDIR}/${PKG_FNAME} | tar ${PKG_SUBDIR_CREATE:+-C ${PKG_SUBDIR}} -xf -;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		elif [ "${PKG_FNAME##*.t}" = "xz" ]; then
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
			xz -d < ${DLCACHEDIR}/${PKG_FNAME} | tar ${PKG_SUBDIR_CREATE:+-C ${PKG_SUBDIR}} -xf -;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		else
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
			tar ${PKG_SUBDIR_CREATE:+-C ${PKG_SUBDIR}} -xf ${DLCACHEDIR}/${PKG_FNAME};
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		fi;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		if test_cmd pkg_${PKG_NAME}_extract_post; then
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
			pkg_${PKG_NAME}_extract_post;
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