summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-admin')
-rw-r--r--app-admin/eselect-ecj/ChangeLog10
-rw-r--r--app-admin/eselect-ecj/Manifest4
-rw-r--r--app-admin/eselect-ecj/eselect-ecj-0.3.ebuild26
-rw-r--r--app-admin/eselect-ecj/files/ecj.eselect187
-rw-r--r--app-admin/eselect-ecj/metadata.xml5
5 files changed, 232 insertions, 0 deletions
diff --git a/app-admin/eselect-ecj/ChangeLog b/app-admin/eselect-ecj/ChangeLog
new file mode 100644
index 000000000000..34981495d549
--- /dev/null
+++ b/app-admin/eselect-ecj/ChangeLog
@@ -0,0 +1,10 @@
+# ChangeLog for app-admin/eselect-ecj
+# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect-ecj/ChangeLog,v 1.1 2008/07/21 22:07:24 betelgeuse Exp $
+
+*eselect-ecj-0.3 (21 Jul 2008)
+
+ 21 Jul 2008; Petteri Räty <betelgeuse@gentoo.org> +files/ecj.eselect,
+ +metadata.xml, +eselect-ecj-0.3.ebuild:
+ Initial addition. Thanks to Chewi <chewi@aura-online.co.uk> for the work.
+
diff --git a/app-admin/eselect-ecj/Manifest b/app-admin/eselect-ecj/Manifest
new file mode 100644
index 000000000000..c84c1337c10e
--- /dev/null
+++ b/app-admin/eselect-ecj/Manifest
@@ -0,0 +1,4 @@
+AUX ecj.eselect 3907 RMD160 4811cd3d3e93d178602da5aff5b06dee3368b43b SHA1 e7fe5db968c0c0f67e79b4f3094667cbcf87e6f9 SHA256 eab4ac07d3096ee98ecdcff7ec084b094338cfa128f709cf8bc867cad2c5b383
+EBUILD eselect-ecj-0.3.ebuild 559 RMD160 1c357b08fdee3f8ad1e27a2084af486e263f9a25 SHA1 859d9e7c59cb8df868d1c478615e5c06cd53acb6 SHA256 c21ef9dccb58db4a835bcb6efd1024423c89b0818b5c4fa097736ac57f5a898e
+MISC ChangeLog 346 RMD160 cef5ce569a1167be1e6d2ce4f83f592de19b0dbf SHA1 a19927e764f67f67368de158d97d27a982818885 SHA256 4aaae7c071fe14554db11209c3280184467a3583cc99cc5a0c32df206ed484b9
+MISC metadata.xml 158 RMD160 493079b5fb71d66863beea1b023901c90ba81be5 SHA1 77cd509a8b3c377b9a24480b48a5d5481b7874f1 SHA256 ea882ceccfd160b16cf7e79de423bdcc12b3fa000f124491a6df36f5783894fb
diff --git a/app-admin/eselect-ecj/eselect-ecj-0.3.ebuild b/app-admin/eselect-ecj/eselect-ecj-0.3.ebuild
new file mode 100644
index 000000000000..7e8cac18b3cf
--- /dev/null
+++ b/app-admin/eselect-ecj/eselect-ecj-0.3.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2008 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.3.ebuild,v 1.1 2008/07/21 22:07:24 betelgeuse Exp $
+
+EAPI=1
+
+DESCRIPTION="Manages ECJ symlinks"
+HOMEPAGE="http://www.gentoo.org/"
+SRC_URI=""
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ia64 ~ppc ~ppc64 ~x86 ~x86-fbsd"
+IUSE=""
+
+RDEPEND=">=app-admin/eselect-1.0.10"
+PDEPEND="
+|| (
+ dev-java/eclipse-ecj:3.4
+ >=dev-java/eclipse-ecj-3.3.0-r2:3.3
+ >=dev-java/eclipse-ecj-3.2.2-r1:3.2
+)"
+
+src_install() {
+ insinto /usr/share/eselect/modules
+ doins "${FILESDIR}/ecj.eselect" || die "doins failed"
+}
diff --git a/app-admin/eselect-ecj/files/ecj.eselect b/app-admin/eselect-ecj/files/ecj.eselect
new file mode 100644
index 000000000000..dcafbb5b31ed
--- /dev/null
+++ b/app-admin/eselect-ecj/files/ecj.eselect
@@ -0,0 +1,187 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id: ecj.eselect,v 1.1 2008/07/21 22:07:24 betelgeuse Exp $
+
+DESCRIPTION="Manage ECJ targets"
+MAINTAINER="chewi@aura-online.co.uk"
+VERSION="0.3"
+
+ECJ="${ROOT}/usr/bin/ecj"
+
+# find a list of ecj symlink targets, best first.
+find_targets() {
+ for f in $(ls -r "${ECJ}"-[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]* ]] && [[ -f "${ROOT}/usr/bin/${target}" ]] ; then
+ echo ${target}
+ else
+ die -q "Target \"${1}\" doesn't appear to be valid!"
+ fi
+}
+
+# try to remove the ecj symlink.
+remove_symlink() {
+ rm "${ECJ}" &>/dev/null
+}
+
+# determine the current target.
+get_target() {
+ local canonicalised=$(canonicalise "${ECJ}")
+ echo $(basename "${canonicalised}")
+}
+
+# set the ecj symlink.
+set_symlink() {
+ local target=$(find_target "${1}")
+ remove_symlink
+ ln -s "${ROOT}/usr/bin/${target}" "${ECJ}" || \
+ die "Couldn't set ${target} symlink."
+}
+
+### 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) )
+
+ if [[ -n ${targets[@]} ]] ; then
+ local canonicalised basename
+
+ for (( i = 0 ; i < ${#targets[@]} ; i = i + 1 )) ; do
+ canonicalised=$(canonicalise "${ECJ}")
+ basename=$(basename "${canonicalised}")
+
+ if [[ "${targets[${i}]}" = "${basename}" ]] ; then
+ targets[${i}]="${targets[${i}]} $(highlight '*')"
+ fi
+ done
+
+ write_list_start "Available ECJ targets:"
+ write_numbered_list "${targets[@]}"
+ else
+ write_kv_list_entry "(none found)" ""
+ fi
+}
+
+### 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() {
+ if [[ $# -gt 1 ]]; then
+ die -q "Too many parameters. Expected only one."
+ fi
+
+ local target=${1}
+
+ if [[ -z "${target}" ]] ; then
+ die -q "You didn't give me a target name or number."
+ elif [[ -L "${ECJ}" ]] ; then
+ if ! remove_symlink ; then
+ die -q "Can't remove existing ecj provider."
+ elif ! set_symlink "${1}" ; then
+ die -q "Can't set new ecj provider."
+ fi
+ elif [[ -e "${ECJ}" ]] ; then
+ write_warning_msg "Can't set a new ecj provider. There's a file in the way at ${ECJ}. You can try removing it manually, and then re-running this command."
+ else
+ set_symlink "${target}" || die -q "Wasn't able to set a new provider."
+ fi
+}
+
+### 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() {
+ if [[ $# -gt 1 ]] ; then
+ die -q "Too many parameters. Expected only one."
+ fi
+
+ # For pkg_postrm
+ if [[ ! $(find_targets) ]]; then
+ remove_symlink
+ return
+ fi
+
+ local canonicalised=$(canonicalise "${ECJ}")
+
+ if [[ ! -L "${ECJ}" ]] || [[ ! -f "${canonicalised}" ]] ; then
+ do_set 1
+ elif [[ -n "${1}" ]] ; then
+ # Check whether target name is valid.
+ find_target "${1}" > /dev/null
+
+ if [[ "${1}" == "$(find_target 1)" ]] ; then
+ do_set 1
+ fi
+ fi
+}
+
+# vim: set ft=eselect :
diff --git a/app-admin/eselect-ecj/metadata.xml b/app-admin/eselect-ecj/metadata.xml
new file mode 100644
index 000000000000..7303cef96964
--- /dev/null
+++ b/app-admin/eselect-ecj/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>java</herd>
+</pkgmetadata>