aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories/e/ebuild/exheres-0
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-01-08 10:45:07 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-01-08 10:45:07 +0000
commit86b9e9ba407f1f0f1530e4fde6056785fed68869 (patch)
tree3544423b7d8bbc3535b2dcd1fa22858a26e83ef8 /paludis/repositories/e/ebuild/exheres-0
parentcc2065217d1acd31ffa4c10530eae72b2321e169 (diff)
downloadpaludis-86b9e9ba407f1f0f1530e4fde6056785fed68869.tar.gz
paludis-86b9e9ba407f1f0f1530e4fde6056785fed68869.tar.xz
Split up exheres and pms-derived EAPIs. Start suing 'default' for exheres. Use different coloured >>>/=== for different EAPIs.
Diffstat (limited to 'paludis/repositories/e/ebuild/exheres-0')
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/Makefile.am38
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/builtin_fetch.bash138
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/builtin_infovars.bash54
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/builtin_init.bash95
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/builtin_loadenv.bash48
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/builtin_metadata.bash41
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/builtin_prepare.bash49
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/builtin_saveenv.bash44
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/builtin_strip.bash86
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/builtin_tidyup.bash43
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/builtin_variable.bash23
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/conditional_functions_TEST.bash45
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/eclass_functions.bash82
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/exlib_functions.bash83
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/list_functions_TEST.bash74
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/output_functions.bash30
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/pkg_config.bash51
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/pkg_info.bash43
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/pkg_nofetch.bash11
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/pkg_postinst.bash51
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/pkg_postrm.bash52
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/pkg_preinst.bash51
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/pkg_prerm.bash51
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/pkg_pretend.bash44
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/pkg_setup.bash51
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/src_compile.bash54
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/src_install.bash51
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/src_test.bash74
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/src_unpack.bash47
29 files changed, 1457 insertions, 147 deletions
diff --git a/paludis/repositories/e/ebuild/exheres-0/Makefile.am b/paludis/repositories/e/ebuild/exheres-0/Makefile.am
index 64e1bc73c..fcc15c34a 100644
--- a/paludis/repositories/e/ebuild/exheres-0/Makefile.am
+++ b/paludis/repositories/e/ebuild/exheres-0/Makefile.am
@@ -5,28 +5,53 @@ SUBDIRS = .
libexecprogexheresdir = $(libexecdir)/paludis/exheres-0
libexecprogexheres_SCRIPTS = \
- builtin_fetch.bash \
- pkg_nofetch.bash \
- list_functions.bash \
+ builtin_infovars.bash \
+ builtin_init.bash \
+ builtin_loadenv.bash \
+ builtin_metadata.bash \
+ builtin_prepare.bash \
+ builtin_saveenv.bash \
+ builtin_strip.bash \
+ builtin_tidyup.bash \
+ builtin_variable.bash \
conditional_functions.bash \
+ eclass_functions.bash \
ever_functions.bash \
- portage_stubs.bash
+ exlib_functions.bash \
+ list_functions.bash \
+ output_functions.bash \
+ pkg_config.bash \
+ pkg_info.bash \
+ pkg_nofetch.bash \
+ pkg_postinst.bash \
+ pkg_postrm.bash \
+ pkg_preinst.bash \
+ pkg_prerm.bash \
+ pkg_pretend.bash \
+ pkg_setup.bash \
+ portage_stubs.bash \
+ src_compile.bash \
+ src_install.bash \
+ src_test.bash \
+ src_unpack.bash
TESTS_ENVIRONMENT = env \
PALUDIS_EBUILD_DIR="$(top_srcdir)/paludis/repositories/e/ebuild/" \
PALUDIS_EBUILD_DIR_FALLBACK="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/repositories/e/ebuild/`" \
PALUDIS_EAPIS_DIR="$(top_srcdir)/paludis/eapis/" \
+ PALUDIS_EXTRA_EBUILD_MODULES_DIRS="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/util/`" \
PALUDIS_DISTRIBUTIONS_DIR="$(top_srcdir)/paludis/distributions/" \
PALUDIS_DISTRIBUTION="gentoo" \
PALUDIS_EBUILD_LOG_LEVEL="warning" \
+ PALUDIS_EBUILD_MODULE_SUFFIXES="exheres-0" \
TOP_BUILD_DIR="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/`" \
TEST_SCRIPT_DIR="$(srcdir)/" \
bash $(top_srcdir)/test/run_test.sh $(top_srcdir)/paludis/repositories/e/ebuild/run_test.bash
-TESTS =
+TESTS = conditional_functions_TEST.bash list_functions_TEST.bash
check_SCRIPTS = $(TESTS)
-EXTRA_DIST = $(libexecprogexheres_SCRIPTS)
+EXTRA_DIST = $(libexecprogexheres_SCRIPTS) $(check_SCRIPTS)
built-sources : $(BUILT_SOURCES)
for s in `echo $(SUBDIRS) | tr -d .` ; do $(MAKE) -C $$s built-sources || exit 1 ; done
@@ -38,3 +63,4 @@ distcheck-deps : distcheck-deps-subdirs
distcheck-deps-subdirs :
for s in $(SUBDIRS) . ; do if test x$$s = x. ; then $(MAKE) distcheck-deps-local || exit 1 ; \
else $(MAKE) -C $$s distcheck-deps || exit 1 ; fi ; done
+
diff --git a/paludis/repositories/e/ebuild/exheres-0/builtin_fetch.bash b/paludis/repositories/e/ebuild/exheres-0/builtin_fetch.bash
deleted file mode 100644
index 93b30e9c1..000000000
--- a/paludis/repositories/e/ebuild/exheres-0/builtin_fetch.bash
+++ /dev/null
@@ -1,138 +0,0 @@
-#!/bin/bash
-# vim: set sw=4 sts=4 et :
-
-# Copyright (c) 2006, 2007 Ciaran McCreesh
-#
-# This file is part of the Paludis package manager. Paludis is free software;
-# you can redistribute it and/or modify it under the terms of the GNU General
-# Public License, version 2, as published by the Free Software Foundation.
-#
-# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
-# details.
-#
-# You should have received a copy of the GNU General Public License along with
-# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-# Place, Suite 330, Boston, MA 02111-1307 USA
-
-builtin_fetch()
-{
- [[ -d "${FETCHEDDIR}" ]] || die "FETCHEDDIR \"${FETCHEDDIR}\" is not a directory"
-
- local a nofetch unique_aa old_aa
- for a in ${FLAT_SRC_URI} ; do
- local aa=${a##*/}
- hasq "${aa}" ${unique_aa} || unique_aa="${unique_aa} ${aa}"
-
- if [[ -f "${FETCHEDDIR}/${aa}" ]] && [[ "0" != $(wrapped_getfsize "${FETCHEDDIR}/${aa}") ]] ; then
- if [[ "${old_aa}" != "${aa}" ]] ; then
- ebuild_section "Already have ${aa}"
- old_aa="${aa}"
- fi
- else
- if [[ -f "${FETCHEDDIR}/${aa}" ]] ; then
- ebuild_section "Trying to remove existing ${aa}..."
- rm -f "${FETCHEDDIR}/${aa}"
- fi
-
- if ! hasq fetch ${RESTRICT} ; then
- if [[ "${old_aa}" != "${aa}" ]] ; then
- ebuild_section "Need to fetch ${aa}"
- old_aa="${aa}"
- fi
- local d
- for d in ${PALUDIS_FETCHERS_DIRS:-${PALUDIS_EBUILD_DIR}/fetchers/} ; do
- prg=${d}/do$(echo ${a%%://*} | tr '[:upper:]' '[:lower:]' )
- ebuild_notice "debug" "fetcher program candidate for '${a}' is '${prg}'"
- [[ -x "${prg}" ]] && break
- done
- if [[ -x "${prg}" ]] ; then
- ${prg} "${a}" "${FETCHEDDIR}/${aa}"
- else
- eerror "Don't know how to fetch '${a}'"
- fi
- else
- if ! [[ "${old_aa}" != "${aa}" ]] ; then
- ebuild_section "Can't fetch ${aa}"
- old_aa="${aa}"
- fi
- fi
- fi
- done
-
- for a in ${unique_aa} ; do
- [[ -f ${FETCHEDDIR}/${a} ]] || nofetch="${nofetch} ${a}"
- done
-
- if [[ -n "${nofetch}" ]] ; then
- local c
- echo
- eerror "Couldn't fetch the following components:"
- for c in ${nofetch} ; do
- eerror " * ${c}"
- done
- echo
- die "builtin_fetch failed"
- fi
-
- local badfetch=
- if [[ -f "${FILESDIR}/digest-${PN}-${PVR%-r0}" ]] ; then
- local line items prg
- while read line ; do
- line=( ${line} )
- if ! hasq "${line[2]}" ${A} ; then
- ebuild_section "Skipping check for ${line[2]}"
- continue
- fi
-
- prg="${PALUDIS_EBUILD_DIR}/digests/do$(echo ${line[0]} | tr \
- '[[:upper:]]' '[[:lower:]]')"
- if [[ -x "${prg}" ]] ; then
- ebegin_unhooked "Checking ${line[0]} for ${line[2]}"
- if [[ $("${prg}" "${FETCHEDDIR}/${line[2]}" ) == "${line[1]}" ]] ; then
- eend 0
- else
- eend 1
- hasq "${line[2]}" ${badfetch} || badfetch="${badfetch} ${line[2]}"
- fi
- else
- einfo_unhooked "Can't check ${line[0]} for ${line[2]}"
- fi
-
- done < "${FILESDIR}"/digest-${PN}-${PVR%-r0}
- else
- ebuild_section "No digest file, skipping integrity checks"
- fi
-
- if [[ -n "${badfetch}" ]] ; then
- local c
- echo
- eerror "Bad digests encountered for the following components:"
- for c in ${badfetch} ; do
- eerror " * ${c}"
- done
- echo
- die "builtin_fetch failed"
- fi
-}
-
-ebuild_f_fetch()
-{
- local old_sandbox_write="${SANDBOX_WRITE}"
- [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]] && SANDBOX_WRITE="${SANDBOX_WRITE+${SANDBOX_WRITE}:}${FETCHEDDIR}"
- if hasq "fetch" ${RESTRICT} ; then
- ebuild_section "Skipping builtin_fetch (RESTRICT)"
- elif hasq "fetch" ${SKIP_FUNCTIONS} ; then
- ebuild_section "Skipping builtin_fetch (SKIP_FUNCTIONS)"
- else
- ebuild_section "Starting builtin_fetch"
- builtin_fetch
- ebuild_section "Done builtin_fetch"
- fi
- [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]] && SANDBOX_WRITE="${old_sandbox_write}"
- true
-}
-
-
-
diff --git a/paludis/repositories/e/ebuild/exheres-0/builtin_infovars.bash b/paludis/repositories/e/ebuild/exheres-0/builtin_infovars.bash
new file mode 100644
index 000000000..980888d2f
--- /dev/null
+++ b/paludis/repositories/e/ebuild/exheres-0/builtin_infovars.bash
@@ -0,0 +1,54 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2007, 2008 Ciaran McCreesh
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License, version 2, as published by the Free Software Foundation.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+builtin_infovars()
+{
+ local var
+ for var in ${PALUDIS_INFO_VARS} ; do
+ echo "${var}=${!var}"
+ done
+}
+
+exheres_internal_infovars()
+{
+ if hasq "infovars" ${RESTRICT} ; then
+ ebuild_section "Skipping builtin_infovars (RESTRICT)"
+ elif hasq "infovars" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping builtin_infovars (SKIP_FUNCTIONS)"
+ else
+ if [[ $(type -t pre_builtin_infovars ) == "function" ]] ; then
+ ebuild_section "Starting pre_builtin_infovars"
+ pre_builtin_infovars
+ ebuild_section "Done pre_builtin_infovars"
+ fi
+
+ ebuild_section "Starting builtin_infovars"
+ builtin_infovars
+ ebuild_section "Done builtin_infovars"
+
+ if [[ $(type -t post_builtin_infovars ) == "function" ]] ; then
+ ebuild_section "Starting post_builtin_infovars"
+ post_builtin_infovars
+ ebuild_section "Done post_builtin_infovars"
+ fi
+ fi
+
+ true
+}
+
+
diff --git a/paludis/repositories/e/ebuild/exheres-0/builtin_init.bash b/paludis/repositories/e/ebuild/exheres-0/builtin_init.bash
new file mode 100644
index 000000000..dd787d60c
--- /dev/null
+++ b/paludis/repositories/e/ebuild/exheres-0/builtin_init.bash
@@ -0,0 +1,95 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License, version 2, as published by the Free Software Foundation.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+builtin_init()
+{
+ export ROOT="${ROOT//+(\/)//}"
+
+ local a
+ for a in PALUDIS_NON_EMPTY_VARIABLES ${PALUDIS_NON_EMPTY_VARIABLES} ; do
+ [[ -z "${!a}" ]] && die "\$${a} unset or empty"
+ declare -r ${a}="${!a}"
+ done
+
+ for a in ${PALUDIS_DIRECTORY_VARIABLES} ; do
+ [[ -d "${!a}" ]] || die "\$${a} (\"${!a}\") not a directory"
+ done
+
+ for a in ${PALUDIS_DIRECTORY_IF_EXISTS_VARIABLES} ; do
+ [[ -e "${!a}" ]] && [[ ! -d "${!a}" ]] && \
+ die "\$${a} (\"${!a}\") exists but is not a directory"
+ done
+
+ for a in PALUDIS_TMPDIR ; do
+ if ! [[ -d "${!a}" ]] ; then
+ PALUDIS_EXTRA_DIE_MESSAGE="
+!!! '${!a}' should be a directory, but does not exist. For,
+!!! security reasons, Paludis will not try to create this directory
+!!! automatically. Please create it by hand and give it appropriate
+!!! permissions. Typically you should use:
+!!! mkdir ${!a}
+!!! chgrp ${PALUDIS_REDUCED_GID} ${!a}
+!!! chmod g+rwx ${!a}
+!!! chmod +s ${!a}
+!!! although other values may be more appropriate for your system.
+"
+ die "\$${a} (\"${!a}\") not a directory"
+ fi
+ done
+
+ if [[ -e "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}" ]] ; then
+ if type -p chflags &>/dev/null; then
+ chflags -R 0 "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}" || die "Couldn't remove flags from workdir"
+ fi
+ rm -fr "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}" || die "Couldn't remove previous work"
+ fi
+
+ export WORKDIR="${PALUDIS_TMPDIR}/${CATEGORY}/${PF}/work"
+ mkdir -p "${WORKDIR}" || die "Couldn't create \$WORKDIR (\"${WORKDIR}\")"
+ declare -r WORKDIR="${WORKDIR}"
+
+ export T="${PALUDIS_TMPDIR}/${CATEGORY}/${PF}/temp/"
+ mkdir -p "${T}" || die "Couldn't create \$T (\"${T}\")"
+ declare -r T="${T}"
+ export HOME="${T}"
+ export TMPDIR="${T}"
+
+ export D="${PALUDIS_TMPDIR}/${CATEGORY}/${PF}/image/"
+ export D="${D//+(\/)//}"
+ mkdir -p "${D}" || die "Couldn't create \$D (\"${D}\")"
+ declare -r D="${D}"
+
+ export IMAGE="${D}"
+ declare -r IMAGE="${IMAGE}"
+
+ export S="${WORKDIR}/${P}"
+}
+
+exheres_internal_init()
+{
+ if hasq "init" ${RESTRICT} ; then
+ ebuild_section "Skipping builtin_init (RESTRICT)"
+ elif hasq "init" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping builtin_init (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting builtin_init"
+ builtin_init
+ ebuild_section "Done builtin_init"
+ fi
+}
+
diff --git a/paludis/repositories/e/ebuild/exheres-0/builtin_loadenv.bash b/paludis/repositories/e/ebuild/exheres-0/builtin_loadenv.bash
new file mode 100644
index 000000000..1e89b4840
--- /dev/null
+++ b/paludis/repositories/e/ebuild/exheres-0/builtin_loadenv.bash
@@ -0,0 +1,48 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2007, 2008 Ciaran McCreesh
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License, version 2, as published by the Free Software Foundation.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+builtin_loadenv()
+{
+ [[ -d "${PALUDIS_LOADSAVEENV_DIR}" ]] \
+ || die "\$PALUDIS_LOADSAVEENV_DIR (\"${PALUDIS_LOADSAVEENV_DIR}\") not a directory"
+ [[ -f "${PALUDIS_LOADSAVEENV_DIR}/loadsaveenv" ]] || \
+ die "${PALUDIS_LOADSAVEENV_DIR}/loadsaveenv not a file"
+ ebuild_safe_source ${PALUDIS_LOADSAVEENV_DIR}/loadsaveenv
+}
+
+exheres_internal_loadenv()
+{
+ local old_sandbox_write="${SANDBOX_WRITE}"
+ [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]] && \
+ SANDBOX_WRITE="${SANDBOX_WRITE+${SANDBOX_WRITE}:}${PALUDIS_LOADSAVEENV_DIR%/}/"
+
+ if hasq "loadenv" ${RESTRICT} ; then
+ ebuild_section "Skipping builtin_loadenv (RESTRICT)"
+ elif hasq "loadenv" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping builtin_loadenv (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting builtin_loadenv"
+ builtin_loadenv
+ ebuild_section "Done builtin_loadenv"
+ fi
+
+ [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]] && SANDBOX_WRITE="${old_sandbox_write}"
+ true
+}
+
+
diff --git a/paludis/repositories/e/ebuild/exheres-0/builtin_metadata.bash b/paludis/repositories/e/ebuild/exheres-0/builtin_metadata.bash
new file mode 100644
index 000000000..effbd555d
--- /dev/null
+++ b/paludis/repositories/e/ebuild/exheres-0/builtin_metadata.bash
@@ -0,0 +1,41 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
+#
+# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License, version 2, as published by the Free Software Foundation.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+exheres_internal_metadata()
+{
+ local key
+
+ for a in ${PALUDIS_EBUILD_MUST_NOT_SET_VARIABLES} ; do
+ [[ "${!a-unset}" == "unset" ]] || die "\$${a} must not be set"
+ done
+
+ for key in ${EBUILD_METADATA_VARIABLES} ; do
+ set -o noglob
+ local k=${!key}
+ k=${k//\\/\\\\}
+ k=${k//\"/\\\"}
+ k=${k//\$/\\\$}
+ echo "${key}=\""${k}"\""
+ set +o noglob
+ done
+}
+
diff --git a/paludis/repositories/e/ebuild/exheres-0/builtin_prepare.bash b/paludis/repositories/e/ebuild/exheres-0/builtin_prepare.bash
new file mode 100644
index 000000000..9d4bab59e
--- /dev/null
+++ b/paludis/repositories/e/ebuild/exheres-0/builtin_prepare.bash
@@ -0,0 +1,49 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License, version 2, as published by the Free Software Foundation.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+builtin_prepare()
+{
+ export ROOT="${ROOT//+(\/)//}"
+
+ local a
+ for a in PF CATEGORY PALUDIS_TMPDIR ; do
+ [[ -z "${!a}" ]] && die "\$${a} unset or empty"
+ done
+
+ if [[ -e "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}" ]] ; then
+ if type -p chflags &>/dev/null; then
+ chflags -R 0 "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}" || die "Couldn't remove flags from workdir"
+ fi
+ rm -fr "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}" || die "Couldn't remove previous work"
+ fi
+}
+
+exheres_internal_prepare()
+{
+ if hasq "prepare" ${RESTRICT} ; then
+ ebuild_section "Skipping builtin_prepare (RESTRICT)"
+ elif hasq "prepare" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping builtin_prepare (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting builtin_prepare"
+ builtin_prepare
+ ebuild_section "Done builtin_prepare"
+ fi
+}
+
+
diff --git a/paludis/repositories/e/ebuild/exheres-0/builtin_saveenv.bash b/paludis/repositories/e/ebuild/exheres-0/builtin_saveenv.bash
new file mode 100644
index 000000000..a6869cf72
--- /dev/null
+++ b/paludis/repositories/e/ebuild/exheres-0/builtin_saveenv.bash
@@ -0,0 +1,44 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2007, 2008 Ciaran McCreesh
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License, version 2, as published by the Free Software Foundation.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+builtin_saveenv()
+{
+ [[ -d "${PALUDIS_LOADSAVEENV_DIR}" ]] || die "\$PALUDIS_LOADSAVEENV_DIR (\"${PALUDIS_LOADSAVEENV_DIR}\") not a directory"
+ [[ -f "${PALUDIS_LOADSAVEENV_DIR}/loadsaveenv" ]] && rm -f "${PALUDIS_LOADSAVEENV_DIR}/loadsaveenv"
+ ( set ; print_exports ) > ${PALUDIS_LOADSAVEENV_DIR}/loadsaveenv
+}
+
+exheres_internal_saveenv()
+{
+ local old_sandbox_write="${SANDBOX_WRITE}"
+ SANDBOX_WRITE="${SANDBOX_WRITE+${SANDBOX_WRITE}:}${PALUDIS_LOADSAVEENV_DIR%/}/"
+
+ if hasq "saveenv" ${RESTRICT} ; then
+ ebuild_section "Skipping builtin_saveenv (RESTRICT)"
+ elif hasq "saveenv" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping builtin_saveenv (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting builtin_saveenv"
+ builtin_saveenv
+ ebuild_section "Done builtin_saveenv"
+ fi
+
+ SANDBOX_WRITE="${old_sandbox_write}"
+ true
+}
+
diff --git a/paludis/repositories/e/ebuild/exheres-0/builtin_strip.bash b/paludis/repositories/e/ebuild/exheres-0/builtin_strip.bash
new file mode 100644
index 000000000..ad1977711
--- /dev/null
+++ b/paludis/repositories/e/ebuild/exheres-0/builtin_strip.bash
@@ -0,0 +1,86 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006, 2008 Ciaran McCreesh
+# Copyright (c) 2006 Stephen Bennett
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License, version 2, as published by the Free Software Foundation.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+builtin_strip()
+{
+ STRIP=${STRIP:-${CHOST}-strip}
+ if ! type -p -- ${STRIP} >/dev/null; then
+ STRIP=strip
+ fi
+ PALUDIS_STRIP_FLAGS=${PALUDIS_STRIP_FLAGS:---strip-unneeded}
+
+ if [[ "${PALUDIS_DEBUG_BUILD}" == "split" ]] ; then
+ OBJCOPY=${OBJCOPY:-${CHOST}-objcopy}
+ if ! type -p -- "${OBJCOPY}" &>/dev/null ; then
+ OBJCOPY=objcopy
+ fi
+ if ! type -p -- "${OBJCOPY}" &>/dev/null ; then
+ die "Can't work out what OBJCOPY should be"
+ fi
+ fi
+
+ if [[ -d "${ROOT}/usr/lib" ]] ; then
+ LIBDIR=$(basename "$(canonicalise "${ROOT}/usr/lib")")
+ else
+ LIBDIR="lib"
+ fi
+
+ for fn in $(find "${D}" -type f \
+ \( -perm -0100 -or -perm -0010 -or -perm -0001 -or -name '*.so' -or -name '*.so.*' \)); do
+ local ft=$(file "${fn}")
+ if [[ $? != 0 || -z ${ft} ]]; then
+ return 1
+ fi
+
+ if [[ ${ft} == *"current ar archive"* ]]; then
+ if [[ "${PALUDIS_DEBUG_BUILD}" != "internal" ]] ; then
+ echo ${STRIP} -g "${fn}"
+ ${STRIP} -g "${fn}"
+ fi
+ elif [[ ${ft} == *"SB executable"* || ${ft} == *"SB shared object"* ]]; then
+ if [[ "${PALUDIS_DEBUG_BUILD}" == "split" ]] ; then
+ local fd="${D}usr/${LIBDIR}/debug/${fn:${#D}}.debug"
+ mkdir -p "$(dirname "${fd}" )"
+ echo ${OBJCOPY} --only-keep-debug "${fn}" "${fd}"
+ ${OBJCOPY} --only-keep-debug "${fn}" "${fd}"
+ echo ${OBJCOPY} --add-gnu-debuglink="${fd}" "${fn}"
+ ${OBJCOPY} --add-gnu-debuglink="${fd}" "${fn}"
+ chmod a-x,o-w "${fd}"
+ fi
+ if [[ "${PALUDIS_DEBUG_BUILD}" != "internal" ]] ; then
+ echo ${STRIP} ${PALUDIS_STRIP_FLAGS} "${fn}"
+ ${STRIP} ${PALUDIS_STRIP_FLAGS} "${fn}"
+ fi
+ fi
+ done
+}
+
+exheres_internal_strip()
+{
+ if hasq "strip" ${RESTRICT} ; then
+ ebuild_section "Skipping builtin_strip (RESTRICT)"
+ elif hasq "strip" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping builtin_strip (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting builtin_strip"
+ builtin_strip
+ ebuild_section "Done builtin_strip"
+ fi
+}
+
diff --git a/paludis/repositories/e/ebuild/exheres-0/builtin_tidyup.bash b/paludis/repositories/e/ebuild/exheres-0/builtin_tidyup.bash
new file mode 100644
index 000000000..e75adbdc3
--- /dev/null
+++ b/paludis/repositories/e/ebuild/exheres-0/builtin_tidyup.bash
@@ -0,0 +1,43 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006, 2008 Ciaran McCreesh
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License, version 2, as published by the Free Software Foundation.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+builtin_tidyup()
+{
+ if [[ -e "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}" ]] ; then
+ if type -p chflags &>/dev/null; then
+ echo chflags -R 0 "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}" 1>&2
+ chflags -R 0 "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}" || die "Couldn't remove flags from workdir"
+ fi
+ echo rm -fr "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}" 1>&2
+ rm -fr "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}" || die "Couldn't remove work"
+ fi
+}
+
+exheres_internal_tidyup()
+{
+ if hasq "tidyup" ${RESTRICT} ; then
+ ebuild_section "Skipping builtin_tidyup (RESTRICT)"
+ elif hasq "tidyup" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping builtin_tidyup (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting builtin_tidyup"
+ builtin_tidyup
+ ebuild_section "Done builtin_tidyup"
+ fi
+}
+
diff --git a/paludis/repositories/e/ebuild/exheres-0/builtin_variable.bash b/paludis/repositories/e/ebuild/exheres-0/builtin_variable.bash
new file mode 100644
index 000000000..ce0c0b116
--- /dev/null
+++ b/paludis/repositories/e/ebuild/exheres-0/builtin_variable.bash
@@ -0,0 +1,23 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Ciaran McCreesh
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License, version 2, as published by the Free Software Foundation.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+ebuild_f_variable()
+{
+ echo "${!PALUDIS_VARIABLE}"
+}
+
diff --git a/paludis/repositories/e/ebuild/exheres-0/conditional_functions_TEST.bash b/paludis/repositories/e/ebuild/exheres-0/conditional_functions_TEST.bash
new file mode 100644
index 000000000..f7715a29a
--- /dev/null
+++ b/paludis/repositories/e/ebuild/exheres-0/conditional_functions_TEST.bash
@@ -0,0 +1,45 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006, 2008 Ciaran McCreesh
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License version 2, as published by the Free Software Foundation.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+option_with_TEST()
+{
+ export OPTIONS="foo" MYOPTIONS="foo bar baz"
+ test_equality "$(option_with foo )" "--with-foo"
+ test_equality "$(option_with foo bar )" "--with-bar"
+ test_equality "$(option_with foo bar baz )" "--with-bar=baz"
+
+ export OPTIONS="oink"
+ test_equality "$(option_with foo )" "--without-foo"
+ test_equality "$(option_with foo bar )" "--without-bar"
+ test_equality "$(option_with foo bar baz )" "--without-bar"
+}
+
+
+option_enable_TEST()
+{
+ export OPTIONS="foo" MYOPTIONS="foo bar baz"
+ test_equality "$(option_enable foo )" "--enable-foo"
+ test_equality "$(option_enable foo bar )" "--enable-bar"
+ test_equality "$(option_enable foo bar baz )" "--enable-bar=baz"
+
+ export OPTIONS="oink"
+ test_equality "$(option_enable foo )" "--disable-foo"
+ test_equality "$(option_enable foo bar )" "--disable-bar"
+ test_equality "$(option_enable foo bar baz )" "--disable-bar"
+}
+
diff --git a/paludis/repositories/e/ebuild/exheres-0/eclass_functions.bash b/paludis/repositories/e/ebuild/exheres-0/eclass_functions.bash
new file mode 100644
index 000000000..5aed2e6d4
--- /dev/null
+++ b/paludis/repositories/e/ebuild/exheres-0/eclass_functions.bash
@@ -0,0 +1,82 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006, 2007 Ciaran McCreesh
+#
+# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License, version 2, as published by the Free Software Foundation.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+EXPORT_FUNCTIONS()
+{
+ [[ -z "${ECLASS}" ]] && die "EXPORT_FUNCTIONS called but ECLASS undefined"
+
+ local e
+ for e in "$@" ; do
+ case "$e" in
+ pkg_nofetch|pkg_setup|pkg_prerm|pkg_postrm|pkg_preinst|pkg_postinst|pkg_config)
+ eval "${e}() { ${ECLASS}_${e} \"\$@\" ; }"
+ ;;
+
+ src_unpack|src_compile|src_install|src_test)
+ eval "${e}() { ${ECLASS}_${e} \"\$@\" ; }"
+ ;;
+
+ *)
+ eval "${e}() { ${ECLASS}_${e} \"\$@\" ; }"
+ ebuild_notice "qa" "$e should not be in EXPORT_FUNCTIONS for ${ECLASS}"
+ ;;
+ esac
+ done
+}
+
+inherit()
+{
+ [[ -n "${PALUDIS_SKIP_INHERIT}" ]] && return
+
+ local e ee location= v
+ for e in "$@" ; do
+ for ee in ${ECLASSDIRS:-${ECLASSDIR}} ; do
+ [[ -f "${ee}/${e}.eclass" ]] && location="${ee}/${e}.eclass"
+ done
+ local old_ECLASS="${ECLASS}"
+ export ECLASS="${e}"
+
+ for v in ${PALUDIS_SOURCE_MERGED_VARIABLES} ; do
+ local c_v="current_${v}" u_v="unset_${v}"
+ local ${c_v}="${!v}"
+ local ${u_v}="${!v-unset}"
+ unset ${v}
+ done
+
+ [[ -z "${location}" ]] && die "Error finding eclass ${e}"
+ source "${location}" || die "Error sourcing eclass ${e}"
+ hasq "${ECLASS}" ${INHERITED} || export INHERITED="${INHERITED} ${ECLASS}"
+
+ for v in ${PALUDIS_SOURCE_MERGED_VARIABLES} ; do
+ local e_v="E_${v}"
+ export ${e_v}="${!e_v} ${!v}"
+ done
+
+ for v in ${PALUDIS_SOURCE_MERGED_VARIABLES} ; do
+ local c_v="current_${v}" u_v="unset_${v}"
+ [[ "unset" == ${!u_v} ]] && unset ${v} || export ${v}="${!c_v}"
+ done
+
+ export ECLASS="${old_ECLASS}"
+ done
+}
+
diff --git a/paludis/repositories/e/ebuild/exheres-0/exlib_functions.bash b/paludis/repositories/e/ebuild/exheres-0/exlib_functions.bash
new file mode 100644
index 000000000..38e1f2a8e
--- /dev/null
+++ b/paludis/repositories/e/ebuild/exheres-0/exlib_functions.bash
@@ -0,0 +1,83 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2007, 2008 Ciaran McCreesh
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License, version 2, as published by the Free Software Foundation.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+export_exlib_phases()
+{
+ [[ -z "${CURRENT_EXLIB}" ]] && die "export_exlib_phases called but CURRENT_EXLIB undefined"
+
+ local e
+ for e in "$@" ; do
+ case "$e" in
+ pkg_nofetch|pkg_setup|pkg_prerm|pkg_postrm|pkg_preinst|pkg_postinst|pkg_config|pkg_pretend)
+ eval "${e}() { ${CURRENT_EXLIB}_${e} \"\$@\" ; }"
+ ;;
+
+ src_unpack|src_compile|src_install|src_test)
+ eval "${e}() { ${CURRENT_EXLIB}_${e} \"\$@\" ; }"
+ ;;
+
+ *)
+ eval "${e}() { ${CURRENT_EXLIB}_${e} \"\$@\" ; }"
+ ebuild_notice "qa" "$e should not be in export_exlib_phases for ${CURRENT_EXLIB}"
+ ;;
+ esac
+ done
+}
+
+require()
+{
+ ebuild_notice "debug" "Command 'require ${@}', using EXLIBSDIRS '${EXLIBSDIRS}'"
+ local e ee location= v
+ for e in "$@" ; do
+ for ee in ${EXLIBSDIRS} ; do
+ [[ -f "${ee}/${e}.exlib" ]] && location="${ee}/${e}.exlib"
+ done
+ local old_CURRENT_EXLIB="${CURRENT_EXLIB}"
+ export CURRENT_EXLIB="${e}"
+
+ for v in ${PALUDIS_SOURCE_MERGED_VARIABLES} ; do
+ local c_v="current_${v}" u_v="unset_${v}"
+ local ${c_v}="${!v}"
+ local ${u_v}="${!v-unset}"
+ unset ${v}
+ done
+
+ [[ -z "${location}" ]] && die "Error finding exlib ${e} in ${EXLIBSDIRS}"
+ source "${location}" || die "Error sourcing exlib ${e}"
+ hasq "${CURRENT_EXLIB}" ${INHERITED} || export INHERITED="${INHERITED} ${CURRENT_EXLIB}"
+
+ for v in ${PALUDIS_SOURCE_MERGED_VARIABLES} ; do
+ local e_v="E_${v}"
+ export ${e_v}="${!e_v} ${!v}"
+ done
+
+ for v in ${PALUDIS_SOURCE_MERGED_VARIABLES} ; do
+ local c_v="current_${v}" u_v="unset_${v}"
+ [[ "unset" == ${!u_v} ]] && unset ${v} || export ${v}="${!c_v}"
+ done
+
+ export CURRENT_EXLIB="${old_CURRENT_EXLIB}"
+ done
+}
+
+default()
+{
+ [[ $(type -t "default_${FUNCNAME[1]}" ) == "function" ]] || die "default_${FUNCNAME[1]} not a function"
+ default_${FUNCNAME[1]} "$@"
+}
+
diff --git a/paludis/repositories/e/ebuild/exheres-0/list_functions_TEST.bash b/paludis/repositories/e/ebuild/exheres-0/list_functions_TEST.bash
new file mode 100644
index 000000000..8ac15163a
--- /dev/null
+++ b/paludis/repositories/e/ebuild/exheres-0/list_functions_TEST.bash
@@ -0,0 +1,74 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006, 2008 Ciaran McCreesh
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License version 2, as published by the Free Software Foundation.
+#
+# Paludis is distributed in the hope that it will be optionful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+option_TEST()
+{
+ export OPTIONS="foo bar" MYOPTIONS="foo bar baz foofoo fo"
+
+ option foo ; test_return_code
+ option bar ; test_return_code
+ ! option baz ; test_return_code
+ ! option foofoo ; test_return_code
+ ! option fo ; test_return_code
+
+ ! option !foo ; test_return_code
+ ! option !bar ; test_return_code
+ option !baz ; test_return_code
+ option !foofoo ; test_return_code
+ option !fo ; test_return_code
+}
+
+optionv_TEST()
+{
+ export OPTIONS="foo bar" MYOPTIONS="foo bar baz"
+ optionv foo 1>/dev/null ; test_return_code
+ test_equality "$(optionv foo)" "foo"
+
+ optionv bar 1>/dev/null ; test_return_code
+ test_equality "$(optionv bar)" "bar"
+
+ ! optionv baz 1>/dev/null ; test_return_code
+ test_equality "$(optionv baz)" ""
+
+ ! optionv !foo 1>/dev/null ; test_return_code
+ test_equality "$(optionv !foo)" ""
+
+ ! optionv !bar 1>/dev/null ; test_return_code
+ test_equality "$(optionv !bar)" ""
+
+ ! optionv baz 1>/dev/null ; test_return_code
+ test_equality "$(optionv !baz)" "baz"
+}
+
+optionq_TEST()
+{
+ export option="foo bar" MYOPTIONS="foo bar baz foofoo fo"
+
+ optionq foo ; test_return_code
+ optionq bar ; test_return_code
+ ! optionq baz ; test_return_code
+ ! optionq foofoo ; test_return_code
+ ! optionq fo ; test_return_code
+
+ ! optionq !foo ; test_return_code
+ ! optionq !bar ; test_return_code
+ optionq !baz ; test_return_code
+ optionq !foofoo ; test_return_code
+ optionq !fo ; test_return_code
+}
+
diff --git a/paludis/repositories/e/ebuild/exheres-0/output_functions.bash b/paludis/repositories/e/ebuild/exheres-0/output_functions.bash
new file mode 100644
index 000000000..143ff84ba
--- /dev/null
+++ b/paludis/repositories/e/ebuild/exheres-0/output_functions.bash
@@ -0,0 +1,30 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License, version 2, as published by the Free Software Foundation.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+ebuild_notice()
+{
+ [[ -z "${PALUDIS_PIPE_COMMANDS_SUPPORTED}" ]] && return
+ paludis_pipe_command LOG "$EAPI" "$@" >/dev/null
+}
+
+ebuild_section()
+{
+ echo -ne "${COLOUR_PINK}===${COLOUR_NORMAL} "
+ echo "$@"
+}
+
diff --git a/paludis/repositories/e/ebuild/exheres-0/pkg_config.bash b/paludis/repositories/e/ebuild/exheres-0/pkg_config.bash
new file mode 100644
index 000000000..faad1ef33
--- /dev/null
+++ b/paludis/repositories/e/ebuild/exheres-0/pkg_config.bash
@@ -0,0 +1,51 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
+#
+# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License, version 2, as published by the Free Software Foundation.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+default_pkg_config()
+{
+ eerror "No configuration function is defined"
+}
+
+pkg_config()
+{
+ default "$@"
+}
+
+exheres_internal_config()
+{
+ local old_sandbox_write="${SANDBOX_WRITE}"
+ [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]] && SANDBOX_WRITE="${SANDBOX_WRITE+${SANDBOX_WRITE}:}${ROOT%/}/"
+
+ if hasq "config" ${RESTRICT} ; then
+ ebuild_section "Skipping pkg_config (RESTRICT)"
+ elif hasq "config" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping pkg_config (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting pkg_config"
+ pkg_config
+ ebuild_section "Done pkg_config"
+ fi
+
+ [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]] && SANDBOX_WRITE="${old_sandbox_write}"
+ true
+}
+
diff --git a/paludis/repositories/e/ebuild/exheres-0/pkg_info.bash b/paludis/repositories/e/ebuild/exheres-0/pkg_info.bash
new file mode 100644
index 000000000..83e6d995b
--- /dev/null
+++ b/paludis/repositories/e/ebuild/exheres-0/pkg_info.bash
@@ -0,0 +1,43 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2007, 2008 Ciaran McCreesh
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License, version 2, as published by the Free Software Foundation.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+default_pkg_info()
+{
+ echo "No additional information available"
+}
+
+pkg_info()
+{
+ default "$@"
+}
+
+exheres_internal_info()
+{
+ if hasq "info" ${RESTRICT} ; then
+ ebuild_section "Skipping pkg_info (RESTRICT)"
+ elif hasq "info" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping pkg_info (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting pkg_info"
+ pkg_info
+ ebuild_section "Done pkg_info"
+ fi
+
+ true
+}
+
diff --git a/paludis/repositories/e/ebuild/exheres-0/pkg_nofetch.bash b/paludis/repositories/e/ebuild/exheres-0/pkg_nofetch.bash
index 25608906c..6b6f6845b 100644
--- a/paludis/repositories/e/ebuild/exheres-0/pkg_nofetch.bash
+++ b/paludis/repositories/e/ebuild/exheres-0/pkg_nofetch.bash
@@ -1,7 +1,7 @@
#!/bin/bash
# vim: set sw=4 sts=4 et :
-# Copyright (c) 2006, 2007 Ciaran McCreesh
+# Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
#
# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
# Gentoo Foundation and distributed under the terms of the GNU General
@@ -20,7 +20,7 @@
# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
# Place, Suite 330, Boston, MA 02111-1307 USA
-pkg_nofetch()
+default_pkg_nofetch()
{
[[ -z "${A}" ]] && return
@@ -35,7 +35,12 @@ pkg_nofetch()
done
}
-ebuild_f_nofetch()
+pkg_nofetch()
+{
+ default "$@"
+}
+
+exheres_internal_nofetch()
{
local old_sandbox_write="${SANDBOX_WRITE}"
[[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]] && SANDBOX_WRITE="${SANDBOX_WRITE+${SANDBOX_WRITE}:}${FETCHEDDIR}"
diff --git a/paludis/repositories/e/ebuild/exheres-0/pkg_postinst.bash b/paludis/repositories/e/ebuild/exheres-0/pkg_postinst.bash
new file mode 100644
index 000000000..07751f40c
--- /dev/null
+++ b/paludis/repositories/e/ebuild/exheres-0/pkg_postinst.bash
@@ -0,0 +1,51 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
+#
+# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License, version 2, as published by the Free Software Foundation.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+default_pkg_postinst()
+{
+ :
+}
+
+pkg_postinst()
+{
+ default "$@"
+}
+
+exheres_internal_postinst()
+{
+ local old_sandbox_write="${SANDBOX_WRITE}"
+ [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]] && SANDBOX_WRITE="${SANDBOX_WRITE+${SANDBOX_WRITE}:}${ROOT%/}/"
+
+ if hasq "postinst" ${RESTRICT} ; then
+ ebuild_section "Skipping pkg_postinst (RESTRICT)"
+ elif hasq "postinst" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping pkg_postinst (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting pkg_postinst"
+ pkg_postinst
+ ebuild_section "Done pkg_postinst"
+ fi
+
+ [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]] && SANDBOX_WRITE="${old_sandbox_write}"
+ true
+}
+
diff --git a/paludis/repositories/e/ebuild/exheres-0/pkg_postrm.bash b/paludis/repositories/e/ebuild/exheres-0/pkg_postrm.bash
new file mode 100644
index 000000000..50f9e7e58
--- /dev/null
+++ b/paludis/repositories/e/ebuild/exheres-0/pkg_postrm.bash
@@ -0,0 +1,52 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
+#
+# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License, version 2, as published by the Free Software Foundation.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+default_pkg_postrm()
+{
+ :
+}
+
+pkg_postrm()
+{
+ default "$@"
+}
+
+exheres_internal_postrm()
+{
+ local old_sandbox_write="${SANDBOX_WRITE}"
+ [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]] && SANDBOX_WRITE="${SANDBOX_WRITE+${SANDBOX_WRITE}:}${ROOT%/}/"
+
+ if hasq "postrm" ${RESTRICT} ; then
+ ebuild_section "Skipping pkg_postrm (RESTRICT)"
+ elif hasq "postrm" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping pkg_postrm (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting pkg_postrm"
+ pkg_postrm
+ ebuild_section "Done pkg_postrm"
+ fi
+
+ [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]] && SANDBOX_WRITE="${old_sandbox_write}"
+ true
+}
+
+
diff --git a/paludis/repositories/e/ebuild/exheres-0/pkg_preinst.bash b/paludis/repositories/e/ebuild/exheres-0/pkg_preinst.bash
new file mode 100644
index 000000000..85c7fc6c8
--- /dev/null
+++ b/paludis/repositories/e/ebuild/exheres-0/pkg_preinst.bash
@@ -0,0 +1,51 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
+#
+# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License, version 2, as published by the Free Software Foundation.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+default_pkg_preinst()
+{
+ :
+}
+
+pkg_preinst()
+{
+ default "$@"
+}
+
+exheres_internal_preinst()
+{
+ local old_sandbox_write="${SANDBOX_WRITE}"
+ [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]] && SANDBOX_WRITE="${SANDBOX_WRITE+${SANDBOX_WRITE}:}${ROOT%/}/"
+
+ if hasq "preinst" ${RESTRICT} ; then
+ ebuild_section "Skipping pkg_preinst (RESTRICT)"
+ elif hasq "preinst" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping pkg_preinst (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting pkg_preinst"
+ pkg_preinst
+ ebuild_section "Done pkg_preinst"
+ fi
+
+ [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]] && SANDBOX_WRITE="${old_sandbox_write}"
+ true
+}
+
diff --git a/paludis/repositories/e/ebuild/exheres-0/pkg_prerm.bash b/paludis/repositories/e/ebuild/exheres-0/pkg_prerm.bash
new file mode 100644
index 000000000..9dde2e154
--- /dev/null
+++ b/paludis/repositories/e/ebuild/exheres-0/pkg_prerm.bash
@@ -0,0 +1,51 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
+#
+# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License, version 2, as published by the Free Software Foundation.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+default_pkg_prerm()
+{
+ :
+}
+
+pkg_prerm()
+{
+ default "$@"
+}
+
+exheres_internal_prerm()
+{
+ local old_sandbox_write="${SANDBOX_WRITE}"
+ [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]] && SANDBOX_WRITE="${SANDBOX_WRITE+${SANDBOX_WRITE}:}${ROOT%/}/"
+
+ if hasq "prerm" ${RESTRICT} ; then
+ ebuild_section "Skipping pkg_prerm (RESTRICT)"
+ elif hasq "prerm" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping pkg_prerm (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting pkg_prerm"
+ pkg_prerm
+ ebuild_section "Done pkg_prerm"
+ fi
+
+ [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]] && SANDBOX_WRITE="${old_sandbox_write}"
+ true
+}
+
diff --git a/paludis/repositories/e/ebuild/exheres-0/pkg_pretend.bash b/paludis/repositories/e/ebuild/exheres-0/pkg_pretend.bash
new file mode 100644
index 000000000..5210ddd80
--- /dev/null
+++ b/paludis/repositories/e/ebuild/exheres-0/pkg_pretend.bash
@@ -0,0 +1,44 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2007, 2008 Ciaran McCreesh
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License, version 2, as published by the Free Software Foundation.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+default_pkg_pretend()
+{
+ :
+}
+
+pkg_pretend()
+{
+ default "$@"
+}
+
+exheres_internal_pretend()
+{
+ if hasq "pretend" ${RESTRICT} ; then
+ ebuild_section "Skipping pkg_pretend (RESTRICT)"
+ elif hasq "pretend" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping pkg_pretend (SKIP_FUNCTIONS)"
+ else
+ echo
+ pkg_pretend
+ echo
+ fi
+
+ true
+}
+
+
diff --git a/paludis/repositories/e/ebuild/exheres-0/pkg_setup.bash b/paludis/repositories/e/ebuild/exheres-0/pkg_setup.bash
new file mode 100644
index 000000000..39497604e
--- /dev/null
+++ b/paludis/repositories/e/ebuild/exheres-0/pkg_setup.bash
@@ -0,0 +1,51 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
+#
+# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License, version 2, as published by the Free Software Foundation.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+default_pkg_setup()
+{
+ :
+}
+
+pkg_setup()
+{
+ default "$@"
+}
+
+exheres_internal_setup()
+{
+ local old_sandbox_write="${SANDBOX_WRITE}"
+ [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]] && SANDBOX_WRITE="${SANDBOX_WRITE+${SANDBOX_WRITE}:}${ROOT%/}/"
+
+ if hasq "setup" ${RESTRICT} ; then
+ ebuild_section "Skipping pkg_setup (RESTRICT)"
+ elif hasq "setup" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping pkg_setup (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting pkg_setup"
+ pkg_setup
+ ebuild_section "Done pkg_setup"
+ fi
+
+ [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]] && SANDBOX_WRITE="${old_sandbox_write}"
+ true
+}
+
diff --git a/paludis/repositories/e/ebuild/exheres-0/src_compile.bash b/paludis/repositories/e/ebuild/exheres-0/src_compile.bash
new file mode 100644
index 000000000..aaff3ed45
--- /dev/null
+++ b/paludis/repositories/e/ebuild/exheres-0/src_compile.bash
@@ -0,0 +1,54 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
+#
+# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License, version 2, as published by the Free Software Foundation.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+default_src_compile()
+{
+ [[ -x ./configure ]] && econf
+ if [[ -f Makefile ]] || [[ -f makefile ]] || [[ -f GNUmakefile ]] ; then
+ emake || die "emake failed"
+ fi
+}
+
+src_compile()
+{
+ default "$@"
+}
+
+exheres_internal_compile()
+{
+ if [[ -d "${S}" ]] ; then
+ cd "${S}" || die "cd to \${S} (\"${S}\") failed"
+ elif [[ -d "${WORKDIR}" ]] ; then
+ cd "${WORKDIR}" || die "cd to \${WORKDIR} (\"${WORKDIR}\") failed"
+ fi
+
+ if hasq "compile" ${RESTRICT} ; then
+ ebuild_section "Skipping src_compile (RESTRICT)"
+ elif hasq "compile" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping src_compile (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting src_compile"
+ src_compile
+ ebuild_section "Done src_compile"
+ fi
+}
+
diff --git a/paludis/repositories/e/ebuild/exheres-0/src_install.bash b/paludis/repositories/e/ebuild/exheres-0/src_install.bash
new file mode 100644
index 000000000..7b621f5c8
--- /dev/null
+++ b/paludis/repositories/e/ebuild/exheres-0/src_install.bash
@@ -0,0 +1,51 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
+#
+# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License, version 2, as published by the Free Software Foundation.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+default_src_install()
+{
+ :
+}
+
+src_install()
+{
+ default "$@"
+}
+
+exheres_internal_install()
+{
+ if [[ -d "${S}" ]] ; then
+ cd "${S}" || die "cd to \${S} (\"${S}\") failed"
+ elif [[ -d "${WORKDIR}" ]] ; then
+ cd "${WORKDIR}" || die "cd to \${WORKDIR} (\"${WORKDIR}\") failed"
+ fi
+
+ if hasq "install" ${RESTRICT} ; then
+ ebuild_section "Skipping src_install (RESTRICT)"
+ elif hasq "install" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping src_install (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting src_install"
+ src_install
+ ebuild_section "Done src_install"
+ fi
+}
+
diff --git a/paludis/repositories/e/ebuild/exheres-0/src_test.bash b/paludis/repositories/e/ebuild/exheres-0/src_test.bash
new file mode 100644
index 000000000..9a681e965
--- /dev/null
+++ b/paludis/repositories/e/ebuild/exheres-0/src_test.bash
@@ -0,0 +1,74 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
+#
+# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License, version 2, as published by the Free Software Foundation.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+default_src_test()
+{
+ if [[ -f Makefile ]] || [[ -f GNUmakefile ]] || [[ -f makefile ]] ; then
+ echo "Makefile found, looking for potential test targets"
+ if make -j1 -n check ; then
+ echo "Found check target"
+ emake -j1 check || die "make check failed"
+ elif make -j1 -n test ; then
+ echo "Found test target"
+ emake -j1 test || die "make test failed"
+ else
+ echo "No check or test target, skipping tests"
+ fi
+ else
+ echo "No Makefile, skipping tests"
+ fi
+}
+
+src_test()
+{
+ default "$@"
+}
+
+exheres_internal_test()
+{
+ local old_sandbox_predict="${SANDBOX_PREDICT}"
+ [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]] && SANDBOX_PREDICT="${SANDBOX_PREDICT+${SANDBOX_PREDICT}:}/"
+
+ local save_PALUDIS_EXTRA_DIE_MESSAGE="${PALUDIS_EXTRA_DIE_MESSAGE}"
+
+ if [[ -d "${S}" ]] ; then
+ cd "${S}" || die "cd to \${S} (\"${S}\") failed"
+ elif [[ -d "${WORKDIR}" ]] ; then
+ cd "${WORKDIR}" || die "cd to \${WORKDIR} (\"${WORKDIR}\") failed"
+ fi
+
+ if hasq "test" ${RESTRICT} ; then
+ ebuild_section "Skipping src_test (RESTRICT)"
+ elif hasq "test" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping src_test (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting src_test"
+ src_test
+ ebuild_section "Done src_test"
+ fi
+
+ export PALUDIS_EXTRA_DIE_MESSAGE="${save_PALUDIS_EXTRA_DIE_MESSAGE}"
+
+ [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]] && SANDBOX_PREDICT="${old_sandbox_predict}"
+ true
+}
+
diff --git a/paludis/repositories/e/ebuild/exheres-0/src_unpack.bash b/paludis/repositories/e/ebuild/exheres-0/src_unpack.bash
new file mode 100644
index 000000000..299ac4b10
--- /dev/null
+++ b/paludis/repositories/e/ebuild/exheres-0/src_unpack.bash
@@ -0,0 +1,47 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
+#
+# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License, version 2, as published by the Free Software Foundation.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+default_src_unpack()
+{
+ [[ -n "${A}" ]] && unpack ${A}
+}
+
+src_unpack()
+{
+ default "$@"
+}
+
+exheres_internal_unpack()
+{
+ cd ${WORKDIR} || die "cd to \${WORKDIR} (\"${WORKDIR}\") failed"
+
+ if hasq "unpack" ${RESTRICT} ; then
+ ebuild_section "Skipping src_unpack (RESTRICT)"
+ elif hasq "unpack" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping src_unpack (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting src_unpack"
+ src_unpack
+ ebuild_section "Done src_unpack"
+ fi
+}
+