commit: e26dd425b928996b0775ee3a01ef73e0edc2a6fb Author: Florian Schmaus <flo <AT> geekplace <DOT> eu> AuthorDate: Tue Jul 21 14:19:55 2020 +0000 Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org> CommitDate: Thu Jul 23 15:55:27 2020 +0000 URL: https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=e26dd425
general-concepts/portage-cache: Update example for conditional inherit The era of "-cvs" ebuilds is long gone (does anyone still remember those?). Instead devmanual should show a contemporary example for conditional eclass inheritance based on git live-ebuilds. Signed-off-by: Florian Schmaus <flo <AT> geekplace.eu> [Slightly simplified example.] Closes: https://bugs.gentoo.org/733428 Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org> general-concepts/portage-cache/text.xml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/general-concepts/portage-cache/text.xml b/general-concepts/portage-cache/text.xml index ba9c0fa..4839fa0 100644 --- a/general-concepts/portage-cache/text.xml +++ b/general-concepts/portage-cache/text.xml @@ -60,17 +60,22 @@ solely upon <c>PN</c> are allowed. <p> As an example of a legal and possibly useful conditional inherit, some eclasses -do: +or ebuilds do: </p> <codesample lang="ebuild"> -if [[ "${PN##*-}" == "cvs" ]] ; then - inherit cvs +if [[ ${PV} == 9999 ]]; then + inherit git-r3 + EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/devmanual.git" +else + SRC_URI="https://dev.gentoo.org/~ulm/distfiles/${P}.tar.xz" + KEYWORDS="~amd64 ~arm ~hppa ~ppc ~ppc64 ~sparc ~x86" fi </codesample> <p> -This allows the same eclass to be used for both regular and <c>-cvs</c> packages. +This allows the same eclass (or the same ebuild "template") to be used for both +regular and live packages. </p> </body> </section>