aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories/e/ebuild
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-01-19 00:02:29 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-01-19 00:02:29 +0000
commit65b149c78f21883d0e4184a8ae8291f7c852c358 (patch)
treefea87388c98b1100b11de3736052cebf821f5118 /paludis/repositories/e/ebuild
parent31d62bdfa5664f56557164ce9f78174ea10a61db (diff)
downloadpaludis-65b149c78f21883d0e4184a8ae8291f7c852c358.tar.gz
paludis-65b149c78f21883d0e4184a8ae8291f7c852c358.tar.xz
Merge in pbins. Not for real world use.
Diffstat (limited to 'paludis/repositories/e/ebuild')
-rw-r--r--paludis/repositories/e/ebuild/Makefile.am6
-rw-r--r--paludis/repositories/e/ebuild/binary_functions.bash79
-rwxr-xr-xpaludis/repositories/e/ebuild/ebuild.bash16
-rw-r--r--paludis/repositories/e/ebuild/pbin-1/Makefile.am38
-rw-r--r--paludis/repositories/e/ebuild/pbin-1/builtin_installbin.bash47
-rw-r--r--paludis/repositories/e/ebuild/pbin-1/builtin_pivotbin.bash57
-rwxr-xr-xpaludis/repositories/e/ebuild/source_functions.bash3
-rw-r--r--paludis/repositories/e/ebuild/write_binary_ebuild.bash134
8 files changed, 372 insertions, 8 deletions
diff --git a/paludis/repositories/e/ebuild/Makefile.am b/paludis/repositories/e/ebuild/Makefile.am
index cfea137cd..0287d4a5b 100644
--- a/paludis/repositories/e/ebuild/Makefile.am
+++ b/paludis/repositories/e/ebuild/Makefile.am
@@ -1,12 +1,13 @@
MAINTAINERCLEANFILES = Makefile.in
CLEANFILES = *~
-SUBDIRS = . 0 1 exheres-0 paludis-1 utils
+SUBDIRS = . 0 1 exheres-0 paludis-1 pbin-1 utils
AM_CXXFLAGS = -I$(top_srcdir) @PALUDIS_CXXFLAGS@
libexecprogdir = $(libexecdir)/paludis/
libexecprog_SCRIPTS = \
+ binary_functions.bash \
build_functions.bash \
die_functions.bash \
ebuild.bash \
@@ -17,7 +18,8 @@ libexecprog_SCRIPTS = \
sandbox.bash \
source_functions.bash \
usage_error.bash \
- write_vdb_entry.bash
+ write_vdb_entry.bash \
+ write_binary_ebuild.bash
TESTS_ENVIRONMENT = env \
PALUDIS_EBUILD_DIR="$(top_srcdir)/paludis/repositories/e/ebuild/" \
diff --git a/paludis/repositories/e/ebuild/binary_functions.bash b/paludis/repositories/e/ebuild/binary_functions.bash
new file mode 100644
index 000000000..3d05d7803
--- /dev/null
+++ b/paludis/repositories/e/ebuild/binary_functions.bash
@@ -0,0 +1,79 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 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
+
+make_binary_tarball()
+{
+ local imagedir="${1}" envfile="${2}" bindistfile="${3}"
+ local tmpdir="${PALUDIS_TMPDIR}/pbin-$(basename "${bindistfile}" )"
+
+ echo tar cvf "${bindistfile}".tar --files-from /dev/null 1>&2
+ tar cvf "${bindistfile}".tar --files-from /dev/null || die "making tarball failed"
+
+ echo find "${imagedir}" -mindepth 1 -maxdepth 1 -printf '%f\0' \| \
+ xargs -0 tar rpvf "${bindistfile}".tar -C "${imagedir}" 1>&2
+ find "${imagedir}" -mindepth 1 -maxdepth 1 -printf '%f\0' | \
+ xargs -0 tar rpvf "${bindistfile}".tar -C "${imagedir}" \
+ || die "adding image to tarball failed"
+
+ echo rm -fr "${tmpdir}" 1>&2
+ rm -fr "${tmpdir}"
+
+ echo mkdir "${tmpdir}" 1>&2
+ mkdir "${tmpdir}" || die "mkdir ${tmpdir} failed"
+
+ echo mkdir "${tmpdir}"/PBIN 1>&2
+ mkdir "${tmpdir}"/PBIN 1>&2
+
+ echo bzip2 \< "${envfile}" \> "${tmpdir}/PBIN/environment.bz2" 1>&2
+ bzip2 < "${envfile}" > "${tmpdir}/PBIN/environment.bz2"
+
+ echo "tar rvf "${bindistfile}".tar -C "${tmpdir}" 'PBIN'" 1>&2
+ tar rvf "${bindistfile}".tar -C "${tmpdir}" 'PBIN' || die "adding env to tarball failed"
+
+ echo bzip2 "${bindistfile}".tar 1>&2
+ bzip2 "${bindistfile}".tar || die "compressing tarball failed"
+}
+
+make_binary_ebuild()
+{
+ local ebuildfile="${1}" bin_uri="${2}" binary_keywords="${3}"
+
+ export GENERATED_TIME=$(date +%s )
+ export GENERATED_USING=${PKGMANAGER}
+ export BINARY_URI="${bin_uri}"
+ export EAPI="pbin-1+${EAPI}"
+ echo export ${PALUDIS_BINARY_KEYWORDS_VARIABLE}="${binary_keywords}" 1>&2
+ export ${PALUDIS_BINARY_KEYWORDS_VARIABLE}="${binary_keywords}"
+
+ echo "# Created by $PKGMANAGER on $(date )" > ${ebuildfile} || die "Couldn't write ${ebuildfile}"
+
+ local p
+ for p in ${PALUDIS_BINARY_FROM_ENV_VARIABLES} ; do
+ set -o noglob
+ local k=${!p}
+ k=${k//\\/\\\\}
+ k=${k//\"/\\\"}
+ # {"} fix vim syntax highlighting
+ k=${k//\$/\\\$}
+ echo "${p}=\""${k}"\"" >> "${ebuildfile}"
+ set +o noglob
+ done
+
+ sed -e 's,^, ,' < ${ebuildfile}
+}
+
diff --git a/paludis/repositories/e/ebuild/ebuild.bash b/paludis/repositories/e/ebuild/ebuild.bash
index d9cd3a77e..6ad27913b 100755
--- a/paludis/repositories/e/ebuild/ebuild.bash
+++ b/paludis/repositories/e/ebuild/ebuild.bash
@@ -31,10 +31,11 @@ eval unset LANG ${!LC_*}
EBUILD_METADATA_VARIABLES="DEPEND RDEPEND PDEPEND IUSE SRC_URI RESTRICT \
LICENSE KEYWORDS INHERITED PROVIDE HOMEPAGE DESCRIPTION DEPENDENCIES \
E_IUSE E_DEPEND E_RDEPEND E_PDEPEND E_KEYWORDS PLATFORMS E_PLATFORMS \
- MYOPTIONS E_MYOPTIONS E_DEPENDENCIES"
+ MYOPTIONS E_MYOPTIONS E_DEPENDENCIES BINARY_KEYWORDS BINARY_URI \
+ GENERATED_USING GENERATED_TIME BINARY_PLATFORMS"
unset -v ${EBUILD_METADATA_VARIABLES} ${PALUDIS_EBUILD_MUST_NOT_SET_VARIABLES}
# These can be set by C++
-EBUILD_METADATA_VARIABLES="${EBUILD_METADATA_VARIABLES} SLOT EAPI"
+EBUILD_METADATA_VARIABLES="${EBUILD_METADATA_VARIABLES} SLOT EAPI OPTIONS USE"
if [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]] ; then
export SANDBOX_PREDICT="${SANDBOX_PREDICT+${SANDBOX_PREDICT}:}"
@@ -264,6 +265,11 @@ ebuild_scrub_environment()
unset -f diefunc perform_hook inherit builtin_loadenv builtin_saveenv
unset -f ebuild_safe_source portageq best_version has_version paludis_pipe_command
+ if [[ "${2}" == "--pivot" ]] ; then
+ unset -f ${PALUDIS_IGNORE_PIVOT_ENV_FUNCTIONS}
+ unset -v ${PALUDIS_IGNORE_PIVOT_ENV_VARIABLES}
+ fi
+
unset -v ROOTPATH T HOME TMPDIR PALUDIS_TMPDIR PALUDIS_EBUILD_LOG_LEVEL
unset -v PORTDIR FILESDIR ECLASSDIR DISTDIR PALUDIS_EBUILD_DIR
unset -v PALUDIS_EXTRA_DIE_MESSAGE PALUDIS_COMMAND SKIP_FUNCTIONS
@@ -333,8 +339,8 @@ ebuild_load_environment()
|| die "Can't copy ${PALUDIS_LOAD_ENVIRONMENT}"
fi
- echo ebuild_scrub_environment "${PALUDIS_TMPDIR}/environment-${CATEGORY}-${PF}-$$" 1>&2
- ebuild_scrub_environment "${PALUDIS_TMPDIR}/environment-${CATEGORY}-${PF}-$$" \
+ echo ebuild_scrub_environment "${PALUDIS_TMPDIR}/environment-${CATEGORY}-${PF}-$$" "$@" 1>&2
+ ebuild_scrub_environment "${PALUDIS_TMPDIR}/environment-${CATEGORY}-${PF}-$$" "$@" \
|| die "Can't load saved environment for cleaning"
echo ebuild_safe_source "${PALUDIS_TMPDIR}/environment-${CATEGORY}-${PF}-$$" 1>&2
@@ -436,7 +442,7 @@ ebuild_main()
for action in $@ ; do
case ${action} in
metadata|variable|init|prepare|merge|unmerge|tidyup|\
- strip|loadenv|saveenv|initbin|unpackbin|infovars)
+ strip|loadenv|saveenv|initbin|unpackbin|infovars|pivotbin|installbin)
ebuild_load_module builtin_${action}
;;
diff --git a/paludis/repositories/e/ebuild/pbin-1/Makefile.am b/paludis/repositories/e/ebuild/pbin-1/Makefile.am
new file mode 100644
index 000000000..f0c07de45
--- /dev/null
+++ b/paludis/repositories/e/ebuild/pbin-1/Makefile.am
@@ -0,0 +1,38 @@
+MAINTAINERCLEANFILES = Makefile.in
+CLEANFILES = *~
+SUBDIRS = .
+
+libexecprogpaludisbinary1dir = $(libexecdir)/paludis/pbin-1
+libexecprogpaludisbinary1_SCRIPTS = \
+ builtin_installbin.bash \
+ builtin_pivotbin.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_EBUILD_MODULE_SUFFIXES="1 0" \
+ PALUDIS_EAPIS_DIR="$(top_srcdir)/paludis/eapis/" \
+ PALUDIS_DISTRIBUTIONS_DIR="$(top_srcdir)/paludis/distributions/" \
+ PALUDIS_DISTRIBUTION="gentoo" \
+ PALUDIS_EBUILD_LOG_LEVEL="warning" \
+ 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
+
+EXTRA_DIST = $(libexecprogpaludisbinary1_SCRIPTS)
+
+TESTS =
+check_SCRIPTS = $(TESTS)
+
+built-sources : $(BUILT_SOURCES)
+ for s in `echo $(SUBDIRS) | tr -d .` ; do $(MAKE) -C $$s built-sources || exit 1 ; done
+
+distcheck-deps-local : $(DISTCHECK_DEPS)
+
+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/pbin-1/builtin_installbin.bash b/paludis/repositories/e/ebuild/pbin-1/builtin_installbin.bash
new file mode 100644
index 000000000..1e3368d1f
--- /dev/null
+++ b/paludis/repositories/e/ebuild/pbin-1/builtin_installbin.bash
@@ -0,0 +1,47 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 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_installbin()
+{
+ echo tar jvxpf ${!PALUDIS_BINARY_DISTDIR_VARIABLE}/${A} -C "${IMAGE}"/ --exclude PBIN 1>&2
+ tar jvxpf ${!PALUDIS_BINARY_DISTDIR_VARIABLE}/${A} -C "${IMAGE}"/ --exclude PBIN || die "Couldn't extract image"
+}
+
+generic_internal_installbin()
+{
+ if hasq "installbin" ${RESTRICT} ; then
+ ebuild_section "Skipping builtin_installbin (RESTRICT)"
+ elif hasq "init" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping builtin_installbin (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting builtin_installbin"
+ builtin_installbin
+ ebuild_section "Done builtin_installbin"
+ fi
+}
+
+ebuild_f_installbin()
+{
+ generic_internal_installbin "$@"
+}
+
+exheres_internal_installbin()
+{
+ generic_internal_installbin "$@"
+}
+
diff --git a/paludis/repositories/e/ebuild/pbin-1/builtin_pivotbin.bash b/paludis/repositories/e/ebuild/pbin-1/builtin_pivotbin.bash
new file mode 100644
index 000000000..5f8152a93
--- /dev/null
+++ b/paludis/repositories/e/ebuild/pbin-1/builtin_pivotbin.bash
@@ -0,0 +1,57 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 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_pivotbin()
+{
+ [[ -z "${T}" ]] || [[ ! -d "${T}" ]] && die "Can't use \$T=$T"
+
+ ebuild_section "Extracting package environment"
+ echo tar jxvf "${DISTDIR}"/"${A}" -C "${T}" --strip-components 1 PBIN/environment.bz2 1>&2
+ tar jxvf "${DISTDIR}"/"${A}" -C "${T}" --strip-components 1 PBIN/environment.bz2 || die "Couldn't extract env"
+
+ ebuild_section "Switching to package environment"
+ export PALUDIS_LOAD_ENVIRONMENT="${T}/environment.bz2"
+ ebuild_load_environment --pivot
+ export EAPI="${EAPI#pbin-1+}"
+
+ ebuild_section "Continuing using package environment"
+}
+
+generic_internal_pivotbin()
+{
+ if hasq "pivotbin" ${RESTRICT} ; then
+ ebuild_section "Skipping builtin_pivotbin (RESTRICT)"
+ elif hasq "init" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping builtin_pivotbin (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting builtin_pivotbin"
+ builtin_pivotbin
+ ebuild_section "Done builtin_pivotbin"
+ fi
+}
+
+ebuild_f_pivotbin()
+{
+ generic_internal_pivotbin "$@"
+}
+
+exheres_internal_pivotbin()
+{
+ generic_internal_pivotbin "$@"
+}
+
diff --git a/paludis/repositories/e/ebuild/source_functions.bash b/paludis/repositories/e/ebuild/source_functions.bash
index 2975ab6d2..35d0772f2 100755
--- a/paludis/repositories/e/ebuild/source_functions.bash
+++ b/paludis/repositories/e/ebuild/source_functions.bash
@@ -26,7 +26,8 @@ ebuild_safe_source()
EUID PPID UID FUNCNAME GROUPS SHELLOPTS \
'BASH_@(ARGC|ARGV|LINENO|SOURCE|VERSINFO|REMATCH)' \
'BASH_COMPLETEION?(_DIR)' 'bash+([0-9])?([a-z])' \
- EBUILD_KILL_PID PALUDIS_LOADSAVEENV_DIR PALUDIS_DO_NOTHING_SANDBOXY SANDBOX_ACTIVE
+ EBUILD_KILL_PID PALUDIS_LOADSAVEENV_DIR PALUDIS_DO_NOTHING_SANDBOXY SANDBOX_ACTIVE \
+ PALUDIS_IGNORE_PIVOT_ENV_FUNCTIONS PALUDIS_IGNORE_PIVOT_ENV_VARIABLES
trap DEBUG
set -T
diff --git a/paludis/repositories/e/ebuild/write_binary_ebuild.bash b/paludis/repositories/e/ebuild/write_binary_ebuild.bash
new file mode 100644
index 000000000..db0f257e1
--- /dev/null
+++ b/paludis/repositories/e/ebuild/write_binary_ebuild.bash
@@ -0,0 +1,134 @@
+#!/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
+
+unalias -a
+set +C
+unset GZIP BZIP BZIP2 CDPATH GREP_OPTIONS GREP_COLOR GLOBIGNORE
+eval unset LANG ${!LC_*}
+
+shopt -s expand_aliases
+shopt -s extglob
+
+if [[ -n "${PALUDIS_EBUILD_DIR_FALLBACK}" ]] ; then
+ export PATH="${PALUDIS_EBUILD_DIR_FALLBACK}/utils:${PATH}"
+fi
+export PATH="${PALUDIS_EBUILD_DIR}/utils:${PATH}"
+for p in ${PALUDIS_UTILITY_PATH_SUFFIXES} ; do
+ export PATH="${PALUDIS_EBUILD_DIR}/utils/${p}:${PATH}"
+done
+
+# Force a few more things into PATH, since some users have crazy setups.
+# See ticket:374.
+export PATH="${PATH}:/bin:/sbin:/usr/bin:/usr/sbin"
+
+EBUILD_MODULES_DIR=$(canonicalise $(dirname $0 ) )
+if ! [[ -d ${EBUILD_MODULES_DIR} ]] ; then
+ echo "${EBUILD_MODULES_DIR} is not a directory" 1>&2
+ exit 123
+fi
+
+[[ -z "${PALUDIS_EBUILD_MODULE_SUFFIXES}" ]] && PALUDIS_EBUILD_MODULE_SUFFIXES=0
+for p in ${PALUDIS_EBUILD_MODULE_SUFFIXES}; do
+ EBUILD_MODULES_DIRS="${EBUILD_MODULES_DIRS} ${EBUILD_MODULES_DIR}/${p}"
+done
+for p in ${PALUDIS_EXTRA_EBUILD_MODULES_DIRS} ; do
+ EBUILD_MODULES_DIRS="${EBUILD_MODULES_DIRS} ${p}"
+done
+EBUILD_MODULES_DIRS="${EBUILD_MODULES_DIRS} ${EBUILD_MODULES_DIR}"
+
+export PALUDIS_EBUILD_MODULES_DIR="${EBUILD_MODULES_DIR}"
+
+ebuild_load_module()
+{
+ for d in ${EBUILD_MODULES_DIRS}; do
+ if [[ -f "${d}/${1}.bash" ]]; then
+ if ! source "${d}/${1}.bash"; then
+ type die &>/dev/null && eval die "\"Error loading module \${1}\""
+ echo "Error loading module ${1}" 1>&2
+ exit 123
+ fi
+ return
+ fi
+ done
+ type die &>/dev/null && eval die "\"Couldn't find module \${1}\""
+ echo "Couldn't find module ${1}" 1>&2
+ exit 123
+}
+
+ebuild_load_module die_functions
+ebuild_load_module 0/output_functions
+ebuild_load_module echo_functions
+ebuild_load_module source_functions
+ebuild_load_module binary_functions
+
+export PALUDIS_HOME="$(canonicalise ${PALUDIS_HOME:-${HOME}} )"
+
+main()
+{
+ local ebuildfile="${1}" bindistfile="${2}" envfile="${3}" imagedir="${4}"
+
+ if ! [[ -d $(dirname "${ebuildfile}" ) ]] ; then
+ die "dirname(ebuildfile) \"$(dirname "${ebuildfile}" )\" is not a directory"
+ fi
+
+ if [[ -e "${ebuildfile}" ]] && ! [[ -f "${ebuildfile}" ]] ; then
+ die "ebuildfile \"${ebuildfile}\" exists and is not a regular file"
+ fi
+
+ if ! [[ -d $(dirname "${bindistfile}" ) ]] ; then
+ die "dirname(bindistfile) \"$(dirname "${bindistfile}" )\" is not a directory"
+ fi
+
+ if [[ -e "${bindistfile}".tar ]] ; then
+ die "bindistfile \"${bindistfile}.tar\" already exists, not overwriting"
+ fi
+
+ if [[ -e "${bindistfile}".tar.bz2 ]] ; then
+ die "bindistfile \"${bindistfile}.tar.bz2\" already exists, not overwriting"
+ fi
+
+ if ! [[ -f "${envfile}" ]] ; then
+ die "envfile \"${envfile}\" is not a file"
+ fi
+
+ if ! [[ -d "${imagedir}" ]] ; then
+ die "imagedir \"${imagedir}\" is not a directory"
+ fi
+
+ ebuild_section "Writing binary tarball to '${bindistfile}.tar.bz2'..."
+
+ make_binary_tarball "${imagedir}" "${envfile}" "${bindistfile}"
+
+ ebuild_section "Loading saved environment..."
+
+ ebuild_safe_source ${envfile}
+
+ ebuild_section "Writing binary ebuild to '${ebuildfile}'..."
+
+ make_binary_ebuild \
+ "${ebuildfile}" \
+ "${PALUDIS_BINARY_URI_PREFIX}""$(basename ${bindistfile} ).tar.bz2" \
+ "${PALUDIS_BINARY_KEYWORDS}"
+
+ ebuild_section "Finished writing binary"
+
+ true
+}
+
+main $@
+