* [gentoo-dev] Standardise the variable for including eclasses only once
@ 2014-07-04 9:26 Ulrich Mueller
2014-07-04 13:14 ` Michał Górny
2014-07-07 14:04 ` [gentoo-dev] " Michael Palimaka
0 siblings, 2 replies; 6+ messages in thread
From: Ulrich Mueller @ 2014-07-04 9:26 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 1129 bytes --]
Hi all,
Several of our eclasses use a mechanism that prevents them from being
inherited more than once. Some eclasses test for a special value [1]:
___ECLASS_ONCE_EUTILS="recur -_+^+_- spank"
while others simply assign 1 and test for a non-empty variable [2]:
_GIT_R3=1
The problem with the name of the former variable is that function and
variable names starting with __ (two underscores) are reserved for
package manager use [3], so the variable should be renamed. We can
take this as an occasion to standardise the variable's name and value.
Since names like _USER or _PAM look a little dangerous, I suggest
_<eclassname>_ECLASS for the variable's name.
I have no strong preference for the variable's value. Is testing for
a non-empty value sufficient? Then we should assign something simple
(like "1"). If not, any string that is sufficiently random (like the
one used in eutils) should be good.
Ulrich
[1] http://thread.gmane.org/gmane.linux.gentoo.devel/74303/focus=74305
[2] http://thread.gmane.org/gmane.linux.gentoo.devel/87922/focus=87928
[3] http://dev.gentoo.org/~ulm/pms/5/pms.html#x1-14300011.3.3.15
[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [gentoo-dev] Standardise the variable for including eclasses only once
2014-07-04 9:26 [gentoo-dev] Standardise the variable for including eclasses only once Ulrich Mueller
@ 2014-07-04 13:14 ` Michał Górny
2014-07-05 18:08 ` Ulrich Mueller
2014-07-07 14:04 ` [gentoo-dev] " Michael Palimaka
1 sibling, 1 reply; 6+ messages in thread
From: Michał Górny @ 2014-07-04 13:14 UTC (permalink / raw
To: Ulrich Mueller; +Cc: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 957 bytes --]
Dnia 2014-07-04, o godz. 11:26:01
Ulrich Mueller <ulm@gentoo.org> napisał(a):
> Since names like _USER or _PAM look a little dangerous, I suggest
> _<eclassname>_ECLASS for the variable's name.
>
> I have no strong preference for the variable's value. Is testing for
> a non-empty value sufficient? Then we should assign something simple
> (like "1"). If not, any string that is sufficiently random (like the
> one used in eutils) should be good.
I'd rather go for simple value and simple test. Exact tests with weird
names are more prone to mistakes, and this is not something you usually
test.
While at it, I would also like to ask all eclasses to keep
EXPORT_FUNCTIONS *outside* the ifs to keep the exports consistent with
inherits. Otherwise, indirect inheritance influences effectively
exported phase functions and changes in 'inherit' order may affect
exported functions seemingly randomly.
--
Best regards,
Michał Górny
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 949 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [gentoo-dev] Standardise the variable for including eclasses only once
2014-07-04 13:14 ` Michał Górny
@ 2014-07-05 18:08 ` Ulrich Mueller
2014-07-11 8:22 ` Ulrich Mueller
0 siblings, 1 reply; 6+ messages in thread
From: Ulrich Mueller @ 2014-07-05 18:08 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 22755 bytes --]
>>>>> On Fri, 4 Jul 2014, Michał Górny wrote:
>> Since names like _USER or _PAM look a little dangerous, I suggest
>> _<eclassname>_ECLASS for the variable's name.
>>
>> I have no strong preference for the variable's value. Is testing
>> for a non-empty value sufficient? Then we should assign something
>> simple (like "1"). If not, any string that is sufficiently random
>> (like the one used in eutils) should be good.
> I'd rather go for simple value and simple test. Exact tests with
> weird names are more prone to mistakes, and this is not something
> you usually test.
I don't see any different opinions. The patch included below renames
all variables whose name starts with two underscores.
Please review.
Ulrich
--- autotools.eclass 1 Mar 2014 11:51:08 -0000 1.161
+++ autotools.eclass 5 Jul 2014 17:23:09 -0000
@@ -13,8 +13,8 @@
# Note: We require GNU m4, as does autoconf. So feel free to use any features
# from the GNU version of m4 without worrying about other variants (i.e. BSD).
-if [[ ${___ECLASS_ONCE_AUTOTOOLS} != "recur -_+^+_- spank" ]] ; then
-___ECLASS_ONCE_AUTOTOOLS="recur -_+^+_- spank"
+if [[ -z ${_AUTOTOOLS_ECLASS} ]]; then
+_AUTOTOOLS_ECLASS=1
inherit libtool multiprocessing
--- base.eclass 27 Sep 2012 16:35:41 -0000 1.58
+++ base.eclass 5 Jul 2014 17:23:09 -0000
@@ -1,4 +1,4 @@
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/eclass/base.eclass,v 1.58 2012/09/27 16:35:41 axs Exp $
@@ -11,8 +11,8 @@
# @DESCRIPTION:
# The base eclass defines some default functions and variables.
-if [[ ${___ECLASS_ONCE_BASE} != "recur -_+^+_- spank" ]] ; then
-___ECLASS_ONCE_BASE="recur -_+^+_- spank"
+if [[ -z ${_BASE_ECLASS} ]]; then
+_BASE_ECLASS=1
inherit eutils
--- cdrom.eclass 18 Jan 2012 12:42:06 -0000 1.5
+++ cdrom.eclass 5 Jul 2014 17:23:09 -0000
@@ -1,4 +1,4 @@
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/eclass/cdrom.eclass,v 1.5 2012/01/18 12:42:06 vapier Exp $
@@ -15,8 +15,8 @@
# and when the function returns, you can assume that the cd has been
# found at CDROM_ROOT.
-if [[ -z ${___ECLASS_ONCE_CDROM} ]]; then
-___ECLASS_ONCE_CDROM=1
+if [[ -z ${_CDROM_ECLASS} ]]; then
+_CDROM_ECLASS=1
inherit portability
--- cmake-utils.eclass 6 May 2014 15:29:02 -0000 1.107
+++ cmake-utils.eclass 5 Jul 2014 17:23:10 -0000
@@ -17,8 +17,8 @@
# builds (default), in-source builds and an implementation of the well-known use_enable
# and use_with functions for CMake.
-if [[ ${___ECLASS_ONCE_CMAKE_UTILS} != "recur -_+^+_- spank" ]] ; then
-___ECLASS_ONCE_CMAKE_UTILS="recur -_+^+_- spank"
+if [[ -z ${_CMAKE_UTILS_ECLASS} ]]; then
+_CMAKE_UTILS_ECLASS=1
# @ECLASS-VARIABLE: WANT_CMAKE
# @DESCRIPTION:
--- cvs.eclass 28 Sep 2013 16:22:29 -0000 1.83
+++ cvs.eclass 5 Jul 2014 17:23:10 -0000
@@ -1,4 +1,4 @@
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/eclass/cvs.eclass,v 1.83 2013/09/28 16:22:29 ottxor Exp $
@@ -13,8 +13,8 @@
# cvs_src_unpack. If you find that you need to call the cvs_* functions
# directly, I'd be interested to hear about it.
-if [[ ${___ECLASS_ONCE_CVS} != "recur -_+^+_- spank" ]] ; then
-___ECLASS_ONCE_CVS="recur -_+^+_- spank"
+if [[ -z ${_CVS_ECLASS} ]]; then
+_CVS_ECLASS=1
inherit eutils
--- enlightenment.eclass 12 Oct 2013 15:30:23 -0000 1.105
+++ enlightenment.eclass 5 Jul 2014 17:23:10 -0000
@@ -1,4 +1,4 @@
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/eclass/enlightenment.eclass,v 1.105 2013/10/12 15:30:23 aballier Exp $
@@ -7,8 +7,8 @@
# enlightenment@gentoo.org
# @BLURB: simplify enlightenment package management
-if [[ ${___ECLASS_ONCE_ENLIGHTENMENT} != "recur -_+^+_- spank" ]] ; then
-___ECLASS_ONCE_ENLIGHTENMENT="recur -_+^+_- spank"
+if [[ -z ${_ENLIGHTENMENT_ECLASS} ]]; then
+_ENLIGHTENMENT_ECLASS=1
inherit eutils libtool
--- eutils.eclass 4 Jul 2014 08:01:51 -0000 1.435
+++ eutils.eclass 5 Jul 2014 17:23:11 -0000
@@ -1,4 +1,4 @@
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.435 2014/07/04 08:01:51 ulm Exp $
@@ -15,8 +15,8 @@
# Due to the nature of this eclass, some functions may have maintainers
# different from the overall eclass!
-if [[ ${___ECLASS_ONCE_EUTILS} != "recur -_+^+_- spank" ]] ; then
-___ECLASS_ONCE_EUTILS="recur -_+^+_- spank"
+if [[ -z ${_EUTILS_ECLASS} ]]; then
+_EUTILS_ECLASS=1
inherit multilib toolchain-funcs
@@ -114,7 +114,7 @@
# @CODE
estack_push() {
[[ $# -eq 0 ]] && die "estack_push: incorrect # of arguments"
- local stack_name="__ESTACK_$1__" ; shift
+ local stack_name="_ESTACK_$1_" ; shift
eval ${stack_name}+=\( \"\$@\" \)
}
@@ -127,23 +127,23 @@
estack_pop() {
[[ $# -eq 0 || $# -gt 2 ]] && die "estack_pop: incorrect # of arguments"
- # We use the fugly __estack_xxx var names to avoid collision with
+ # We use the fugly _estack_xxx var names to avoid collision with
# passing back the return value. If we used "local i" and the
# caller ran `estack_pop ... i`, we'd end up setting the local
- # copy of "i" rather than the caller's copy. The __estack_xxx
+ # copy of "i" rather than the caller's copy. The _estack_xxx
# garbage is preferable to using $1/$2 everywhere as that is a
# bit harder to read.
- local __estack_name="__ESTACK_$1__" ; shift
- local __estack_retvar=$1 ; shift
- eval local __estack_i=\${#${__estack_name}\[@\]}
+ local _estack_name="_ESTACK_$1_" ; shift
+ local _estack_retvar=$1 ; shift
+ eval local _estack_i=\${#${_estack_name}\[@\]}
# Don't warn -- let the caller interpret this as a failure
# or as normal behavior (akin to `shift`)
- [[ $(( --__estack_i )) -eq -1 ]] && return 1
+ [[ $(( --_estack_i )) -eq -1 ]] && return 1
- if [[ -n ${__estack_retvar} ]] ; then
- eval ${__estack_retvar}=\"\${${__estack_name}\[${__estack_i}\]}\"
+ if [[ -n ${_estack_retvar} ]] ; then
+ eval ${_estack_retvar}=\"\${${_estack_name}\[${_estack_i}\]}\"
fi
- eval unset ${__estack_name}\[${__estack_i}\]
+ eval unset ${_estack_name}\[${_estack_i}\]
}
# @FUNCTION: evar_push
@@ -174,7 +174,7 @@
for var ; do
[[ ${!var+set} == "set" ]] \
&& val=${!var} \
- || val="${___ECLASS_ONCE_EUTILS}"
+ || val="unset_3842dbba1e279bf4dff664ea0f3483f4675af6c5"
estack_push evar "${var}" "${val}"
done
}
@@ -211,7 +211,7 @@
while (( cnt-- )) ; do
estack_pop evar val || die "${FUNCNAME}: unbalanced push"
estack_pop evar var || die "${FUNCNAME}: unbalanced push"
- [[ ${val} == "${___ECLASS_ONCE_EUTILS}" ]] \
+ [[ ${val} == "unset_3842dbba1e279bf4dff664ea0f3483f4675af6c5" ]] \
&& unset ${var} \
|| printf -v "${var}" '%s' "${val}"
done
--- fcaps.eclass 27 Jun 2013 01:18:57 -0000 1.8
+++ fcaps.eclass 5 Jul 2014 17:23:12 -0000
@@ -1,4 +1,4 @@
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/eclass/fcaps.eclass,v 1.8 2013/06/27 01:18:57 vapier Exp $
@@ -28,8 +28,8 @@
# )
# @CODE
-if [[ ${___ECLASS_ONCE_FCAPS} != "recur -_+^+_- spank" ]] ; then
-___ECLASS_ONCE_FCAPS="recur -_+^+_- spank"
+if [[ -z ${_FCAPS_ECLASS} ]]; then
+_FCAPS_ECLASS=1
IUSE="+filecaps"
@@ -182,8 +182,8 @@
continue 2
fi
done
- if [[ ${notfound} -eq 2 ]] && [[ -z ${__FCAPS_WARNED} ]] ; then
- __FCAPS_WARNED="true"
+ if [[ ${notfound} -eq 2 ]] && [[ -z ${_FCAPS_WARNED} ]] ; then
+ _FCAPS_WARNED="true"
ewarn "Could not find cap utils; make sure libcap or libcap-ng is available."
fi
fi
--- fixheadtails.eclass 22 Aug 2011 04:46:31 -0000 1.12
+++ fixheadtails.eclass 5 Jul 2014 17:23:12 -0000
@@ -1,4 +1,4 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/eclass/fixheadtails.eclass,v 1.12 2011/08/22 04:46:31 vapier Exp $
@@ -11,7 +11,7 @@
DEPEND=">=sys-apps/sed-4"
-__do_sed_fix() {
+_do_sed_fix() {
einfo " - fixed $1"
sed -i \
-e 's/head \+-\([0-9]\)/head -n \1/g' \
@@ -28,7 +28,7 @@
local i
einfo "Replacing obsolete head/tail with POSIX compliant ones"
for i in "$@" ; do
- __do_sed_fix "$i"
+ _do_sed_fix "$i"
done
}
--- flag-o-matic.eclass 4 Jul 2014 08:01:51 -0000 1.200
+++ flag-o-matic.eclass 5 Jul 2014 17:23:12 -0000
@@ -10,8 +10,8 @@
# This eclass contains a suite of functions to help developers sanely
# and safely manage toolchain flags in their builds.
-if [[ ${___ECLASS_ONCE_FLAG_O_MATIC} != "recur -_+^+_- spank" ]] ; then
-___ECLASS_ONCE_FLAG_O_MATIC="recur -_+^+_- spank"
+if [[ -z ${_FLAG_O_MATIC_ECLASS} ]]; then
+_FLAG_O_MATIC_ECLASS=1
inherit eutils toolchain-funcs multilib
--- games.eclass 12 Mar 2014 18:54:12 -0000 1.157
+++ games.eclass 5 Jul 2014 17:23:12 -0000
@@ -8,8 +8,8 @@
# you better have a *good* reason why you're *not* using games.eclass
# in a games-* ebuild
-if [[ ${___ECLASS_ONCE_GAMES} != "recur -_+^+_- spank" ]] ; then
-___ECLASS_ONCE_GAMES="recur -_+^+_- spank"
+if [[ -z ${_GAMES_ECLASS} ]]; then
+_GAMES_ECLASS=1
inherit base multilib toolchain-funcs eutils user
--- kde4-base.eclass 4 Jul 2014 08:01:51 -0000 1.137
+++ kde4-base.eclass 5 Jul 2014 17:23:13 -0000
@@ -13,8 +13,8 @@
# NOTE: KDE 4 ebuilds currently support EAPIs 4 and 5. This will be
# reviewed over time as new EAPI versions are approved.
-if [[ ${___ECLASS_ONCE_KDE4_BASE} != "recur -_+^+_- spank" ]] ; then
-___ECLASS_ONCE_KDE4_BASE="recur -_+^+_- spank"
+if [[ -z ${_KDE4_BASE_ECLASS} ]]; then
+_KDE4_BASE_ECLASS=1
# @ECLASS-VARIABLE: KDE_SELINUX_MODULE
# @DESCRIPTION:
--- kde4-functions.eclass 4 Jul 2014 08:01:51 -0000 1.69
+++ kde4-functions.eclass 5 Jul 2014 17:23:13 -0000
@@ -12,8 +12,8 @@
# This eclass contains all functions shared by the different eclasses,
# for KDE 4 ebuilds.
-if [[ ${___ECLASS_ONCE_KDE4_FUNCTIONS} != "recur -_+^+_- spank" ]] ; then
-___ECLASS_ONCE_KDE4_FUNCTIONS="recur -_+^+_- spank"
+if [[ -z ${_KDE4_FUNCTIONS_ECLASS} ]]; then
+_KDE4_FUNCTIONS_ECLASS=1
# @ECLASS-VARIABLE: EAPI
# @DESCRIPTION:
--- kde4-meta-pkg.eclass 7 Apr 2013 17:33:18 -0000 1.12
+++ kde4-meta-pkg.eclass 5 Jul 2014 17:23:13 -0000
@@ -1,4 +1,4 @@
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-meta-pkg.eclass,v 1.12 2013/04/07 17:33:18 kensington Exp $
@@ -9,8 +9,8 @@
# @DESCRIPTION:
# This eclass should only be used for defining meta packages for KDE4.
-if [[ ${___ECLASS_ONCE_KDE4_META_PKG} != "recur -_+^+_- spank" ]] ; then
-___ECLASS_ONCE_KDE4_META_PKG="recur -_+^+_- spank"
+if [[ -z ${_KDE4_META_PKG_ECLASS} ]]; then
+_KDE4_META_PKG_ECLASS=1
inherit kde4-functions
--- kde4-meta.eclass 17 Apr 2014 18:16:54 -0000 1.76
+++ kde4-meta.eclass 5 Jul 2014 17:23:13 -0000
@@ -12,8 +12,8 @@
# You must define KMNAME to use this eclass, and do so before inheriting it. All other variables are optional.
# Do not include the same item in more than one of KMMODULE, KMMEXTRA, KMCOMPILEONLY, KMEXTRACTONLY.
-if [[ ${___ECLASS_ONCE_KDE4_META} != "recur -_+^+_- spank" ]] ; then
-___ECLASS_ONCE_KDE4_META="recur -_+^+_- spank"
+if [[ -z ${_KDE4_META_ECLASS} ]]; then
+_KDE4_META_ECLASS=1
[[ -z ${KMNAME} ]] && die "kde4-meta.eclass inherited but KMNAME not defined - broken ebuild"
@@ -167,7 +167,7 @@
|| die "${escm}: can't export cmake files to '${S}'."
fi
# Copy all subdirectories
- for subdir in $(__list_needed_subdirectories); do
+ for subdir in $(_list_needed_subdirectories); do
targetdir=""
if [[ $subdir = doc/* && ! -e "$wc_path/$subdir" ]]; then
continue
@@ -196,7 +196,7 @@
tarfile="${DISTDIR}/${tarball}"
# Detect real toplevel dir from tarball name - it will be used upon extraction
- # and in __list_needed_subdirectories
+ # and in _list_needed_subdirectories
topdir="${tarball%.tar.*}/"
ebegin "Unpacking parts of ${tarball} to ${WORKDIR}"
@@ -207,7 +207,7 @@
do
extractlist+=" ${topdir}${f}"
done
- extractlist+=" $(__list_needed_subdirectories)"
+ extractlist+=" $(_list_needed_subdirectories)"
pushd "${WORKDIR}" > /dev/null
@@ -228,7 +228,7 @@
eend $?
if [[ -n ${KDE4_STRICTER} ]]; then
- for f in $(__list_needed_subdirectories fatal); do
+ for f in $(_list_needed_subdirectories fatal); do
if [[ ! -e ${S}/${f#*/} ]]; then
eerror "'${f#*/}' is missing"
abort=true
@@ -311,7 +311,7 @@
debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME}: KMEXTRACTONLY ${KMEXTRACTONLY}"
}
-__list_needed_subdirectories() {
+_list_needed_subdirectories() {
local i j kmextra kmextra_expanded kmmodule_expanded kmcompileonly_expanded extractlist
# We expand KMEXTRA by adding CMakeLists.txt files
--- libtool.eclass 12 Jun 2014 07:14:25 -0000 1.111
+++ libtool.eclass 5 Jul 2014 17:23:14 -0000
@@ -14,8 +14,8 @@
# generated libtool files. We do not run the libtoolize program because that
# requires a regeneration of the main autotool files in order to work properly.
-if [[ ${___ECLASS_ONCE_LIBTOOL} != "recur -_+^+_- spank" ]] ; then
-___ECLASS_ONCE_LIBTOOL="recur -_+^+_- spank"
+if [[ -z ${_LIBTOOL_ECLASS} ]]; then
+_LIBTOOL_ECLASS=1
# If an overlay has eclass overrides, but doesn't actually override the
# libtool.eclass, we'll have ECLASSDIR pointing to the active overlay's
@@ -43,8 +43,8 @@
local disp="${src} patch"
local log="${T}/elibtool.log"
- if [[ -z ${__ELT_NOTED_TMP} ]] ; then
- __ELT_NOTED_TMP=true
+ if [[ -z ${_ELT_NOTED_TMP} ]] ; then
+ _ELT_NOTED_TMP=true
printf 'temp patch: %s\n' "${patch}" > "${log}"
fi
printf '\nTrying %s\n' "${disp}" >> "${log}"
--- multilib.eclass 17 Jan 2014 07:44:45 -0000 1.105
+++ multilib.eclass 5 Jul 2014 17:23:14 -0000
@@ -1,4 +1,4 @@
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/eclass/multilib.eclass,v 1.105 2014/01/17 07:44:45 vapier Exp $
@@ -10,8 +10,8 @@
# @DESCRIPTION:
# This eclass is for all functions pertaining to handling multilib configurations.
-if [[ ${___ECLASS_ONCE_MULTILIB} != "recur -_+^+_- spank" ]] ; then
-___ECLASS_ONCE_MULTILIB="recur -_+^+_- spank"
+if [[ -z ${_MULTILIB_ECLASS} ]]; then
+_MULTILIB_ECLASS=1
inherit toolchain-funcs
@@ -414,13 +414,13 @@
export ABI=$1
# First restore any saved state we have laying around.
- if [[ ${__DEFAULT_ABI_SAVED} == "true" ]] ; then
+ if [[ ${_DEFAULT_ABI_SAVED} == "true" ]] ; then
for v in CHOST CBUILD AS CC CXX LD PKG_CONFIG_{LIBDIR,PATH} ; do
- vv="__abi_saved_${v}"
+ vv="_abi_saved_${v}"
[[ ${!vv+set} == "set" ]] && export ${v}="${!vv}" || unset ${v}
unset ${vv}
done
- unset __DEFAULT_ABI_SAVED
+ unset _DEFAULT_ABI_SAVED
fi
# We want to avoid the behind-the-back magic of gcc-config as it
@@ -428,10 +428,10 @@
if [[ ${ABI} != ${DEFAULT_ABI} ]] ; then
# Back that multilib-ass up so we can restore it later
for v in CHOST CBUILD AS CC CXX LD PKG_CONFIG_{LIBDIR,PATH} ; do
- vv="__abi_saved_${v}"
+ vv="_abi_saved_${v}"
[[ ${!v+set} == "set" ]] && export ${vv}="${!v}" || unset ${vv}
done
- export __DEFAULT_ABI_SAVED="true"
+ export _DEFAULT_ABI_SAVED="true"
# Set the CHOST native first so that we pick up the native
# toolchain and not a cross-compiler by accident #202811.
--- multiprocessing.eclass 21 Dec 2013 09:40:37 -0000 1.8
+++ multiprocessing.eclass 5 Jul 2014 17:23:14 -0000
@@ -1,4 +1,4 @@
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/eclass/multiprocessing.eclass,v 1.8 2013/12/21 09:40:37 vapier Exp $
@@ -33,8 +33,8 @@
# multijob_finish
# @CODE
-if [[ ${___ECLASS_ONCE_MULTIPROCESSING} != "recur -_+^+_- spank" ]] ; then
-___ECLASS_ONCE_MULTIPROCESSING="recur -_+^+_- spank"
+if [[ -z ${_MULTIPROCESSING_ECLASS} ]]; then
+_MULTIPROCESSING_ECLASS=1
# @FUNCTION: bashpid
# @DESCRIPTION:
--- pam.eclass 5 Aug 2012 15:34:20 -0000 1.23
+++ pam.eclass 5 Jul 2014 17:23:14 -0000
@@ -1,4 +1,4 @@
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License, v2 or later
# $Header: /var/cvsroot/gentoo-x86/eclass/pam.eclass,v 1.23 2012/08/05 15:34:20 jlec Exp $
#
@@ -13,8 +13,8 @@
# This eclass contains functions to install pamd configuration files and
# pam modules.
-if [[ ${___ECLASS_ONCE_PAM} != "recur -_+^+_- spank" ]] ; then
-___ECLASS_ONCE_PAM="recur -_+^+_- spank"
+if [[ -z ${_PAM_ECLASS} ]]; then
+_PAM_ECLASS=1
inherit flag-o-matic multilib
--- pax-utils.eclass 18 May 2013 13:43:20 -0000 1.21
+++ pax-utils.eclass 5 Jul 2014 17:23:15 -0000
@@ -1,4 +1,4 @@
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/eclass/pax-utils.eclass,v 1.21 2013/05/18 13:43:20 zorry Exp $
@@ -22,8 +22,8 @@
# to contain either "PT", "XT" or "none". The default is to attempt both
# PT_PAX and XATTR_PAX.
-if [[ ${___ECLASS_ONCE_PAX_UTILS} != "recur -_+^+_- spank" ]] ; then
-___ECLASS_ONCE_PAX_UTILS="recur -_+^+_- spank"
+if [[ -z ${_PAX_UTILS_ECLASS} ]]; then
+_PAX_UTILS_ECLASS=1
# @ECLASS-VARIABLE: PAX_MARKINGS
# @DESCRIPTION:
--- portability.eclass 28 May 2014 09:48:01 -0000 1.25
+++ portability.eclass 5 Jul 2014 17:23:15 -0000
@@ -9,8 +9,8 @@
# Diego Pettenò <flameeyes@gentoo.org>
# @BLURB: This eclass is created to avoid using non-portable GNUisms inside ebuilds
-if [[ ${___ECLASS_ONCE_PORTABILITY} != "recur -_+^+_- spank" ]] ; then
-___ECLASS_ONCE_PORTABILITY="recur -_+^+_- spank"
+if [[ -z ${_PORTABILITY_ECLASS} ]]; then
+_PORTABILITY_ECLASS=1
# @FUNCTION: treecopy
# @USAGE: <orig1> [orig2 orig3 ....] <dest>
--- qmake-utils.eclass 2 Dec 2013 09:42:38 -0000 1.1
+++ qmake-utils.eclass 5 Jul 2014 17:23:15 -0000
@@ -1,4 +1,4 @@
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/eclass/qmake-utils.eclass,v 1.1 2013/12/02 09:42:38 pinkbyte Exp $
@@ -11,8 +11,8 @@
# @DESCRIPTION:
# Utility eclass providing wrapper functions for Qt4 and Qt5 qmake.
-if [[ ${___ECLASS_ONCE_QMAKE_UTILS} != "recur -_+^+_- spank" ]]; then
-___ECLASS_ONCE_QMAKE_UTILS="recur -_+^+_- spank"
+if [[ -z ${_QMAKE_UTILS_ECLASS} ]]; then
+_QMAKE_UTILS_ECLASS=1
inherit eutils multilib toolchain-funcs
--- readme.gentoo.eclass 2 Jul 2014 13:32:48 -0000 1.11
+++ readme.gentoo.eclass 5 Jul 2014 17:23:15 -0000
@@ -15,8 +15,8 @@
# shown at first package installation and a file for later reviewing will be
# installed under /usr/share/doc/${PF}
-if [[ ${___ECLASS_ONCE_README_GENTOO} != "recur -_+^+_- spank" ]] ; then
-___ECLASS_ONCE_README_GENTOO="recur -_+^+_- spank"
+if [[ -z ${_README_GENTOO_ECLASS} ]]; then
+_README_GENTOO_ECLASS=1
inherit eutils
--- toolchain-funcs.eclass 17 Jan 2014 03:46:31 -0000 1.126
+++ toolchain-funcs.eclass 5 Jul 2014 17:23:16 -0000
@@ -13,8 +13,8 @@
# in such a way that you can rely on the function always returning
# something sane.
-if [[ ${___ECLASS_ONCE_TOOLCHAIN_FUNCS} != "recur -_+^+_- spank" ]] ; then
-___ECLASS_ONCE_TOOLCHAIN_FUNCS="recur -_+^+_- spank"
+if [[ -z ${_TOOLCHAIN_FUNCS_ECLASS} ]]; then
+_TOOLCHAIN_FUNCS_ECLASS=1
inherit multilib
--- unpacker.eclass 1 May 2014 19:27:14 -0000 1.17
+++ unpacker.eclass 5 Jul 2014 17:23:16 -0000
@@ -15,8 +15,8 @@
# - merge rpm unpacking
# - support partial unpacks?
-if [[ ${___ECLASS_ONCE_UNPACKER} != "recur -_+^+_- spank" ]] ; then
-___ECLASS_ONCE_UNPACKER="recur -_+^+_- spank"
+if [[ -z ${_UNPACKER_ECLASS} ]]; then
+_UNPACKER_ECLASS=1
# @ECLASS-VARIABLE: UNPACKER_BZ2
# @DEFAULT_UNSET
--- user.eclass 4 Jul 2014 08:01:51 -0000 1.23
+++ user.eclass 5 Jul 2014 17:23:16 -0000
@@ -1,4 +1,4 @@
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/eclass/user.eclass,v 1.23 2014/07/04 08:01:51 ulm Exp $
@@ -13,8 +13,8 @@
# The user eclass contains a suite of functions that allow ebuilds
# to quickly make sure users in the installed system are sane.
-if [[ ${___ECLASS_ONCE_USER} != "recur -_+^+_- spank" ]] ; then
-___ECLASS_ONCE_USER="recur -_+^+_- spank"
+if [[ -z ${_USER_ECLASS} ]]; then
+_USER_ECLASS=1
# @FUNCTION: _assert_pkg_ebuild_phase
# @INTERNAL
--- versionator.eclass 23 Nov 2013 04:35:16 -0000 1.24
+++ versionator.eclass 5 Jul 2014 17:23:16 -0000
@@ -1,4 +1,4 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/eclass/versionator.eclass,v 1.24 2013/11/23 04:35:16 jcallen Exp $
@@ -26,8 +26,8 @@
# version_is_at_least want have
# which may be buggy, so use with caution.
-if [[ ${___ECLASS_ONCE_VERSIONATOR} != "recur -_+^+_- spank" ]] ; then
-___ECLASS_ONCE_VERSIONATOR="recur -_+^+_- spank"
+if [[ -z ${_VERSIONATOR_ECLASS} ]]; then
+_VERSIONATOR_ECLASS=1
inherit eutils
[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* [gentoo-dev] Re: Standardise the variable for including eclasses only once
2014-07-04 9:26 [gentoo-dev] Standardise the variable for including eclasses only once Ulrich Mueller
2014-07-04 13:14 ` Michał Górny
@ 2014-07-07 14:04 ` Michael Palimaka
2014-07-07 20:35 ` Alec Warner
1 sibling, 1 reply; 6+ messages in thread
From: Michael Palimaka @ 2014-07-07 14:04 UTC (permalink / raw
To: gentoo-dev
On 07/04/2014 07:26 PM, Ulrich Mueller wrote:
> I have no strong preference for the variable's value. Is testing for
> a non-empty value sufficient? Then we should assign something simple
> (like "1"). If not, any string that is sufficiently random (like the
> one used in eutils) should be good.
I believe vapier introduced the original check and random value, so
perhaps he knows.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [gentoo-dev] Re: Standardise the variable for including eclasses only once
2014-07-07 14:04 ` [gentoo-dev] " Michael Palimaka
@ 2014-07-07 20:35 ` Alec Warner
0 siblings, 0 replies; 6+ messages in thread
From: Alec Warner @ 2014-07-07 20:35 UTC (permalink / raw
To: Gentoo Dev
[-- Attachment #1: Type: text/plain, Size: 637 bytes --]
On Mon, Jul 7, 2014 at 7:04 AM, Michael Palimaka <kensington@gentoo.org>
wrote:
> On 07/04/2014 07:26 PM, Ulrich Mueller wrote:
> > I have no strong preference for the variable's value. Is testing for
> > a non-empty value sufficient? Then we should assign something simple
> > (like "1"). If not, any string that is sufficiently random (like the
> > one used in eutils) should be good.
>
> I believe vapier introduced the original check and random value, so
> perhaps he knows.
>
I forwarded this thread to him. It was a holiday for America over the
weekend, so perhaps waiting one or two days for his reply would be
appreciated.
-A
[-- Attachment #2: Type: text/html, Size: 1063 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [gentoo-dev] Standardise the variable for including eclasses only once
2014-07-05 18:08 ` Ulrich Mueller
@ 2014-07-11 8:22 ` Ulrich Mueller
0 siblings, 0 replies; 6+ messages in thread
From: Ulrich Mueller @ 2014-07-11 8:22 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 195 bytes --]
>>>>> On Sat, 5 Jul 2014, Ulrich Mueller wrote:
> I don't see any different opinions. The patch included below renames
> all variables whose name starts with two underscores.
Committed to CVS.
[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-07-11 8:22 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-04 9:26 [gentoo-dev] Standardise the variable for including eclasses only once Ulrich Mueller
2014-07-04 13:14 ` Michał Górny
2014-07-05 18:08 ` Ulrich Mueller
2014-07-11 8:22 ` Ulrich Mueller
2014-07-07 14:04 ` [gentoo-dev] " Michael Palimaka
2014-07-07 20:35 ` Alec Warner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox