summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalph Sennhauser <sera@gentoo.org>2011-12-18 08:44:56 +0000
committerRalph Sennhauser <sera@gentoo.org>2011-12-18 08:44:56 +0000
commit3acee13e1a5456eb15f08f4d7a444812df760f42 (patch)
tree52a1e3d5785b9749f13925bdc6003bda536b4bdf /app-admin/eselect-ecj
parentFix dependency on ecj, eselect-ecj's PDEPEND doesn't guarantee it's availabil... (diff)
downloadgentoo-2-3acee13e1a5456eb15f08f4d7a444812df760f42.tar.gz
gentoo-2-3acee13e1a5456eb15f08f4d7a444812df760f42.tar.bz2
gentoo-2-3acee13e1a5456eb15f08f4d7a444812df760f42.zip
Version and EAPI bump.
Drop PDEPEND as it doesn't guarantee packages DEPENDing on eselect-ecj the availability of a usable ecj. Packages must DEPEND on ecj for themself. Make update action always barf on invalid input. Make update action check for ecj.jar link as well. Make set action always link valid targets. #354097 (Portage version: 2.1.10.41/cvs/Linux x86_64)
Diffstat (limited to 'app-admin/eselect-ecj')
-rw-r--r--app-admin/eselect-ecj/ChangeLog13
-rw-r--r--app-admin/eselect-ecj/eselect-ecj-0.7.ebuild23
-rw-r--r--app-admin/eselect-ecj/files/ecj-0.7.eselect151
3 files changed, 186 insertions, 1 deletions
diff --git a/app-admin/eselect-ecj/ChangeLog b/app-admin/eselect-ecj/ChangeLog
index 78cdc49f6671..b828a96c279c 100644
--- a/app-admin/eselect-ecj/ChangeLog
+++ b/app-admin/eselect-ecj/ChangeLog
@@ -1,6 +1,17 @@
# ChangeLog for app-admin/eselect-ecj
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect-ecj/ChangeLog,v 1.13 2011/10/19 22:01:32 fordfrog Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect-ecj/ChangeLog,v 1.14 2011/12/18 08:44:55 sera Exp $
+
+*eselect-ecj-0.7 (18 Dec 2011)
+
+ 18 Dec 2011; Ralph Sennhauser <sera@gentoo.org> +eselect-ecj-0.7.ebuild,
+ +files/ecj-0.7.eselect:
+ Version and EAPI bump.
+ Drop PDEPEND as it doesn't guarantee packages DEPENDing on eselect-ecj the
+ availability of a usable ecj. Packages must DEPEND on ecj for themself.
+ Make update action always barf on invalid input.
+ Make update action check for ecj.jar link as well.
+ Make set action always link valid targets. #354097
*eselect-ecj-0.6-r1 (19 Oct 2011)
diff --git a/app-admin/eselect-ecj/eselect-ecj-0.7.ebuild b/app-admin/eselect-ecj/eselect-ecj-0.7.ebuild
new file mode 100644
index 000000000000..90081b566f36
--- /dev/null
+++ b/app-admin/eselect-ecj/eselect-ecj-0.7.ebuild
@@ -0,0 +1,23 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect-ecj/eselect-ecj-0.7.ebuild,v 1.1 2011/12/18 08:44:56 sera Exp $
+
+EAPI=4
+
+DESCRIPTION="Manages ECJ symlinks"
+HOMEPAGE="http://www.gentoo.org/"
+SRC_URI=""
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~sparc-solaris ~x86-solaris"
+IUSE=""
+
+RDEPEND=">=app-admin/eselect-1.2.3"
+
+S="${WORKDIR}"
+
+src_install() {
+ insinto /usr/share/eselect/modules
+ newins "${FILESDIR}/ecj-${PV}.eselect" ecj.eselect || die "newins failed"
+}
diff --git a/app-admin/eselect-ecj/files/ecj-0.7.eselect b/app-admin/eselect-ecj/files/ecj-0.7.eselect
new file mode 100644
index 000000000000..3250b9721e90
--- /dev/null
+++ b/app-admin/eselect-ecj/files/ecj-0.7.eselect
@@ -0,0 +1,151 @@
+# -*-eselect-*- vim: ft=eselect
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id: ecj-0.7.eselect,v 1.1 2011/12/18 08:44:56 sera Exp $
+
+DESCRIPTION="Manage ECJ targets"
+MAINTAINER="java@gentoo.org"
+VERSION="0.7"
+
+ECJ="${EROOT}/usr/bin/ecj"
+ECJ_JAR="${EROOT}/usr/share/eclipse-ecj/ecj.jar"
+
+# find a list of ecj symlink targets, best first.
+find_targets() {
+ for f in $(ls -r "${ECJ}"-[0-9]* "${ECJ}"-gcj-[0-9]* 2> /dev/null) ; do
+ if [[ -f "${f}" ]] ; then
+ echo $(basename "${f}")
+ fi
+ done
+}
+
+# get a named or numbered target.
+find_target() {
+ local target=${1}
+
+ if is_number "${target}" && [[ ${target} -ge 1 ]] ; then
+ targets=( $(find_targets ) )
+ [[ -z "${targets}" ]] && die -q "No targets found!"
+ target=${targets[target-1]}
+ fi
+
+ if [[ "${target}" = ecj-[0-9]* || "${target}" = ecj-gcj-[0-9]* ]] \
+ && [[ -f "${EROOT}/usr/bin/${target}" ]] ; then
+ echo ${target}
+ else
+ die -q "Target \"${1}\" doesn't appear to be valid!"
+ fi
+}
+
+# determine the current target.
+get_target() {
+ local canonicalised=$(canonicalise "${ECJ}")
+ echo $(basename "${canonicalised}")
+}
+
+### show action ###
+
+describe_show() {
+ echo "Show current ECJ target"
+}
+
+do_show() {
+ if [[ ${#} -gt 0 ]]; then
+ die -q "No parameters allowed."
+ fi
+
+ if [[ -L "${ECJ}" ]] ; then
+ get_target
+ return 0
+ elif [[ -e "${ECJ}" ]] ; then
+ echo "(not a symlink)" >&2
+ return 1
+ else
+ echo "(unset)" >&2
+ return 1
+ fi
+}
+
+### list action ###
+
+describe_list() {
+ echo "List available ECJ targets"
+}
+
+do_list() {
+ if [[ ${#} -gt 0 ]]; then
+ die -q "Usage error: no parameters allowed."
+ fi
+
+ local i targets
+ targets=( $(find_targets) )
+
+ for (( i = 0; i < ${#targets[@]}; i++ )); do
+ [[ ${targets[i]} = $(basename "$(canonicalise "${ECJ}")") ]] \
+ && targets[i]=$(highlight_marker "${targets[i]}")
+ done
+
+ write_list_start "Available ECJ targets:"
+ write_numbered_list -m "(none found)" "${targets[@]}"
+}
+
+### set action ###
+
+describe_set() {
+ echo "Set a new ECJ target"
+}
+
+describe_set_options() {
+ echo "target : Target name or number (from 'list' action)"
+}
+
+describe_set_parameters() {
+ echo "<target>"
+}
+
+do_set() {
+ [[ ${1} ]] || die -q "You didn't give me a target name or number."
+ [[ ${2} ]] && die -q "Too many parameters. Expected only one."
+
+ local target=$(find_target "${1}")
+
+ rm -f "${ECJ}" "${ECJ_JAR}"
+
+ ln -sf "${target}" "${ECJ}" || die "Couldn't set ${target} symlink."
+ mkdir -p $(dirname ${ECJ_JAR})
+ [[ "${target}" != ecj-gcj* ]] && target="eclipse-${target}"
+ ln -sf "${EROOT}"/usr/share/${target}/lib/ecj.jar ${ECJ_JAR} \
+ || die -q "Wasn't able to set a new provider."
+}
+
+### update action ###
+
+describe_update() {
+ echo "Set the ECJ target to the latest if the current target is invalid or if the given target is the latest"
+}
+
+describe_update_options() {
+ echo "target (optional) : Target name (from 'list' action)"
+}
+
+describe_update_parameters() {
+ echo "<target>"
+}
+
+do_update() {
+ [[ ${1} ]] && find_target "${1}" >/dev/null
+ [[ ${2} ]] && die -q "Too many parameters. Expected only one."
+
+ if [[ ! -f "${ECJ}" ]] || [[ ! -f "${ECJ_JAR}" ]]; then
+ local target="${1}"
+ if [[ -z "${target}" ]]; then
+ local all_targets=( $(find_targets) )
+ target=${all_targets}
+ fi
+ if [[ ${target} ]]; then
+ do_set ${target}
+ else
+ rm -f "${ECJ}" "${ECJ_JAR}"
+ fi
+ fi
+}