diff options
Diffstat (limited to 'sys-cluster/empi/files/empi-0.2.patch')
-rw-r--r-- | sys-cluster/empi/files/empi-0.2.patch | 110 |
1 files changed, 110 insertions, 0 deletions
diff --git a/sys-cluster/empi/files/empi-0.2.patch b/sys-cluster/empi/files/empi-0.2.patch new file mode 100644 index 000000000..6076034fd --- /dev/null +++ b/sys-cluster/empi/files/empi-0.2.patch @@ -0,0 +1,110 @@ +diff -urN a/empi b/empi +--- a/empi 2008-03-10 19:52:32.000000000 -0400 ++++ b/empi 2008-03-10 19:53:31.000000000 -0400 +@@ -1,16 +1,8 @@ + #!/bin/bash + + source /etc/init.d/functions.sh +-#[ -f /etc/empi.conf ] && source /etc/empi.conf +-MPI_IMPS="openmpi lam-mpi" +-MPI_ALL_IMPS="mpich mpich2 openmpi lam-mpi" + VERBOSE=0 + +-[[ -z ${MPI_PORTDIR} ]] \ +- && MPI_PORTDIR="$(portageq portdir_overlay)" \ +- && MPI_PORTDIR="${MPI_PORTDIR%% *}" \ +- +-[[ -z ${COMPILER} ]] && COMPILER=gcc + # imp (category) Implementation we're installing for. mpi-* + # targets Packages to run action on. When creating, the implementation to use. + # action create, add, update, remove. +@@ -32,9 +24,9 @@ + ${GOOD}-c, --create${NORMAL} (Re)Initialize setup for implementation. + ${GOOD}-a, --add${NORMAL} pkgspec(s) Add packages using specified implementation. + ${GOOD}-i, --implementation${NORMAL} imp Implementation to use. +- ${GOOD}-l, --list${NORMAL} List installed implementations. + ${GOOD}-t, --tree${NORMAL} path Path to portage tree to use ebuilds from. + ${GOOD}-d, --delete${NORMAL} imp Remove everything related to specified implementation. ++ ${GOOD}-o, --overlaydir${NORMAL} path Directory to use for the empi portage overlay. + + pkgspec is specified by a package string. Without a version, the best_visible is used. + openmpi, sys-cluster/openmpi, =sys-cluster/openmpi-1.2.5 +@@ -150,11 +142,6 @@ + grep 'inherit .*mpi' "${1}/${2##*/}.ebuild" &>/dev/null + } + +-setup_portage_vars() { +- export PORTDIR_OVERLAY="${MPI_PORTDIR} $(portageq portdir_overlay)" +- export PKGDIR="$(portageq envvar PKGDIR)/mpi/${imp}" +-} +- + link_ebuild_dir() { + ln -snf "${ebuild_dir}" "${MPI_PORTDIR}"/${imp}/${ebuild_dir##*/} \ + || die "Failed to link ${ebuild_dir} to ${MPI_PORTDIR}/${imp}/${ebuild_dir##*/}" +@@ -162,7 +149,6 @@ + + do_emerge() { + ebegin "Emerging $*" +- setup_portage_vars + emerge ${emerge_opts} $* || die "emerge failed!" + eend + } +@@ -172,7 +158,11 @@ + local mpi_imp_pkg d mpi_imp_pn + + [[ ${#targets[@]} -ne 1 ]] && die "Can only create one implementation at a time." +- ++ ++ for d in $(eselect mpi list -p); do ++ [ "${d}" == "${imp}" ] && die "${imp} has already been created." ++ done ++ + # Prevent laziness + [[ ${targets[0]} == ${targets[0]##*/} ]] \ + && targets[0]="sys-cluster/${targets[0]}" +@@ -187,7 +177,7 @@ + # Refuse to break systems. If there is already an implementation + # 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}/${imp} -maxdepth 1 -mindepth 1 -type l);do ++ for d in $(find ${MPI_PORTDIR}/${imp} -maxdepth 1 -mindepth 1 -type l 2>/dev/null);do + d=${d##*/} + [[ ${d} == ${mpi_imp_pn} ]] && continue + for i in ${MPI_ALL_IMPS}; do +@@ -197,7 +187,7 @@ + done + + if [[ -d "${MPI_PORTDIR}"/${imp} ]]; then +- [[ ${VERBOSE} -ne 0 ]] && ewarn "${imp} has already been created." ++ [[ ${VERBOSE} -ne 0 ]] && ewarn "Overlay for ${imp} has already been created." + else + mkdir -p ${MPI_PORTDIR}/${imp} + link_ebuild_dir +@@ -307,6 +297,8 @@ + shift; imp=${1};; + -t|--tree) + shift; portage_tree=${1};; ++ -o|--overlaydir) ++ shift; MPI_PORTDIR=${1};; + -v|--verbose) + VERBOSE=1;; + -*) +@@ -317,6 +309,18 @@ + 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/${imp}" ++ + [[ -z ${action} ]] && usage 1 "No action defined." + [[ -z ${imp} ]] && usage 1 "No implementation defined." + imp_is_valid |