From ca9627e70852f6b2e835660df870fe3ab405882d Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Sun, 1 Sep 2019 00:00:32 +0200 Subject: Initial import --- eclass/g-sorcery.eclass | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 eclass/g-sorcery.eclass (limited to 'eclass/g-sorcery.eclass') 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 +# 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 -- cgit v1.2.3