public inbox for gentoo-python@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-python@lists.gentoo.org
Cc: python@gentoo.org, "Michał Górny" <mgorny@gentoo.org>
Subject: [gentoo-python] [PATCH] eselect-python: update and clean the live ebuild up.
Date: Thu,  1 Nov 2012 10:50:16 +0100	[thread overview]
Message-ID: <1351763416-6557-1-git-send-email-mgorny@gentoo.org> (raw)

First of all, it didn't work at all (lacked SVN unpack commands). Since
eselect-python has been migrated to git, I have replaced the SVN code
with git one as well.

Secondly, I have set 'eselect python update' commands to run
unconditionally, and added '--if-unset'. This doesn't hurt and should
handle any future updates and fixing broken systems (as in, if user
breaks python symlinks, he just needs to reinstall eselect-python).

Thirdly, I have split 'eselect python update' into '--python2'
and '--python3' parts. This will ensure that both python2 & python3
implementation will be kept sane (and the active one will update
the main interpreter as well).
---
 .../eselect-python/eselect-python-99999999.ebuild  | 31 +++++++++++-----------
 1 file changed, 15 insertions(+), 16 deletions(-)

diff --git a/gx86/app-admin/eselect-python/eselect-python-99999999.ebuild b/gx86/app-admin/eselect-python/eselect-python-99999999.ebuild
index 4111ba1..08d3abc 100644
--- a/gx86/app-admin/eselect-python/eselect-python-99999999.ebuild
+++ b/gx86/app-admin/eselect-python/eselect-python-99999999.ebuild
@@ -5,11 +5,10 @@
 # Keep the EAPI low here because everything else depends on it.
 # We want to make upgrading simpler.
 
-ESVN_PROJECT="eselect-python"
-ESVN_REPO_URI="https://overlays.gentoo.org/svn/proj/python/projects/eselect-python/trunk"
-
 if [[ ${PV} == "99999999" ]] ; then
-	inherit autotools subversion
+	EGIT_REPO_URI="git://git.overlays.gentoo.org/proj/${PN}.git
+		http://git.overlays.gentoo.org/gitroot/proj/${PN}.git"
+	inherit autotools git-2
 else
 	SRC_URI="mirror://gentoo/${P}.tar.bz2"
 	KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
@@ -31,7 +30,12 @@ else
 fi
 
 src_unpack() {
-	unpack ${A}
+	if [[ ${PV} == "99999999" ]] ; then
+		git-2_src_unpack
+	else
+		unpack ${A}
+	fi
+
 	cd "${S}"
 	[[ -x configure ]] || eautoreconf
 }
@@ -41,16 +45,11 @@ src_install() {
 	emake DESTDIR="${D}" install || die
 }
 
-pkg_preinst() {
-	if has_version "<${CATEGORY}/${PN}-20090804" || ! has_version "${CATEGORY}/${PN}"; then
-		run_eselect_python_update="1"
-	fi
-}
-
 pkg_postinst() {
-	if [[ "${run_eselect_python_update}" == "1" ]]; then
-		ebegin "Running \`eselect python update\`"
-		eselect python update --ignore 3.0 --ignore 3.1 --ignore 3.2 > /dev/null
-		eend "$?"
-	fi
+	ebegin "Running 'eselect python update'"
+
+	eselect python update --python2 --if-unset
+	eselect python update --python3 --if-unset
+
+	eend ${?}
 }
-- 
1.7.12.4



             reply	other threads:[~2012-11-01  9:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-01  9:50 Michał Górny [this message]
     [not found] ` <CAJ0EP40syd5=xSkB2_AAUvLERfdmL3meNhhQCjbTvVW5xec03Q@mail.gmail.com>
2012-11-01 18:47   ` [gentoo-python] Re: [PATCH] eselect-python: update and clean the live ebuild up Mike Gilbert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1351763416-6557-1-git-send-email-mgorny@gentoo.org \
    --to=mgorny@gentoo.org \
    --cc=gentoo-python@lists.gentoo.org \
    --cc=python@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox