Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 464762 Details for
Bug 586420
sys-kernel/mips-sources: eblit use violates PMS rules for FILESDIR access
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Unfinished eblit eclass implementation
eblit.eclass (text/plain), 2.97 KB, created by
Joshua Kinard
on 2017-02-23 01:18:19 UTC
(
hide
)
Description:
Unfinished eblit eclass implementation
Filename:
MIME Type:
Creator:
Joshua Kinard
Created:
2017-02-23 01:18:19 UTC
Size:
2.97 KB
patch
obsolete
># Copyright 1999-2016 Gentoo Foundation ># Distributed under the terms of the GNU General Public License v2 ># $Id$ > ># Description: eblit.eclass contains the core functions for creating "eblits". ># eblits are a place to store common code shared among multiple ># ebuilds for a specific package. ># ># Original Eblit Author: Mike Frysinger <vapier@gentoo.org> ># Original Eclass Author: Joshua Kinard <kumba@gentoo.org> ># Maintainer: base-system@gentoo.org > ># Implementation Note: Since code in an eblit is used by multiple ebuilds, ># PLEASE revbump the eblit files when changes are made. Then update each ># ebuild to use the new eblit version. Remove old eblit versions when there ># are no more consumers. This makes it a lot easier to debug problems with ># the shared code within an eblit, as well as the affected ebuilds. > ># To create an eblit: ># 1. Create an "eblits" subdirectory under ${FILESDIR}, if one does not ># already exist. ># 2. Create a new file name using the following formula: ># [a-z0-9_]-v[0-9]+.eblit ># 3. Add the shared code, save, and close the file. ># ># Try to keep eblits specific to the functions they implement. E.g., if a ># number of ebuilds have a large, but common src_unpack() function, and it ># is not already provided by an eclass, then add that code to an eblit named ># "src_unpack-vX.eblit". > ># To load and use eblits: ># 1. Inherit the "eblit" eclass (this class). ># 2. Define a new function called "load_eblit_funcs" in the ebuild immediately ># after the global ebuild variables > > ># eblit-core ># Usage: <function> [version] ># Main eblit engine >eblit-core() { > local e v func=$1 ver=$2 > for v in ${ver:+-}${ver} -${PVR} -${PV} "" ; do > e="${FILESDIR}/eblits/${func}${v}.eblit" > if [[ -e ${e} ]] ; then > . "${e}" > [[ ${func} == pkg_* ]] && eval "${func}() { eblit-run ${func} ${ver} ; }" > return 0 > fi > done > return 1 >} > ># eblit-include ># Usage: [--skip] <function> [version] ># Includes an "eblit" -- a chunk of common code among ebuilds in a given ># package so that its functions can be sourced and utilized within the ># ebuild. >eblit-include() { > local skipable=false r=0 > [[ $1 == "--skip" ]] && skipable=true && shift > [[ $1 == pkg_* ]] && skipable=true > > [[ -z $1 ]] && die "Usage: eblit-include <function> [version]" > eblit-core $1 $2 > r="$?" > ${skipable} && return 0 > [[ "$r" -gt "0" ]] && die "Could not locate requested eblit '$1' in ${FILESDIR}/eblits/" >} > ># eblit-run-maybe ># Usage: <function> ># Runs a function if it is defined in an eblit >eblit-run-maybe() { > [[ $(type -t "$@") == "function" ]] && "$@" >} > ># eblit-run ># Usage: <function> [version] ># Runs a function defined in an eblit >eblit-run() { > eblit-include --skip common "${*:2}" > eblit-include "$@" > eblit-run-maybe eblit-$1-pre > eblit-${PN}-$1 > eblit-run-maybe eblit-$1-post >} > ># eblit-pkg ># Usage: <phase> [version] ># Runs the pkg_* functions AND evals them so they're included in the binpkgs >eblit-pkg() { > [[ -z $1 ]] && die "Usage: eblit-pkg <phase> [version]" > eblit-core pkg_$1 $2 >} >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 586420
:
464762
|
464902
|
467384
|
467386
|
467388