diff options
Diffstat (limited to 'eclass/g-sorcery.eclass')
-rw-r--r-- | eclass/g-sorcery.eclass | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/eclass/g-sorcery.eclass b/eclass/g-sorcery.eclass new file mode 100644 index 0000000..338dc83 --- /dev/null +++ b/eclass/g-sorcery.eclass @@ -0,0 +1,49 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ +# automatically generated by g-sorcery +# please do not edit this file +# +# Original Author: Jauhien Piatlicki <piatlicki@gmail.com> +# Purpose: base routines for g-sorcery backends' eclasses +# +# Bugs to piatlicki@gmail.com +# +# @ECLASS: g-sorcery.eclass +# +# @ECLASS-VARIABLE: REPO_URI +# @DESCRIPTION: address of a repository with sources +# +# @ECLASS-VARIABLE: DIGEST_SOURCES +# @DESCRIPTION: whether manifest for sources exists +# +# @ECLASS-VARIABLE: SOURCEFILE +# @DESCRIPTION: source file name +# +# @ECLASS-VARIABLE: GSORCERY_STORE_DIR +# @DESCRIPTION: store location for downloaded sources +GSORCERY_STORE_DIR="${PORTAGE_ACTUAL_DISTDIR:-${DISTDIR}}" +# +# @ECLASS-VARIABLE: GSORCERY_FETCH_CMD +# @DESCRIPTION: fetch command +GSORCERY_FETCH_CMD="wget" + +EXPORT_FUNCTIONS src_unpack + +g-sorcery_fetch() { + addwrite "${GSORCERY_STORE_DIR}" + pushd "${GSORCERY_STORE_DIR}" >/dev/null || die "can't chdir to ${GSORCERY_STORE_DIR}" + if [[ ! -f "${SOURCEFILE}" ]]; then + $GSORCERY_FETCH_CMD ${REPO_URI}${SOURCEFILE} || die + fi + popd >/dev/null || die +} + +g-sorcery_src_unpack() { + if [[ x${DIGEST_SOURCES} = x ]]; then + g-sorcery_fetch + fi + + cp ${GSORCERY_STORE_DIR}/${SOURCEFILE} . || die + unpack ./${SOURCEFILE} +}
\ No newline at end of file |