summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-02-08 22:03:07 +0000
committerZac Medico <zmedico@gentoo.org>2011-02-08 22:03:07 +0000
commit7739d8041ecbea00fdcd4821913eced9ae28f28e (patch)
tree80aa30dda63fb73312b7762a495444dcec206a06 /sys-apps
parentVersion bump. (diff)
downloadgentoo-2-7739d8041ecbea00fdcd4821913eced9ae28f28e.tar.gz
gentoo-2-7739d8041ecbea00fdcd4821913eced9ae28f28e.tar.bz2
gentoo-2-7739d8041ecbea00fdcd4821913eced9ae28f28e.zip
08 Feb 2011; Zac Medico <zmedico@gentoo.org> portage-9999.ebuild,
metadata.xml: Support USE=python2, for cases in which portage dependencies such as libselinux only work with python2. (Portage version: 2.2.0_alpha22_p7/cvs/Linux i686)
Diffstat (limited to 'sys-apps')
-rw-r--r--sys-apps/portage/ChangeLog7
-rw-r--r--sys-apps/portage/metadata.xml1
-rw-r--r--sys-apps/portage/portage-9999.ebuild22
3 files changed, 22 insertions, 8 deletions
diff --git a/sys-apps/portage/ChangeLog b/sys-apps/portage/ChangeLog
index dcfe6af1304f..fcabf46fba02 100644
--- a/sys-apps/portage/ChangeLog
+++ b/sys-apps/portage/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for sys-apps/portage
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/portage/ChangeLog,v 1.798 2011/02/08 01:32:32 zmedico Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/portage/ChangeLog,v 1.799 2011/02/08 22:03:06 zmedico Exp $
+
+ 08 Feb 2011; Zac Medico <zmedico@gentoo.org> portage-9999.ebuild,
+ metadata.xml:
+ Support USE=python2, for cases in which portage dependencies such as
+ libselinux only work with python2.
*portage-2.2.0_alpha22 (08 Feb 2011)
diff --git a/sys-apps/portage/metadata.xml b/sys-apps/portage/metadata.xml
index ee29c2ad57b0..dbcbf61f54c5 100644
--- a/sys-apps/portage/metadata.xml
+++ b/sys-apps/portage/metadata.xml
@@ -10,6 +10,7 @@
<use>
<flag name="epydoc">Build html API documentation with epydoc.</flag>
<flag name="ipc">Use inter-process communication between portage and running ebuilds.</flag>
+ <flag name="python2">Use python2 as Python interpreter.</flag>
<flag name="python3">Use python3 as Python interpreter.</flag>
</use>
</pkgmetadata>
diff --git a/sys-apps/portage/portage-9999.ebuild b/sys-apps/portage/portage-9999.ebuild
index bf7b6c4f8d64..5e97f12bfbc0 100644
--- a/sys-apps/portage/portage-9999.ebuild
+++ b/sys-apps/portage/portage-9999.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/portage/portage-9999.ebuild,v 1.17 2011/02/06 19:36:59 zmedico Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/portage/portage-9999.ebuild,v 1.18 2011/02/08 22:03:07 zmedico Exp $
# Require EAPI 2 since we now require at least python-2.6 (for python 3
# syntax support) which also requires EAPI 2.
@@ -13,12 +13,12 @@ LICENSE="GPL-2"
KEYWORDS=""
PROVIDE="virtual/portage"
SLOT="0"
-IUSE="build doc epydoc +ipc python3 selinux"
+IUSE="build doc epydoc +ipc python2 python3 selinux"
python_dep="python3? ( =dev-lang/python-3* )
!python3? (
- build? ( || ( dev-lang/python:2.8 dev-lang/python:2.7 dev-lang/python:2.6 ) )
- !build? ( || ( dev-lang/python:2.8 dev-lang/python:2.7 dev-lang/python:2.6 >=dev-lang/python-3 ) )
+ build? ( || ( dev-lang/python:2.7 dev-lang/python:2.6 ) )
+ !build? ( || ( dev-lang/python:2.7 dev-lang/python:2.6 !python2? ( >=dev-lang/python-3 ) ) )
)"
# The pysqlite blocker is for bug #282760.
@@ -64,7 +64,10 @@ compatible_python_is_selected() {
}
pkg_setup() {
- if ! use python3 && ! compatible_python_is_selected ; then
+ if use python2 && use python3 ; then
+ die "Do not enable python2 and python3 USE flags simultaneously"
+ fi
+ if ! use python2 && ! use python3 && ! compatible_python_is_selected ; then
ewarn "Attempting to select a compatible default python interpreter"
local x success=0
for x in /usr/bin/python2.* ; do
@@ -84,7 +87,9 @@ pkg_setup() {
fi
fi
- if use python3; then
+ if use python2; then
+ python_set_active_version 2
+ elif use python3; then
python_set_active_version 3
fi
}
@@ -107,7 +112,10 @@ src_prepare() {
die "failed to patch AbstractEbuildProcess.py"
fi
- if use python3; then
+ if use python2; then
+ einfo "Converting shebangs for python2..."
+ python_convert_shebangs -r 2 .
+ elif use python3; then
einfo "Converting shebangs for python3..."
python_convert_shebangs -r 3 .
fi