summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-12-10 01:02:01 +0000
committerZac Medico <zmedico@gentoo.org>2009-12-10 01:02:01 +0000
commita6de04e2e0daa4c2697ecb9d11f6adaf8bbf63f2 (patch)
treead0477526b6e30b54052d10d405f556c5c883e94
parent780f07a62b0d873757085593f0a40225507aa0b7 (diff)
downloadportage-a6de04e2e0daa4c2697ecb9d11f6adaf8bbf63f2.tar.gz
portage-a6de04e2e0daa4c2697ecb9d11f6adaf8bbf63f2.tar.bz2
portage-a6de04e2e0daa4c2697ecb9d11f6adaf8bbf63f2.zip
Bump EAPI conditionals to account for rename of EAPI 3 to 4. Thanks to
Jonathan Callen <abcd@g.o> for this patch. (trunk r14965) svn path=/main/branches/2.1.7/; revision=14999
-rwxr-xr-xbin/ebuild-helpers/doins2
-rwxr-xr-xbin/ebuild-helpers/newins2
-rwxr-xr-xbin/ebuild.sh26
-rwxr-xr-xbin/isolated-functions.sh4
-rw-r--r--pym/portage/__init__.py8
-rw-r--r--pym/repoman/checks.py16
6 files changed, 29 insertions, 29 deletions
diff --git a/bin/ebuild-helpers/doins b/bin/ebuild-helpers/doins
index b5f00e8d8..c5e78d9c5 100755
--- a/bin/ebuild-helpers/doins
+++ b/bin/ebuild-helpers/doins
@@ -26,7 +26,7 @@ if [[ ${INSDESTTREE#${D}} != "${INSDESTTREE}" ]]; then
fi
case "$EAPI" in
- 0|1|2)
+ 0|1|2|3)
PRESERVE_SYMLINKS=n
;;
*)
diff --git a/bin/ebuild-helpers/newins b/bin/ebuild-helpers/newins
index d15006d02..d66e0599a 100755
--- a/bin/ebuild-helpers/newins
+++ b/bin/ebuild-helpers/newins
@@ -15,7 +15,7 @@ fi
rm -rf "${T}/${2}" || exit $?
case "$EAPI" in
- 0|1|2)
+ 0|1|2|3)
cp "$1" "$T/$2" || exit $?
;;
*)
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index c4b9c7b0b..d5d654b40 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -144,7 +144,7 @@ useq() {
# Skip this for older EAPIs since lots of ebuilds/eclasses
# have stuff in global scope that really belongs somewhere
# like pkg_setup or src_configure.
- if [[ -n $EAPI ]] && ! hasq "$EAPI" 0 1 2 ; then
+ if [[ -n $EAPI ]] && ! hasq "$EAPI" 0 1 2 3 ; then
die "use() called during invalid phase: $EBUILD_PHASE"
fi
@@ -439,7 +439,7 @@ unpack() {
_unpack_tar lzma
;;
xz)
- if hasq $eapi 0 1 2 ; then
+ if hasq $eapi 0 1 2 3 ; then
vecho "unpack ${x}: file format not recognized. Ignoring."
else
_unpack_tar xz
@@ -501,7 +501,7 @@ econf() {
fi
# EAPI=3 adds --disable-dependency-tracking to econf
- if ! hasq "$EAPI" 0 1 2 ; then
+ if ! hasq "$EAPI" 0 1 2 3 ; then
set -- --disable-dependency-tracking "$@"
fi
@@ -648,7 +648,7 @@ _eapi2_src_compile() {
fi
}
-_eapi3_src_install() {
+_eapi4_src_install() {
if [[ -f Makefile || -f GNUmakefile || -f makefile ]] ; then
emake DESTDIR="${D}" install
fi
@@ -912,7 +912,7 @@ dyn_prepare() {
if [[ -d $S ]] ; then
cd "${S}"
- elif hasq $EAPI 0 1 2; then
+ elif hasq $EAPI 0 1 2 3; then
cd "${WORKDIR}"
elif [[ -z ${A} ]] && ! has_phase_defined_up_to prepare; then
cd "${WORKDIR}"
@@ -943,7 +943,7 @@ dyn_configure() {
if [[ -d $S ]] ; then
cd "${S}"
- elif hasq $EAPI 0 1 2; then
+ elif hasq $EAPI 0 1 2 3; then
cd "${WORKDIR}"
elif [[ -z ${A} ]] && ! has_phase_defined_up_to configure; then
cd "${WORKDIR}"
@@ -976,7 +976,7 @@ dyn_compile() {
if [[ -d $S ]] ; then
cd "${S}"
- elif hasq $EAPI 0 1 2; then
+ elif hasq $EAPI 0 1 2 3; then
cd "${WORKDIR}"
elif [[ -z ${A} ]] && ! has_phase_defined_up_to compile; then
cd "${WORKDIR}"
@@ -1053,7 +1053,7 @@ dyn_install() {
mkdir "${PORTAGE_BUILDDIR}/image"
if [[ -d $S ]] ; then
cd "${S}"
- elif hasq $EAPI 0 1 2; then
+ elif hasq $EAPI 0 1 2 3; then
cd "${WORKDIR}"
elif [[ -z ${A} ]] && ! has_phase_defined_up_to install; then
cd "${WORKDIR}"
@@ -1407,7 +1407,7 @@ _ebuild_arg_to_phase() {
case "$arg" in
pretend)
- ! hasq $eapi 0 1 2 && \
+ ! hasq $eapi 0 1 2 3 && \
phase_func=pkg_pretend
;;
setup)
@@ -1503,8 +1503,8 @@ _ebuild_phase_funcs() {
declare -F src_compile >/dev/null || \
src_compile() { _eapi2_src_compile "$@" ; }
- [[ $eapi == 2 ]] || declare -F src_install >/dev/null || \
- src_install() { _eapi3_src_install "$@" ; }
+ has $eapi 2 3 || declare -F src_install >/dev/null || \
+ src_install() { _eapi4_src_install "$@" ; }
if hasq $phase_func $default_phases ; then
@@ -1859,7 +1859,7 @@ if ! hasq "$EBUILD_PHASE" clean cleanrm ; then
[[ -n $EAPI ]] || EAPI=0
- if has "$EAPI" 0 1 2 ; then
+ if has "$EAPI" 0 1 2 3 ; then
export RDEPEND=${RDEPEND-${DEPEND}}
debug-print "RDEPEND: not set... Setting to: ${DEPEND}"
fi
@@ -1879,7 +1879,7 @@ if ! hasq "$EBUILD_PHASE" clean cleanrm ; then
pkg_nofetch pkg_postinst pkg_postrm pkg_preinst pkg_prerm
pkg_setup src_test src_unpack"
;;
- 2)
+ 2|3)
_valid_phases="src_compile pkg_config src_configure pkg_info
src_install pkg_nofetch pkg_postinst pkg_postrm pkg_preinst
src_prepare pkg_prerm pkg_setup src_test src_unpack"
diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 9741419b6..a557d9fd9 100755
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -54,7 +54,7 @@ dump_trace() {
}
nonfatal() {
- if has "${EAPI:-0}" 0 1 2; then
+ if has "${EAPI:-0}" 0 1 2 3; then
die "$FUNCNAME() not supported in this EAPI"
fi
if [[ $# -lt 1 ]]; then
@@ -515,7 +515,7 @@ save_ebuild_env() {
for x in pkg_setup pkg_nofetch src_unpack src_prepare src_configure \
src_compile src_test src_install pkg_preinst pkg_postinst \
pkg_prerm pkg_postrm ; do
- unset -f default_$x _eapi{0,1,2}_$x
+ unset -f default_$x _eapi{0,1,2,3,4}_$x
done
unset x
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index 90d82486e..333a24294 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -3748,7 +3748,7 @@ class config(object):
mydict["USE"] = self.get("PORTAGE_USE", "")
# Don't export AA to the ebuild environment in EAPIs that forbid it
- if eapi not in ("0", "1", "2"):
+ if eapi not in ("0", "1", "2", "3"):
mydict.pop("AA", None)
# sandbox's bashrc sources /etc/profile which unsets ROOTPATH,
@@ -5613,7 +5613,7 @@ def spawnebuild(mydo, actionmap, mysettings, debug, alwaysdep=0,
if mydo == "prepare" and eapi in ("0", "1"):
return os.EX_OK
- if mydo == "pretend" and eapi in ("0", "1", "2"):
+ if mydo == "pretend" and eapi in ("0", "1", "2", "3"):
return os.EX_OK
kwargs = actionmap[mydo]["args"]
@@ -6042,7 +6042,7 @@ def _spawn_misc_sh(mysettings, commands, phase=None, **kwargs):
return rval
_testing_eapis = frozenset()
-_deprecated_eapis = frozenset(["2_pre3", "2_pre2", "2_pre1"])
+_deprecated_eapis = frozenset(["3_pre1", "2_pre3", "2_pre2", "2_pre1"])
def _eapi_is_deprecated(eapi):
return eapi in _deprecated_eapis
@@ -6261,7 +6261,7 @@ def doebuild_environment(myebuild, mydo, myroot, mysettings, debug, use_cache, m
mysettings["PORTAGE_BUILDDIR"], ".exit_status")
#set up KV variable -- DEP SPEEDUP :: Don't waste time. Keep var persistent.
- if eapi not in ('0', '1', '2'):
+ if eapi not in ('0', '1', '2', '3'):
# Discard KV for EAPIs that don't support it. Cache KV is restored
# from the backupenv whenever config.reset() is called.
mysettings.pop('KV', None)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index a754ad46e..ce72e36ea 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -426,8 +426,8 @@ class SrcUnpackPatches(PhaseCheck):
return ("'%s'" % m.group(1)) + \
" call should be moved to src_prepare from line: %d"
-# EAPI-3 checks
-class Eapi3IncompatibleFuncs(LineCheck):
+# EAPI-4 checks
+class Eapi4IncompatibleFuncs(LineCheck):
repoman_check_name = 'EAPI.incompatible'
ignore_line = re.compile(r'(^\s*#)')
banned_commands_re = re.compile(r'^\s*(dosed|dohard)')
@@ -436,15 +436,15 @@ class Eapi3IncompatibleFuncs(LineCheck):
self.eapi = pkg.metadata['EAPI']
def check_eapi(self, eapi):
- return self.eapi not in ('0', '1', '2')
+ return self.eapi not in ('0', '1', '2', '3')
def check(self, num, line):
m = self.banned_commands_re.match(line)
if m is not None:
return ("'%s'" % m.group(1)) + \
- " has been banned in EAPI=3 on line: %d"
+ " has been banned in EAPI=4 on line: %d"
-class Eapi3GoneVars(LineCheck):
+class Eapi4GoneVars(LineCheck):
repoman_check_name = 'EAPI.incompatible'
ignore_line = re.compile(r'(^\s*#)')
undefined_vars_re = re.compile(r'.*\$(\{(AA|KV)\}|(AA|KV))')
@@ -453,13 +453,13 @@ class Eapi3GoneVars(LineCheck):
self.eapi = pkg.metadata['EAPI']
def check_eapi(self, eapi):
- return self.eapi not in ('0', '1', '2')
+ return self.eapi not in ('0', '1', '2', '3')
def check(self, num, line):
m = self.undefined_vars_re.match(line)
if m is not None:
return ("variable '$%s'" % m.group(1)) + \
- " is gone in EAPI=3 on line: %d"
+ " is gone in EAPI=4 on line: %d"
_constant_checks = tuple((c() for c in (
@@ -470,7 +470,7 @@ _constant_checks = tuple((c() for c in (
IUseUndefined, InheritAutotools,
EMakeParallelDisabled, EMakeParallelDisabledViaMAKEOPTS,
DeprecatedBindnowFlags, SrcUnpackPatches, WantAutoDefaultValue,
- SrcCompileEconf, Eapi3IncompatibleFuncs, Eapi3GoneVars)))
+ SrcCompileEconf, Eapi4IncompatibleFuncs, Eapi4GoneVars)))
_here_doc_re = re.compile(r'.*\s<<[-]?(\w+)$')