aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Bronder <jbronder@gentoo.org>2013-02-21 23:39:54 -0500
committerJustin Bronder <jbronder@gentoo.org>2013-02-21 23:40:02 -0500
commit86d0295a8821ba68d6e55cc48dc2bb4e904c7801 (patch)
tree514bed12c1612ecf0b1a5156694d8e53f4172d05
parentMerge branch 'master' of git+ssh://git.overlays.gentoo.org/proj/sci (diff)
downloadsci-86d0295a8821ba68d6e55cc48dc2bb4e904c7801.tar.gz
sci-86d0295a8821ba68d6e55cc48dc2bb4e904c7801.tar.bz2
sci-86d0295a8821ba68d6e55cc48dc2bb4e904c7801.zip
empi: bump 0.8
Package-Manager: portage-2.1.11.50 RepoMan-Options: --force
-rw-r--r--sys-cluster/empi/ChangeLog10
-rw-r--r--sys-cluster/empi/empi-0.8.ebuild (renamed from sys-cluster/empi/empi-0.7.ebuild)2
-rw-r--r--sys-cluster/empi/files/ChangeLog-0.7164
-rw-r--r--sys-cluster/empi/files/ChangeLog-0.868
-rwxr-xr-xsys-cluster/empi/files/empi-0.7408
-rwxr-xr-xsys-cluster/empi/files/empi-0.8492
-rw-r--r--sys-cluster/empi/files/eselect.mpi-0.8 (renamed from sys-cluster/empi/files/eselect.mpi-0.7)2
7 files changed, 571 insertions, 575 deletions
diff --git a/sys-cluster/empi/ChangeLog b/sys-cluster/empi/ChangeLog
index 0b8069b21..b69a7dfb4 100644
--- a/sys-cluster/empi/ChangeLog
+++ b/sys-cluster/empi/ChangeLog
@@ -1,7 +1,15 @@
# ChangeLog for sys-cluster/empi
-# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
+# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
# $Header: $
+*empi-0.8 (22 Feb 2013)
+
+ 22 Feb 2013; Justin Bronder <jsbronder@gentoo.org> -files/ChangeLog-0.7,
+ -files/empi-0.7, -files/eselect.mpi-0.7, -empi-0.7.ebuild,
+ +files/ChangeLog-0.8, +files/empi-0.8, +files/eselect.mpi-0.8,
+ +empi-0.8.ebuild:
+ empi: bump 0.8
+
21 Jan 2010; Justin Bronder <jsbronder@gentoo.org> -files/ChangeLog-0.6,
-files/empi-0.6:
cleanup
diff --git a/sys-cluster/empi/empi-0.7.ebuild b/sys-cluster/empi/empi-0.8.ebuild
index f50e61a4f..bb3daffe0 100644
--- a/sys-cluster/empi/empi-0.7.ebuild
+++ b/sys-cluster/empi/empi-0.8.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
diff --git a/sys-cluster/empi/files/ChangeLog-0.7 b/sys-cluster/empi/files/ChangeLog-0.7
deleted file mode 100644
index 4110eca4e..000000000
--- a/sys-cluster/empi/files/ChangeLog-0.7
+++ /dev/null
@@ -1,164 +0,0 @@
-commit 49905d1a07f32ddf55a9a5d7e7cd1a5fcbfff26f
-Author: Justin Bronder <jsbronder@gmail.com>
-Date: Wed Jan 20 23:32:09 2010 -0500
-
- Revert "Remove useless scripts"
-
- This reverts commit b633bb1b420c55cbd397be328e4438f0c82cac3d.
-
- Yeah, they were not useless.
-
-commit b633bb1b420c55cbd397be328e4438f0c82cac3d
-Author: Justin Bronder <jsbronder@gmail.com>
-Date: Wed Jan 20 23:28:11 2010 -0500
-
- Remove useless scripts
-
-commit 788b09ade81df31177bfa1fc154e8f5886c09122
-Author: Justin Bronder <jsbronder@gmail.com>
-Date: Wed Jan 20 23:26:40 2010 -0500
-
- update empi version
-
-commit c0896d1906d68ae2751e0c5f1d98f35e4db1d3ff
-Author: Justin Bronder <jsbronder@gmail.com>
-Date: Wed Jan 20 23:22:46 2010 -0500
-
- Update version to sync with sci overlay
-
-commit bb04e7f10557dfc25adf855172bde2fa52fda3ce
-Author: Justin Bronder <jsbronder@gmail.com>
-Date: Wed Jan 20 23:13:11 2010 -0500
-
- Gentoo likes tabs in eselect modules
-
-commit 964efc1c8484bf811c6292abb9ca61b9824cea87
-Author: Justin Bronder <jsbronder@gmail.com>
-Date: Wed Jan 20 23:09:08 2010 -0500
-
- eselect-mpi: cleanup .env.d files.
-
- Cleanup .env.d files so we don't save variables at the time of the
- eselect call and instead use the ones from the current environment at
- the time of sourcing.
-
- Thanks to EBo <ebo@sandien.com> for reporting and giving the initial
- code for the fix.
-
-commit 720dafe3c8d895d2f23a553e5bfdf0a746f54cae
-Author: Justin Bronder <jsbronder@gmail.com>
-Date: Thu Dec 3 21:51:39 2009 -0500
-
- add mpi_pkg_set_ld_library_path()
-
-commit 943336f0af5a8541fe0992797df402ffcda44a39
-Author: Justin Bronder <jsbronder@gmail.com>
-Date: Thu Dec 3 20:36:14 2009 -0500
-
- Add MPI_PKG_USE_ROMIO to mpi.eclass.
-
-commit da1150d684f2bf93cdc4a863ff1d468dead856ea
-Author: Justin Bronder <jsbronder@gmail.com>
-Date: Thu Dec 3 20:30:44 2009 -0500
-
- Recreate virtual ebuild when adding packages.
-
- As we have to copy process the virtual/${class} ebuild, it should be
- re-copied from the portage tree each time a package is added to a class.
- This way, any additions to the virtual are also picked up.
-
-commit 9b2b8fb7f2be159e5dc358156457960b779e75e3
-Author: Justin Bronder <jsbronder@gmail.com>
-Date: Tue Jun 30 16:47:45 2009 -0400
-
- mpi.eclass: mpi_doman fixes.
-
- Create usr/share if it doesn't already exist.
- Remove usr/share if it's empty after installing man pages.
-
-commit e2aa61aaac8ca9dd95255f5f5aa84d2bf1a3cde0
-Author: Justin Bronder <jsbronder@gmail.com>
-Date: Fri Jun 26 21:52:37 2009 -0400
-
- mpi.eclass: Update changelog
-
-commit 8daf4445fc87ccaeec9dcf5629d5d21990808ed4
-Author: Justin Bronder <jsbronder@gmail.com>
-Date: Fri Jun 26 21:49:38 2009 -0400
-
- mpi.eclass: Remove dep on eselect-mpi
-
- It's moving into the empi ebuild, so there's no way to get
- a classed build without having it.
-
-commit ce6dad7d94ef47e498a513195e64287b07d5cc0f
-Author: Justin Bronder <jsbronder@gmail.com>
-Date: Fri Jun 26 21:47:22 2009 -0400
-
- empi: Handle keywords/use for virtual/${class}
-
-commit 3f208612423f6ed66f6036aee544304f28c39992
-Author: Justin Bronder <jsbronder@gmail.com>
-Date: Fri Jun 26 21:33:54 2009 -0400
-
- empi: Trap regexps to beginning of line.
-
-commit 040640d118d4020c6584050208685b8f9c6c55fb
-Author: Justin Bronder <jsbronder@gmail.com>
-Date: Fri Jun 26 21:32:39 2009 -0400
-
- mpi.eclass: Fix virtual name when classed.
-
-commit b390a492636e939188a3a8c44fa8ac7b1e3e8579
-Author: Justin Bronder <jsbronder@gmail.com>
-Date: Fri Jun 26 21:32:05 2009 -0400
-
- mpi.eclass: Fix syntax errors.
-
-commit 6e9465dfd27434436899d742db6dbcac9e876ca8
-Author: Justin Bronder <jsbronder@gmail.com>
-Date: Fri Jun 26 21:20:52 2009 -0400
-
- empi.eclass: Fix calculation of invalid implementations in deplist
-
-commit 6acf8c47449f8884f4f93e9229c8a718816772e2
-Author: Justin Bronder <jsbronder@gmail.com>
-Date: Fri Jun 26 20:58:30 2009 -0400
-
- Revert "empi.eclass: Replace MPI_PKG_NEED_IMPS with MPI_PKG_INVAL_IMPS"
-
- This reverts commit 7430f4fa81526aa541a215cbbe6334928f8fda7f.
-
-commit 7430f4fa81526aa541a215cbbe6334928f8fda7f
-Author: Justin Bronder <jsbronder@gmail.com>
-Date: Fri Jun 26 20:49:48 2009 -0400
-
- empi.eclass: Replace MPI_PKG_NEED_IMPS with MPI_PKG_INVAL_IMPS
-
-commit 1cd78c6504a7e082b6993b6d8474b004f6340f57
-Author: Justin Bronder <jsbronder@gmail.com>
-Date: Fri Jun 26 20:43:16 2009 -0400
-
- mpi.eclass: Depend on the mpi virtual ebuild.
-
-commit 97ae3eb571b64cb2012872f22a11a3433230a0ef
-Author: Justin Bronder <jsbronder@gmail.com>
-Date: Fri Jun 26 20:35:43 2009 -0400
-
- Update .gitignore
-
-commit e55047d85900ae9077f1f1e209a752d0c45b40e5
-Author: Justin Bronder <jsbronder@gmail.com>
-Date: Fri Jun 26 20:32:56 2009 -0400
-
- empi: Create a specific virtual/mpi-${class}
-
- To be used with the eclass so we do not need to specify every
- implementation when calculating mpi_pkg_deps. Also allows us
- to use USE deps.
-
-commit 288305180c3a71a8975325241a4c5bb13e07f932
-Author: Justin Bronder <jsbronder@gmail.com>
-Date: Fri Jun 26 19:26:12 2009 -0400
-
- initial commit
diff --git a/sys-cluster/empi/files/ChangeLog-0.8 b/sys-cluster/empi/files/ChangeLog-0.8
new file mode 100644
index 000000000..15652b092
--- /dev/null
+++ b/sys-cluster/empi/files/ChangeLog-0.8
@@ -0,0 +1,68 @@
+commit a17e4452cb93014e2a4d5f7615e5d09f2df9c6a2 (HEAD, tag: v0.8, origin/master, origin/HEAD, master)
+Author: Justin Bronder <jsbronder@gmail.com>
+Date: Thu Feb 21 22:56:27 2013 -0500
+
+ empi-0.8
+
+commit b38f48aa70933858d410abce58964e55708471c9
+Author: Justin Bronder <jsbronder@gmail.com>
+Date: Thu Feb 21 22:54:28 2013 -0500
+
+ empi: manage overlay metadata
+
+ Add overlay metadata management. Snagged from crossdev.
+ http://git.overlays.gentoo.org/gitweb/?p=proj/crossdev.git
+
+commit 4305d879c232acd663a8bb13505e5cfa403c5df5
+Author: Justin Bronder <jsbronder@gmail.com>
+Date: Thu Feb 21 21:05:19 2013 -0500
+
+ empi: provide and set overlay default
+
+ Set default overlay path to /var/cache/overlays/mpi
+
+commit fd7eed35034cb54dbe0d8f553c57abceee3c0eea
+Author: Justin Bronder <jsbronder@gmail.com>
+Date: Thu Feb 21 20:40:36 2013 -0500
+
+ empi: allow all users to see usage screen
+
+commit 84aa3a41dbbf2924dc223614c267ff6e79bfce2e
+Author: Justin Bronder <jsbronder@gmail.com>
+Date: Fri Jan 11 16:43:08 2013 -0500
+
+ rename MPI_PORTDIR and pull it from the portage env
+
+commit 77318d28462f05b4a8a6f1ac7b270aa07b5ebc8a
+Author: Justin Bronder <jsbronder@gmail.com>
+Date: Fri Jan 11 16:07:14 2013 -0500
+
+ rename global variables to be obvious
+
+commit 07beb4baf6af2a45bd382d6b7ba87d8bcbeda7a7
+Author: Justin Bronder <jsbronder@gmail.com>
+Date: Fri Jan 11 15:44:50 2013 -0500
+
+ sanitize whitespace
+
+commit 7c7fb4f0669d554a5301e70a46ae82e584685aff
+Author: Justin Bronder <jsbronder@gmail.com>
+Date: Tue Mar 22 10:27:53 2011 -0400
+
+ mpi.eclass: Improve handling of unclassed dep strings
+
+ Instead of requiring a list of packages to block when calculating the
+ dep list for an unclassed ebuild, simply inject a dep string. This
+ will allow the use of USE-conditional blockers.
+
+commit 0319e9cac8325bda7440f0f48eeac30056658b7e
+Author: Nicolas Bigaouette <nbigaouette@gmail.com>
+Date: Wed Nov 24 22:42:49 2010 -0500
+
+ Typo: 'classs' to 'classes'
+
+commit 7f0ce9ea97ee8f72dc275ebdf3ce7ab44ad6538a
+Author: Justin Bronder <jsbronder@gmail.com>
+Date: Mon Nov 29 11:51:31 2010 -0500
+
+ Initial import to git.
diff --git a/sys-cluster/empi/files/empi-0.7 b/sys-cluster/empi/files/empi-0.7
deleted file mode 100755
index 97663c624..000000000
--- a/sys-cluster/empi/files/empi-0.7
+++ /dev/null
@@ -1,408 +0,0 @@
-#!/bin/bash
-VERSION=0.3
-
-source /etc/init.d/functions.sh
-
-# class (category) Implementation we're installing for. mpi-*
-# targets Packages to run action on. When creating, the implementation to use.
-# action create, add, update, remove.
-
-die(){
- if [ -n "${1}" ]; then
- echo; eerror $1; echo
- fi
- exit 1
-}
-
-usage(){
- local rc=${1:-0}
- shift
-cat <<-EOF
-empi-${VERSION}
-Usage: ${HILITE}empi${NORMAL} ${GOOD}[actions]${NORMAL} ${BRACKET}[options]${NORMAL}
-
-Actions:
- ${GOOD}-c, --create${NORMAL} pkgspec (Re)Initialize setup for mpi class.
- ${GOOD}-a, --add${NORMAL} pkgspec(s) Add packages using specified mpi class.
- ${GOOD}-d, --delete${NORMAL} class Remove everything related to specified class.
-
-Options:
- ${GOOD}-C, --class${NORMAL} class MPI class to use.
- ${GOOD}-t, --tree${NORMAL} path Path to portage tree to use ebuilds from.
- ${GOOD}-o, --overlaydir${NORMAL} path Directory to use for the empi portage overlay.
- ${GOOD} --noemerge${NORMAL} Do not call emerge, only preform overlay setup.
-
-Notes:
- ${HILITE}-${NORMAL} pkgspec is specified by a package string. Without a version, the
- portageq best_visible is used. For example, all of the following
- are valid: openmpi, sys-cluster/openmpi, =sys-cluster/openmpi-1.2.5.
- ${HILITE}-${NORMAL} class (-c) is user defined but must be prefixed with "mpi-"
-
-Examples:
-${BRACKET}Create a new class based on openmpi.${NORMAL}
- empi --create sys-cluster/openmpi --class mpi-ompi
-${BRACKET}Rebuild the above.${NORMAL}
- emerge mpi-ompi/openmpi
-${BRACKET}Add hpl to mpi-ompi${NORMAL}
- empi --class mpi-ompi --add sys-cluster/hpl
-EOF
- [[ -n $* ]] && echo && eerror "Error: $*"
- exit ${rc}
-}
-
-class_is_valid() {
- [[ -z ${class} ]] && usage 1 "No class defined."
- [[ ${class} != mpi-* ]] && usage 1 "Classes must be prefixed with mpi-"
- [[ ${class//./} != ${class} ]] && usage 1 "Classes cannot contain . (period)"
-}
-
-is_class_category() {
- local i
- for i in $(eselect mpi list -p); do
- [[ ${1} == ${i} ]] && return 0
- done
- return 1
-}
-
-split_atom() {
- local cpv c pf pn pv
- cpv=$(portageq best_visible / ${1})
- if [[ -z ${cpv} || ${rc} -ne 0 ]]; then
- cpv=$(portageq best_visible / =${1})
- [[ -z ${cpv} || ${rc} -ne 0 ]] && return 1
- fi
- c=${cpv%/*}; pf=${cpv#${c}/}; pn=${pf%%-[0-9]*}; pv=${pf#${pn}-}
- echo "${c} ${pn} ${pv}"
-}
-
-parse_pkgspecs() {
- local atom i
- for ((i=0; i<${#targets[@]}; i++)); do
- atom=($(split_atom ${targets[i]}))
- if [[ $? -ne 0 ]]; then
- eerror "Unable to find a unique package or valid version for ${targets[i]}"
- eerror "Is the package unmasked and unblocked normally?"
- die ""
- fi
- targets[i]=${atom[0]}/${atom[1]}-${atom[2]}
- done
-}
-
-# handle_etc_portage package_spec
-# parses /etc/portage/package.{keywords,use}. If ${class}/${pn} is seen, we don't
-# do a thing. Otherwise copy any lines that have ${cat}/${pn} inserting them again
-# with the new category. Also keywords virtual/${class} if necessary.
-handle_etc_portage() {
- local atom=( $(split_atom ${1}) )
- local ext line gfiles f
-
- for ext in "keywords" "use"; do
- if [ -d /etc/portage/package.${ext} ]; then
- gfiles="/etc/portage/package.${ext}/*"
- f=/etc/portage/package.${ext}/${class}
- else
- gfiles="/etc/portage/package.${ext}"
- f=/etc/portage/package.${ext}
- fi
-
- if ! grep "^[>=<]*${class}/${atom[1]}" ${gfiles} &>/dev/null; then
- grep -h "^[>=<]*${atom[0]}/${atom[1]}" ${gfiles} 2>/dev/null \
- | sed "s,${atom[0]},${class}," \
- | while read line; do
- echo "${line}" >> ${f}
- [[ ${VERBOSE} -ne 0 ]] \
- && einfo "Addition to ${f}: ${line}"
- done
- elif [[ ${VERBOSE} -ne 0 ]]; then
- ewarn "Keys for ${class}/${atom[1]} already exist in ${f}. Will not replicate them."
- fi
-
- if ! grep "^${class}/mpi" ${gfiles} &>/dev/null; then
- grep -h "^virtual/mpi" ${gfiles} 2>/dev/null \
- | sed "s,/mpi,/${class}," \
- | while read line; do
- echo "${line}" >> ${f}
- [[ ${VERBOSE} -ne 0 ]] \
- && einfo "Addition to ${f}: ${line}"
- done
- elif [[ ${VERBOSE} -ne 0 ]]; then
- ewarn "Keys for virtual/${class} already exist. Will not replicate."
- fi
- done
-}
-
-
-
-get_ebuild_dir() {
- local d a
- local want_uses_mpi=${2:-0}
- local found=0
-
- a=($(split_atom ${1}))
- [[ $? -ne 0 ]] && die "Unable to find a unique package or valid version for ${1}."
- is_class_category ${a[0]} && die "It makes no sense to build a new mpi-class from a current one."
-
- if [[ -z ${portage_tree} ]]; then
- for d in $(portageq portdir_overlay) $(portageq portdir); do
- if [[ ${want_uses_mpi} -ne 0 ]]; then
- [[ -f "${d}/${a[0]}/${a[1]}/${a[1]}-${a[2]}.ebuild" ]] \
- && ebuild_uses_mpi ${d}/${a[0]}/${a[1]} ${a[1]}-${a[2]} \
- && found=1
- else
- [[ -f "${d}/${a[0]}/${a[1]}/${a[1]}-${a[2]}.ebuild" ]] && found=1
- fi
- [[ ${found} -ne 0 ]] && break
- done
- if [[ ${found} -ne 0 ]]; then
- portage_tree=${d}
- else
- die "Could not find an ebuild for ${a[0]}/${a[1]}-${a[2]}."
- fi
- fi
-
- ebuild_dir="${portage_tree}/${a[0]}/${a[1]}"
-}
-
-ebuild_uses_mpi() {
- grep 'inherit .*mpi' "${1}/${2##*/}.ebuild" &>/dev/null
-}
-
-link_ebuild_dir() {
- ln -snf "${ebuild_dir}" "${MPI_PORTDIR}"/${class}/${ebuild_dir##*/} \
- || die "Failed to link ${ebuild_dir} to ${MPI_PORTDIR}/${class}/${ebuild_dir##*/}"
-}
-
-# TODO: Needs to be called after get_ebuild_dir which sets $portage_tree
-create_virtual_mpi() {
- local d_dir="${MPI_PORTDIR}"/virtual/${class}
- local version d_file mpi_ebuild s_dir
-
- # Try to get virtual/mpi from the same tree as the other ebuilds.
- # Otherwise we fall back and get it from anywhere.
- version=$(portageq best_visible / ${_virtual_mpi_version})
- version=${version#virtual/mpi-}
-
- for s_dir in ${portage_tree} $(portageq portdir_overlay) $(portageq portdir); do
- mpi_ebuild="${s_dir}"/virtual/mpi/mpi-${version}.ebuild
- [ -f "${mpi_ebuild}" ] && break;
- done
-
- [[ ! -f "${mpi_ebuild}" ]] \
- && die "Cannot satisfy ${_virtual_mpi_version}"
-
- d_file=${class}-${version}.ebuild
-
- mkdir -p "${d_dir}" || die "Could not create ${d_dir}"
-
- cp "${mpi_ebuild}" "${d_dir}"/${d_file} \
- || die "Could not copy ${mpi_ebuild} to ${d_dir}/${d_file}"
-
- sed -i "s,sys-cluster/,${class}/," ${d_dir}/${d_file}
- ebuild ${d_dir}/${d_file} digest > /dev/null \
- || die "Failed to digest ${d_dir}/${d_file}"
-}
-
-
-
-do_emerge() {
- [[ ${DO_EMERGE} -eq 0 ]] && return 0
- einfo "Emerging $*"
- emerge ${emerge_opts} $* || die "emerge failed!"
-}
-
-# We should have only one target here.
-create_class() {
- local mpi_class_pkg d mpi_class_pn
-
- [[ ${#targets[@]} -ne 1 ]] && die "Can only create one class at a time."
-
- for d in $(eselect mpi list -p); do
- [ "${d}" == "${class}" ] && die "${class} has already been created."
- done
-
- # Prevent laziness
- [[ ${targets[0]} == ${targets[0]##*/} ]] \
- && targets[0]="sys-cluster/${targets[0]}"
-
- parse_pkgspecs
- get_ebuild_dir ${targets[0]} 1
- create_virtual_mpi
- mpi_class_pn=${ebuild_dir##*/}
- mpi_class_pkg=${targets[0]}
- handle_etc_portage ${targets[0]}
- targets[0]="=${class}/${targets[0]##*/}"
-
- # Refuse to break systems. If there is already a class
- # installed in that directory, we're not going to add another one as
- # the eclass doesn't fix one problem just to introduce a bigger one.
- for d in $(find ${MPI_PORTDIR}/${class} -maxdepth 1 -mindepth 1 -type l 2>/dev/null);do
- d=${d##*/}
- [[ ${d} == ${mpi_class_pn} ]] && continue
- for i in ${MPI_ALL_IMPS}; do
- [[ ${i} == ${d} ]] \
- && die "${class} already has MPI implementation ${d}, refusing to add ${mpi_class_pn}"
- done
- done
-
- if [[ -d "${MPI_PORTDIR}"/${class} ]]; then
- [[ ${VERBOSE} -ne 0 ]] && ewarn "Overlay for ${class} has already been created."
- else
- mkdir -p ${MPI_PORTDIR}/${class}
- link_ebuild_dir
- fi
- if ! grep "^${class}$" /etc/portage/categories &>/dev/null; then
- echo "${class}" >> /etc/portage/categories
- fi
-
-
-cat << EOF
-Creating ${HILITE}${class}${NORMAL}
- Class: ${GOOD}${class}${NORMAL}
- MPI Implementation: ${GOOD}${mpi_class_pkg}${NORMAL}
- Source: ${GOOD}${ebuild_dir}${NORMAL}
- Destination: ${GOOD}${MPI_PORTDIR}/${class}${NORMAL}
-EOF
- do_emerge ${targets[0]}
-}
-
-
-add_packages(){
- local i j deps
-
- [[ -d "${MPI_PORTDIR}"/${class} ]] || die "Class ${class} has not been created yet."
- [[ ${#targets[@]} -lt 1 ]] && die "You need to specify at least one package"
-
- parse_pkgspecs
- for ((i=0;i<${#targets[@]};i++)); do
- get_ebuild_dir ${targets[i]}
- create_virtual_mpi
- if ebuild_uses_mpi ${ebuild_dir} ${targets[i]}; then
- link_ebuild_dir
- handle_etc_portage ${targets[i]}
- targets[i]="=${class}/${targets[i]##*/}"
- else
- targets[i]="=${targets[i]}"
- fi
-
- # I don't know about this, but do you have a better idea?
- deps="$(emerge --color=n --onlydeps -p --quiet ${targets[i]})"
- if [[ $? -ne 0 ]]; then
- emerge --onlydeps -p ${targets[i]}
- die "Unable to calculate deps for ${targets[i]}"
- fi
- deps=( $(echo ${deps} | sed -e 's:\[[a-z]* [A-Z] \] :=:g') )
- for ((j=0;j<${#deps[@]};j++)); do
- get_ebuild_dir ${deps[j]}
- if ebuild_uses_mpi ${deps[i]}; then
- link_ebuild_dir
- fi
- done
- done
-cat << EOF
-Adding packages to ${HILIGHT}${class}${NORMAL}
- Packages: ${GOOD}${targets[@]}${NORMAL}
-EOF
- do_emerge ${targets[@]}
-}
-
-
-delete_class() {
- local pkgs=( $(ls /var/db/pkg/${class}/ 2>/dev/null) )
- local ext d i rc
- [[ -d "${MPI_PORTDIR}"/${class} ]] || die "Class ${class} has not been created yet."
- rc=0
-
- for (( i=0; i<${#pkgs[@]}; i++)); do
- pkgs[i]="=${class}/${pkgs[i]}"
- done
-
- if [[ ${#pkgs[@]} -gt 0 ]] && ! emerge -C ${emerge_opts/-u/} ${pkgs[@]}; then
- die "Failed to unmerge ${pkgs[@]}"
- fi
-
- for ext in "keywords" "use"; do
- if [ -d /etc/portage/package.${ext} ]; then
- rm /etc/portage/package.${ext}/${class} &>/dev/null
- rc=$((rc+$?))
- elif [ -f /etc/portage/package.${ext} ]; then
- sed -i -e "/^${class}\//d" /etc/portage/package.${ext}
- rc=$((rc+$?))
- fi
- done
-
- [ ! -f /etc/portage/categories ] || sed -i -e "/^${class}$/d" /etc/portage/categories
- rc=$((rc+$?))
-
- for d in $(ls "${MPI_PORTDIR}"/${class}/ 2>/dev/null); do
- rm "${MPI_PORTDIR}"/${class}/${d}
- rc=$((rc+$?))
- done
-
- for d in "${MPI_PORTDIR}/${class}" /var/db/pkg/${class}; do
- [ ! -d "${d}" ] || rmdir "${d}"
- rc=$((rc+$?))
- done
-
- [[ ${rc} -ne 0 ]] \
- && ewarn "Errors were encountered during delete_class()"
- return ${rc}
-}
-
-# Internal variables.
-_virtual_mpi_version=">=virtual/mpi-2.0"
-
-[[ ${UID} -ne 0 ]] && die "You must be root."
-DO_EMERGE=1
-VERBOSE=0
-targets=""
-emerge_opts="-u" # Packages can be recompiled by hand if necessary.
-portage_tree=""
-action=""
-
-while [[ $# -gt 0 ]]; do
- case $1 in
- -h|--help)
- usage;;
- -c|--create)
- action="${action}create";;
- -a|--add)
- action="${action}add";;
- -d|--delete)
- action="${action}delete"
- shift; class=${1};;
- -C|--class)
- shift; class=${1};;
- -t|--tree)
- shift; portage_tree=${1};;
- -o|--overlaydir)
- shift; MPI_PORTDIR=${1};;
- -v|--verbose)
- VERBOSE=1;;
- --noemerge)
- DO_EMERGE=0;;
- -*)
- emerge_opts="${emerge_opts} ${1}";;
- *)
- targets=( $(echo ${targets[@]}) ${1} );;
- esac
- shift
-done
-
-if [ -z "${MPI_PORTDIR}" ]; then
- MPI_PORTDIR="$(portageq portdir_overlay)"
- MPI_PORTDIR="${MPI_PORTDIR%% *}"
-fi
-
-if [ ! -d "${MPI_PORTDIR}" ]; then
- mkdir -p "${MPI_PORTDIR}" || die "Failed to mkdir ${MPI_PORTDIR}"
-fi
-
-export PORTDIR_OVERLAY="${MPI_PORTDIR} $(portageq portdir_overlay)"
-export PKGDIR="$(portageq envvar PKGDIR)/mpi/${class}"
-
-[[ -z ${action} ]] && usage 1 "No action defined."
-class_is_valid
-
-[[ ${action} == *create* ]] && create_class
-[[ ${action} == *add* ]] && add_packages
-[[ ${action} == *delete* ]] && delete_class
diff --git a/sys-cluster/empi/files/empi-0.8 b/sys-cluster/empi/files/empi-0.8
new file mode 100755
index 000000000..a1e6009b6
--- /dev/null
+++ b/sys-cluster/empi/files/empi-0.8
@@ -0,0 +1,492 @@
+#!/bin/bash
+VERSION=0.8
+
+source /etc/init.d/functions.sh
+
+die(){
+ if [ -n "${1}" ]; then
+ echo; eerror $1; echo
+ fi
+ exit 1
+}
+
+has() {
+ [[ " ${@:2} " == *" $1 "* ]]
+}
+
+usage(){
+ local rc=${1:-0}
+ shift
+cat <<-EOF
+empi-${VERSION}
+Usage: ${HILITE}empi${NORMAL} ${GOOD}[actions]${NORMAL} ${BRACKET}[options]${NORMAL}
+
+Actions:
+ ${GOOD}-c, --create${NORMAL} pkgspec (Re)Initialize setup for mpi class.
+ ${GOOD}-a, --add${NORMAL} pkgspec(s) Add packages using specified mpi class.
+ ${GOOD}-d, --delete${NORMAL} class Remove everything related to specified class.
+
+Options:
+ ${GOOD}-C, --class${NORMAL} class MPI class to use.
+ ${GOOD}-t, --tree${NORMAL} path Path to portage tree to use ebuilds from.
+ ${GOOD}-o, --overlaydir${NORMAL} path Directory to use for the empi portage overlay.
+ Defaults to MPI_OVERLAY_DIR [${DEFAULT_MPI_OVERLAY_DIR}]
+ ${GOOD} --noemerge${NORMAL} Do not call emerge, only preform overlay setup.
+
+Notes:
+ ${HILITE}-${NORMAL} pkgspec is specified by a package string. Without a version, the
+ portageq best_visible is used. For example, all of the following
+ are valid: openmpi, sys-cluster/openmpi, =sys-cluster/openmpi-1.2.5.
+ ${HILITE}-${NORMAL} class (-c) is user defined but must be prefixed with "mpi-"
+
+Examples:
+${BRACKET}Create a new class based on openmpi.${NORMAL}
+ empi --create sys-cluster/openmpi --class mpi-ompi
+${BRACKET}Rebuild the above.${NORMAL}
+ emerge mpi-ompi/openmpi
+${BRACKET}Add hpl to mpi-ompi${NORMAL}
+ empi --class mpi-ompi --add sys-cluster/hpl
+EOF
+ [[ -n $* ]] && echo && eerror "Error: $*"
+ exit ${rc}
+}
+
+class_is_valid() {
+ [[ -z ${CLASS} ]] && usage 1 "No class defined."
+ [[ ${CLASS} != mpi-* ]] && usage 1 "Classes must be prefixed with mpi-"
+ [[ ${CLASS//./} != ${CLASS} ]] && usage 1 "Classes cannot contain . (period)"
+}
+
+is_class_category() {
+ local i
+ for i in $(eselect mpi list -p); do
+ [[ ${1} == ${i} ]] && return 0
+ done
+ return 1
+}
+
+split_atom() {
+ local cpv c pf pn pv
+ cpv=$(portageq best_visible / ${1})
+ if [[ -z ${cpv} || ${rc} -ne 0 ]]; then
+ cpv=$(portageq best_visible / =${1})
+ [[ -z ${cpv} || ${rc} -ne 0 ]] && return 1
+ fi
+ c=${cpv%/*}; pf=${cpv#${c}/}; pn=${pf%%-[0-9]*}; pv=${pf#${pn}-}
+ echo "${c} ${pn} ${pv}"
+}
+
+parse_pkgspecs() {
+ local atom i
+ for ((i=0; i<${#TARGETS[@]}; i++)); do
+ atom=($(split_atom ${TARGETS[i]}))
+ if [[ $? -ne 0 ]]; then
+ eerror "Unable to find a unique package or valid version for ${TARGETS[i]}"
+ eerror "Is the package unmasked and unblocked normally?"
+ die ""
+ fi
+ TARGETS[i]=${atom[0]}/${atom[1]}-${atom[2]}
+ done
+}
+
+# handle_etc_portage package_spec
+# parses /etc/portage/package.{keywords,use}. If ${CLASS}/${pn} is seen, we don't
+# do a thing. Otherwise copy any lines that have ${cat}/${pn} inserting them again
+# with the new category. Also keywords virtual/${CLASS} if necessary.
+handle_etc_portage() {
+ local atom=( $(split_atom ${1}) )
+ local ext line gfiles f
+
+ for ext in "keywords" "use"; do
+ if [ -d /etc/portage/package.${ext} ]; then
+ gfiles="/etc/portage/package.${ext}/*"
+ f=/etc/portage/package.${ext}/${CLASS}
+ else
+ gfiles="/etc/portage/package.${ext}"
+ f=/etc/portage/package.${ext}
+ fi
+
+ if ! grep "^[>=<]*${CLASS}/${atom[1]}" ${gfiles} &>/dev/null; then
+ grep -h "^[>=<]*${atom[0]}/${atom[1]}" ${gfiles} 2>/dev/null \
+ | sed "s,${atom[0]},${CLASS}," \
+ | while read line; do
+ echo "${line}" >> ${f}
+ [[ ${VERBOSE} -ne 0 ]] \
+ && einfo "Addition to ${f}: ${line}"
+ done
+ elif [[ ${VERBOSE} -ne 0 ]]; then
+ ewarn "Keys for ${CLASS}/${atom[1]} already exist in ${f}. Will not replicate them."
+ fi
+
+ if ! grep "^${CLASS}/mpi" ${gfiles} &>/dev/null; then
+ grep -h "^virtual/mpi" ${gfiles} 2>/dev/null \
+ | sed "s,/mpi,/${CLASS}," \
+ | while read line; do
+ echo "${line}" >> ${f}
+ [[ ${VERBOSE} -ne 0 ]] \
+ && einfo "Addition to ${f}: ${line}"
+ done
+ elif [[ ${VERBOSE} -ne 0 ]]; then
+ ewarn "Keys for virtual/${CLASS} already exist. Will not replicate."
+ fi
+ done
+}
+
+
+
+get_ebuild_dir() {
+ local d a
+ local want_uses_mpi=${2:-0}
+ local found=0
+
+ a=($(split_atom ${1}))
+ [[ $? -ne 0 ]] && die "Unable to find a unique package or valid version for ${1}."
+ is_class_category ${a[0]} && die "It makes no sense to build a new mpi-class from a current one."
+
+ if [[ -z ${PORTAGE_TREE} ]]; then
+ for d in $(portageq portdir_overlay) $(portageq portdir); do
+ if [[ ${want_uses_mpi} -ne 0 ]]; then
+ [[ -f "${d}/${a[0]}/${a[1]}/${a[1]}-${a[2]}.ebuild" ]] \
+ && ebuild_uses_mpi ${d}/${a[0]}/${a[1]} ${a[1]}-${a[2]} \
+ && found=1
+ else
+ [[ -f "${d}/${a[0]}/${a[1]}/${a[1]}-${a[2]}.ebuild" ]] && found=1
+ fi
+ [[ ${found} -ne 0 ]] && break
+ done
+ if [[ ${found} -ne 0 ]]; then
+ PORTAGE_TREE=${d}
+ else
+ die "Could not find an ebuild for ${a[0]}/${a[1]}-${a[2]}."
+ fi
+ fi
+
+ EBUILD_DIR="${PORTAGE_TREE}/${a[0]}/${a[1]}"
+}
+
+ebuild_uses_mpi() {
+ grep 'inherit .*mpi' "${1}/${2##*/}.ebuild" &>/dev/null
+}
+
+link_ebuild_dir() {
+ ln -snf "${EBUILD_DIR}" "${MPI_OVERLAY_DIR}"/${CLASS}/${EBUILD_DIR##*/} \
+ || die "Failed to link ${EBUILD_DIR} to ${MPI_OVERLAY_DIR}/${CLASS}/${EBUILD_DIR##*/}"
+}
+
+# TODO: Needs to be called after get_ebuild_dir which sets $PORTAGE_TREE
+create_virtual_mpi() {
+ local d_dir="${MPI_OVERLAY_DIR}"/virtual/${CLASS}
+ local version d_file mpi_ebuild s_dir
+
+ # Try to get virtual/mpi from the same tree as the other ebuilds.
+ # Otherwise we fall back and get it from anywhere.
+ version=$(portageq best_visible / ${__VIRTUAL_MPI_VERSION})
+ version=${version#virtual/mpi-}
+
+ for s_dir in ${PORTAGE_TREE} $(portageq portdir_overlay) $(portageq portdir); do
+ mpi_ebuild="${s_dir}"/virtual/mpi/mpi-${version}.ebuild
+ [ -f "${mpi_ebuild}" ] && break;
+ done
+
+ [[ ! -f "${mpi_ebuild}" ]] \
+ && die "Cannot satisfy ${__VIRTUAL_MPI_VERSION}"
+
+ d_file=${CLASS}-${version}.ebuild
+
+ mkdir -p "${d_dir}" || die "Could not create ${d_dir}"
+
+ cp "${mpi_ebuild}" "${d_dir}"/${d_file} \
+ || die "Could not copy ${mpi_ebuild} to ${d_dir}/${d_file}"
+
+ sed -i "s,sys-cluster/,${CLASS}/," ${d_dir}/${d_file}
+ ebuild ${d_dir}/${d_file} digest > /dev/null \
+ || die "Failed to digest ${d_dir}/${d_file}"
+}
+
+set_metadata() {
+ # Snagged from crossdev: http://git.overlays.gentoo.org/gitweb/?p=proj/crossdev.git
+ # 3cab8c394fec72f2353e209d98429dd1aaf1d337
+
+ # for people who have eclasses spread over their overlays, generate
+ # a layout.conf file so portage can find them. this is a crapshoot
+ # when diff overlay sources have conflicting eclasses, but nothing
+ # we really can do about that.
+ local autogen_tag="# Autogenerated and managed by empi"
+ local meta=${MPI_OVERLAY_DIR}/metadata
+ local layout=${meta}/layout.conf
+ local d name masters thin_manifests="false"
+
+ mkdir -p "${meta}"
+ if [[ -e ${layout} ]] ; then
+ if ! grep -qs "^${autogen_tag}" "${layout}" ; then
+ einfo "leaving metadata/layout.conf alone in ${MPI_OVERLAY_DIR}"
+ return
+ fi
+
+ # We are managing it, so blow it away
+ rm -f "${layout}"
+ fi
+
+ # build up a list of possible repos where we can pull from
+ for d in ${PORTDIR_OVERLAY} "${PORTDIR}" ; do
+ [[ -z ${d} ]] && continue
+
+ name=
+ if [[ -e ${d}/profiles/repo_name ]] ; then
+ name=$(<"${d}"/profiles/repo_name)
+ fi
+ [[ -z ${name} ]] && continue
+
+ # If this repo has an eclass dir, mark it as a master.
+ # Note: portage reads the masters list in reverse order,
+ # so we have to prepare it the same way.
+ if [[ -d ${d}/eclass ]] ; then
+ has ${name} ${masters} || masters="${name} ${masters}"
+ fi
+
+ # If one of the overlays uses thin manifests, then turn it on
+ if [[ -z ${this_manifests} ]] && has ${name} ${masters} && \
+ sed \
+ -e 's:#.*::' \
+ -e 's:^[[:space:]]*::' \
+ -e 's:[[:space:]]*$::' \
+ -e 's:[[:space:]]*=[[:space:]]*:=:' \
+ "${d}/metadata/layout.conf" 2>/dev/null | \
+ gawk -F= '{
+ if ($1 == "use-manifests") um = $2
+ if ($1 == "thin-manifests") tm = $2
+ }
+ END {
+ exit !(um != "false" && tm == "true")
+ }'
+ then
+ einfo "enabling thin-manifests due to ${d}"
+ this_manifests="use-manifests = true\nthin-manifests = true"
+ fi
+ done
+
+ # write out that layout.conf!
+ cat <<-EOF > "${layout}"
+ ${autogen_tag}
+ # Delete the above line if you want to manage this file yourself
+ masters = ${masters% }
+ $(printf '%b' "${this_manifests}")
+ EOF
+}
+
+do_emerge() {
+ [[ ${DO_EMERGE} -eq 0 ]] && return 0
+ einfo "Emerging $*"
+ emerge ${EMERGE_OPTS} $* || die "emerge failed!"
+}
+
+# We should have only one target here.
+create_class() {
+ local mpi_class_pkg d mpi_class_pn
+
+ [[ ${#TARGETS[@]} -ne 1 ]] && die "Can only create one class at a time."
+
+ for d in $(eselect mpi list -p); do
+ [ "${d}" == "${CLASS}" ] && die "${CLASS} has already been created."
+ done
+
+ # Prevent laziness
+ [[ ${TARGETS[0]} == ${TARGETS[0]##*/} ]] \
+ && TARGETS[0]="sys-cluster/${TARGETS[0]}"
+
+ parse_pkgspecs
+ get_ebuild_dir ${TARGETS[0]} 1
+ create_virtual_mpi
+ mpi_class_pn=${EBUILD_DIR##*/}
+ mpi_class_pkg=${TARGETS[0]}
+ handle_etc_portage ${TARGETS[0]}
+ TARGETS[0]="=${CLASS}/${TARGETS[0]##*/}"
+
+ # Refuse to break systems. If there is already a class
+ # installed in that directory, we're not going to add another one as
+ # the eclass doesn't fix one problem just to introduce a bigger one.
+ for d in $(find ${MPI_OVERLAY_DIR}/${CLASS} -maxdepth 1 -mindepth 1 -type l 2>/dev/null);do
+ d=${d##*/}
+ [[ ${d} == ${mpi_class_pn} ]] && continue
+ for i in ${MPI_ALL_IMPS}; do
+ [[ ${i} == ${d} ]] \
+ && die "${CLASS} already has MPI implementation ${d}, refusing to add ${mpi_class_pn}"
+ done
+ done
+
+ if [[ -d "${MPI_OVERLAY_DIR}"/${CLASS} ]]; then
+ [[ ${VERBOSE} -ne 0 ]] && ewarn "Overlay for ${CLASS} has already been created."
+ else
+ mkdir -p ${MPI_OVERLAY_DIR}/${CLASS}
+ link_ebuild_dir
+ set_metadata
+ fi
+ if ! grep "^${CLASS}$" /etc/portage/categories &>/dev/null; then
+ echo "${CLASS}" >> /etc/portage/categories
+ fi
+
+
+cat << EOF
+Creating ${HILITE}${CLASS}${NORMAL}
+ Class: ${GOOD}${CLASS}${NORMAL}
+ MPI Implementation: ${GOOD}${mpi_class_pkg}${NORMAL}
+ Source: ${GOOD}${EBUILD_DIR}${NORMAL}
+ Destination: ${GOOD}${MPI_OVERLAY_DIR}/${CLASS}${NORMAL}
+EOF
+ do_emerge ${TARGETS[0]}
+}
+
+
+add_packages(){
+ local i j deps
+
+ [[ -d "${MPI_OVERLAY_DIR}"/${CLASS} ]] || die "Class ${CLASS} has not been created yet."
+ [[ ${#TARGETS[@]} -lt 1 ]] && die "You need to specify at least one package"
+
+ parse_pkgspecs
+ for ((i=0;i<${#TARGETS[@]};i++)); do
+ get_ebuild_dir ${TARGETS[i]}
+ create_virtual_mpi
+ if ebuild_uses_mpi ${EBUILD_DIR} ${TARGETS[i]}; then
+ link_ebuild_dir
+ handle_etc_portage ${TARGETS[i]}
+ TARGETS[i]="=${CLASS}/${TARGETS[i]##*/}"
+ else
+ TARGETS[i]="=${TARGETS[i]}"
+ fi
+
+ # I don't know about this, but do you have a better idea?
+ deps="$(emerge --color=n --onlydeps -p --quiet ${TARGETS[i]})"
+ if [[ $? -ne 0 ]]; then
+ emerge --onlydeps -p ${TARGETS[i]}
+ die "Unable to calculate deps for ${TARGETS[i]}"
+ fi
+ deps=( $(echo ${deps} | sed -e 's:\[[a-z]* [A-Z] \] :=:g') )
+ for ((j=0;j<${#deps[@]};j++)); do
+ get_ebuild_dir ${deps[j]}
+ if ebuild_uses_mpi ${deps[i]}; then
+ link_ebuild_dir
+ fi
+ done
+ done
+cat << EOF
+Adding packages to ${HILIGHT}${CLASS}${NORMAL}
+ Packages: ${GOOD}${TARGETS[@]}${NORMAL}
+EOF
+ do_emerge ${TARGETS[@]}
+}
+
+
+delete_class() {
+ local pkgs=( $(ls /var/db/pkg/${CLASS}/ 2>/dev/null) )
+ local ext d i rc
+ [[ -d "${MPI_OVERLAY_DIR}"/${CLASS} ]] || die "Class ${CLASS} has not been created yet."
+ rc=0
+
+ for (( i=0; i<${#pkgs[@]}; i++)); do
+ pkgs[i]="=${CLASS}/${pkgs[i]}"
+ done
+
+ if [[ ${#pkgs[@]} -gt 0 ]] && ! emerge -C ${EMERGE_OPTS/-u/} ${pkgs[@]}; then
+ die "Failed to unmerge ${pkgs[@]}"
+ fi
+
+ for ext in "keywords" "use"; do
+ if [ -d /etc/portage/package.${ext} ]; then
+ rm /etc/portage/package.${ext}/${CLASS} &>/dev/null
+ rc=$((rc+$?))
+ elif [ -f /etc/portage/package.${ext} ]; then
+ sed -i -e "/^${CLASS}\//d" /etc/portage/package.${ext}
+ rc=$((rc+$?))
+ fi
+ done
+
+ [ ! -f /etc/portage/categories ] || sed -i -e "/^${CLASS}$/d" /etc/portage/categories
+ rc=$((rc+$?))
+
+ for d in $(ls "${MPI_OVERLAY_DIR}"/${CLASS}/ 2>/dev/null); do
+ rm "${MPI_OVERLAY_DIR}"/${CLASS}/${d}
+ rc=$((rc+$?))
+ done
+
+ for d in "${MPI_OVERLAY_DIR}/${CLASS}" /var/db/pkg/${CLASS}; do
+ [ ! -d "${d}" ] || rmdir "${d}"
+ rc=$((rc+$?))
+ done
+
+ [[ ${rc} -ne 0 ]] \
+ && ewarn "Errors were encountered during delete_class()"
+ return ${rc}
+}
+
+# Internal variables.
+__VIRTUAL_MPI_VERSION=">=virtual/mpi-2.0"
+
+ACTION=""
+CLASS=""
+PORTAGE_TREE=""
+MPI_OVERLAY_DIR=""
+VERBOSE=0
+DO_EMERGE=1
+EMERGE_OPTS="-u" # Packages can be recompiled by hand if necessary.
+TARGETS=""
+DEFAULT_MPI_OVERLAY_DIR=/var/cache/overlays/mpi
+
+PORTDIR_OVERLAY=""
+PKGDIR=""
+
+EBUILD_DIR=""
+
+while [[ $# -gt 0 ]]; do
+ case $1 in
+ -h|--help)
+ usage;;
+ -c|--create)
+ ACTION="${ACTION}create";;
+ -a|--add)
+ ACTION="${ACTION}add";;
+ -d|--delete)
+ ACTION="${ACTION}delete"
+ shift; CLASS=${1};;
+ -C|--class)
+ shift; CLASS=${1};;
+ -t|--tree)
+ shift; PORTAGE_TREE=${1};;
+ -o|--overlaydir)
+ shift; MPI_OVERLAY_DIR=${1};;
+ -v|--verbose)
+ VERBOSE=1;;
+ --noemerge)
+ DO_EMERGE=0;;
+ -*)
+ EMERGE_OPTS="${EMERGE_OPTS} ${1}";;
+ *)
+ TARGETS=( $(echo ${TARGETS[@]}) ${1} );;
+ esac
+ shift
+done
+
+[[ ${UID} -ne 0 ]] && die "You must be root to preform any actions."
+
+: ${MPI_OVERLAY_DIR:=$(portageq envvar MPI_OVERLAY_DIR)}
+if [ -z "${MPI_OVERLAY_DIR}" ]; then
+ MPI_OVERLAY_DIR=${DEFAULT_MPI_OVERLAY_DIR}
+ einfo "MPI_OVERLAY_DIR not set, defaulting to ${MPI_OVERLAY_DIR} and updating /etc/make.conf"
+ echo "MPI_OVERLAY_DIR=\"${MPI_OVERLAY_DIR}\"" >> /etc/make.conf
+fi
+
+if [ ! -d "${MPI_OVERLAY_DIR}" ]; then
+ mkdir -p "${MPI_OVERLAY_DIR}" || die "Failed to mkdir ${MPI_OVERLAY_DIR}"
+fi
+
+export PORTDIR_OVERLAY="${MPI_OVERLAY_DIR} $(portageq portdir_overlay)"
+export PKGDIR="$(portageq envvar PKGDIR)/mpi/${CLASS}"
+export PORTDIR="$(portageq envvar PORTDIR)"
+
+[[ -z ${ACTION} ]] && usage 1 "No action defined."
+class_is_valid
+
+set_metadata
+[[ ${ACTION} == *create* ]] && create_class
+[[ ${ACTION} == *add* ]] && add_packages
+[[ ${ACTION} == *delete* ]] && delete_class
diff --git a/sys-cluster/empi/files/eselect.mpi-0.7 b/sys-cluster/empi/files/eselect.mpi-0.8
index 6aa6d65f2..e1f0902a9 100644
--- a/sys-cluster/empi/files/eselect.mpi-0.7
+++ b/sys-cluster/empi/files/eselect.mpi-0.8
@@ -1,4 +1,4 @@
-# Copyright 1999-2005 Gentoo Foundation
+# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id: $