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