aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-01-08 08:53:23 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-01-08 08:53:23 +0000
commitcc2065217d1acd31ffa4c10530eae72b2321e169 (patch)
tree9ad6c01bc7172dadb0699ab82ac4a93c92a0c1e7
parent261d35f90f9680f5b3af418400957906ccfe498d (diff)
downloadpaludis-cc2065217d1acd31ffa4c10530eae72b2321e169.tar.gz
paludis-cc2065217d1acd31ffa4c10530eae72b2321e169.tar.xz
Move echo_functions.bash to paludis/util/. Move ebuild / exheres specific code out into conditional_functions.bash.
-rw-r--r--configure.ac3
-rw-r--r--hooks/Makefile.am.m41
-rw-r--r--hooks/demos/elog.bash.in2
-rw-r--r--hooks/demos/new_packages.bash.in2
-rwxr-xr-xhooks/eselect_env_update.bash4
-rwxr-xr-xhooks/find_config_updates.hook4
-rwxr-xr-xhooks/gnu_info_index.bash4
-rwxr-xr-xhooks/installable_cache_regen.bash4
-rwxr-xr-xhooks/installed_cache_regen.bash4
-rwxr-xr-xhooks/news.hook4
-rwxr-xr-xhooks/update_config_protect_list.bash2
-rwxr-xr-xhooks/write_cache_clean.bash4
-rw-r--r--paludis/repositories/e/Makefile.am1
-rw-r--r--paludis/repositories/e/ebuild/Makefile.am6
-rw-r--r--paludis/repositories/e/ebuild/conditional_functions.bash40
-rw-r--r--paludis/repositories/e/ebuild/conditional_functions_TEST.bash (renamed from paludis/repositories/e/ebuild/echo_functions_TEST.bash)0
-rwxr-xr-xpaludis/repositories/e/ebuild/ebuild.bash6
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/Makefile.am2
-rwxr-xr-xpaludis/repositories/e/ebuild/exheres-0/conditional_functions.bash50
-rwxr-xr-xpaludis/repositories/e/ebuild/exheres-0/echo_functions.bash.in212
-rwxr-xr-xpaludis/repositories/e/ebuild/write_vdb_entry.bash36
-rw-r--r--paludis/repositories/e/qa/Makefile.am1
-rw-r--r--paludis/util/Makefile.am.m413
-rw-r--r--paludis/util/echo_functions.bash.in (renamed from paludis/repositories/e/ebuild/echo_functions.bash.in)18
-rw-r--r--python/Makefile.am1
-rw-r--r--ruby/Makefile.am1
-rw-r--r--src/clients/accerso/Makefile.am1
-rw-r--r--src/clients/adjutrix/Makefile.am1
-rw-r--r--src/clients/paludis/Makefile.am1
29 files changed, 165 insertions, 263 deletions
diff --git a/configure.ac b/configure.ac
index 571353c..0662ec9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1302,9 +1302,7 @@ AC_OUTPUT(
paludis/repositories/e/ebuild/0/Makefile
paludis/repositories/e/ebuild/1/Makefile
paludis/repositories/e/ebuild/Makefile
- paludis/repositories/e/ebuild/echo_functions.bash
paludis/repositories/e/ebuild/exheres-0/Makefile
- paludis/repositories/e/ebuild/exheres-0/echo_functions.bash
paludis/repositories/e/ebuild/utils/Makefile
paludis/repositories/e/ebuild/utils/exheres-0/Makefile
paludis/repositories/e/qa/Makefile
@@ -1315,6 +1313,7 @@ AC_OUTPUT(
paludis/selinux/Makefile
paludis/syncers/Makefile
paludis/util/Makefile
+ paludis/util/echo_functions.bash
pkg-config/Makefile
python/Makefile
ruby/Makefile
diff --git a/hooks/Makefile.am.m4 b/hooks/Makefile.am.m4
index a5c44b0..d27739d 100644
--- a/hooks/Makefile.am.m4
+++ b/hooks/Makefile.am.m4
@@ -282,6 +282,7 @@ TESTS_ENVIRONMENT = env \
PALUDIS_COMMAND="$(top_builddir)/src/clients/paludis/paludis" \
PALUDIS_HOOKER_DIR="$(top_srcdir)/paludis/" \
PALUDIS_OUTPUTWRAPPER_DIR="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/util/`" \
+ PALUDIS_ECHO_FUNCTIONS_DIR="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/util/`" \
PALUDIS_EBUILD_DIR="$(top_srcdir)/paludis/repositories/e/ebuild/" \
PALUDIS_EAPIS_DIR="$(top_srcdir)/paludis/repositories/e/eapis/" \
PALUDIS_DISTRIBUTIONS_DIR="$(top_srcdir)/paludis/distributions/" \
diff --git a/hooks/demos/elog.bash.in b/hooks/demos/elog.bash.in
index ba4361b..6e1598a 100644
--- a/hooks/demos/elog.bash.in
+++ b/hooks/demos/elog.bash.in
@@ -26,7 +26,7 @@ case "${EBUILD_PHASE}" in
config|pretend|metadata) return
esac
-source ${PALUDIS_EBUILD_DIR}/echo_functions.bash
+source ${PALUDIS_ECHO_FUNCTIONS_DIR:-${PALUDIS_EBUILD_DIR}}/echo_functions.bash
logfile="${PALUDIS_HOOKS_TMPDIR:-${ROOT}/var/tmp/paludis}/elog.${PALUDIS_PID}"
diff --git a/hooks/demos/new_packages.bash.in b/hooks/demos/new_packages.bash.in
index 9a3830e..9783e7a 100644
--- a/hooks/demos/new_packages.bash.in
+++ b/hooks/demos/new_packages.bash.in
@@ -10,7 +10,7 @@
#
# You should ensure that it has execute permissions.
-source ${PALUDIS_EBUILD_DIR}/echo_functions.bash
+source ${PALUDIS_ECHO_FUNCTIONS_DIR:-${PALUDIS_EBUILD_DIR}}/echo_functions.bash
syncfile="${PALUDIS_HOOKS_TMPDIR:-${ROOT}/var/tmp/paludis}/sync.${PALUDIS_PID}"
diff --git a/hooks/eselect_env_update.bash b/hooks/eselect_env_update.bash
index dd87bed..ef55f10 100755
--- a/hooks/eselect_env_update.bash
+++ b/hooks/eselect_env_update.bash
@@ -1,7 +1,7 @@
#!/bin/bash
# vim: set et sw=4 sts=4 :
-# Copyright (c) 2006, 2007 Ciaran McCreesh
+# 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
@@ -17,7 +17,7 @@
# Place, Suite 330, Boston, MA 02111-1307 USA
export PATH="$(${PALUDIS_EBUILD_DIR}/utils/canonicalise ${PALUDIS_EBUILD_DIR}/utils/ ):${PATH}"
-source ${PALUDIS_EBUILD_DIR}/echo_functions.bash
+source ${PALUDIS_ECHO_FUNCTIONS_DIR:-${PALUDIS_EBUILD_DIR}}/echo_functions.bash
if [[ -n "${PALUDIS_NO_LIVE_DESTINATION}" ]] ; then
einfo_unhooked "No need to regenerate environment"
diff --git a/hooks/find_config_updates.hook b/hooks/find_config_updates.hook
index 6864487..da5156b 100755
--- a/hooks/find_config_updates.hook
+++ b/hooks/find_config_updates.hook
@@ -1,7 +1,7 @@
#!/bin/bash
# vim: set et sw=4 sts=4 :
-# Copyright (c) 2006, 2007 Ciaran McCreesh
+# 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
@@ -21,7 +21,7 @@ check_for_config_updates()
shopt -s extglob
export PATH="$(${PALUDIS_EBUILD_DIR}/utils/canonicalise ${PALUDIS_EBUILD_DIR}/utils/ ):${PATH}"
- source ${PALUDIS_EBUILD_DIR}/echo_functions.bash
+ source ${PALUDIS_ECHO_FUNCTIONS_DIR:-${PALUDIS_EBUILD_DIR}}/echo_functions.bash
if [[ -n "${PALUDIS_NO_LIVE_DESTINATION}" ]] ; then
einfo_unhooked "No need to search for configuration files requiring action"
diff --git a/hooks/gnu_info_index.bash b/hooks/gnu_info_index.bash
index 799f92f..f0b132a 100755
--- a/hooks/gnu_info_index.bash
+++ b/hooks/gnu_info_index.bash
@@ -1,7 +1,7 @@
#!/bin/bash
# vim: set et sw=4 sts=4 :
-# Copyright (c) 2006, 2007 Ciaran McCreesh
+# 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
@@ -17,7 +17,7 @@
# Place, Suite 330, Boston, MA 02111-1307 USA
export PATH="$(${PALUDIS_EBUILD_DIR}/utils/canonicalise ${PALUDIS_EBUILD_DIR}/utils/ ):${PATH}"
-source ${PALUDIS_EBUILD_DIR}/echo_functions.bash
+source ${PALUDIS_ECHO_FUNCTIONS_DIR:-${PALUDIS_EBUILD_DIR}}/echo_functions.bash
if [[ -n "${PALUDIS_NO_LIVE_DESTINATION}" ]] ; then
einfo_unhooked "No need to update the GNU info directory"
diff --git a/hooks/installable_cache_regen.bash b/hooks/installable_cache_regen.bash
index 2889196..83df6a7 100755
--- a/hooks/installable_cache_regen.bash
+++ b/hooks/installable_cache_regen.bash
@@ -1,7 +1,7 @@
#!/bin/bash
# vim: set et sw=4 sts=4 :
-# Copyright (c) 2006 Ciaran McCreesh
+# 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
@@ -17,7 +17,7 @@
# Place, Suite 330, Boston, MA 02111-1307 USA
export PATH="$(${PALUDIS_EBUILD_DIR}/utils/canonicalise ${PALUDIS_EBUILD_DIR}/utils/ ):${PATH}"
-source ${PALUDIS_EBUILD_DIR}/echo_functions.bash
+source ${PALUDIS_ECHO_FUNCTIONS_DIR:-${PALUDIS_EBUILD_DIR}}/echo_functions.bash
echo
einfo_unhooked "Regenerating cache for installable repositories..."
diff --git a/hooks/installed_cache_regen.bash b/hooks/installed_cache_regen.bash
index 617277c..dc1d39b 100755
--- a/hooks/installed_cache_regen.bash
+++ b/hooks/installed_cache_regen.bash
@@ -1,7 +1,7 @@
#!/bin/bash
# vim: set et sw=4 sts=4 :
-# Copyright (c) 2006 Ciaran McCreesh
+# 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
@@ -17,7 +17,7 @@
# Place, Suite 330, Boston, MA 02111-1307 USA
export PATH="$(${PALUDIS_EBUILD_DIR}/utils/canonicalise ${PALUDIS_EBUILD_DIR}/utils/ ):${PATH}"
-source ${PALUDIS_EBUILD_DIR}/echo_functions.bash
+source ${PALUDIS_ECHO_FUNCTIONS_DIR:-${PALUDIS_EBUILD_DIR}}/echo_functions.bash
echo
einfo_unhooked "Regenerating cache for installed repositories..."
diff --git a/hooks/news.hook b/hooks/news.hook
index 12d3e08..7cb396b 100755
--- a/hooks/news.hook
+++ b/hooks/news.hook
@@ -1,7 +1,7 @@
#!/bin/bash
# vim: set et sw=4 sts=4 :
-# Copyright (c) 2006, 2007 Ciaran McCreesh
+# 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
@@ -20,7 +20,7 @@ check_for_news()
{
export PATH="$(${PALUDIS_EBUILD_DIR}/utils/canonicalise ${PALUDIS_EBUILD_DIR}/utils/ ):${PATH}"
export ROOT="${ROOT}"
- source ${PALUDIS_EBUILD_DIR}/echo_functions.bash
+ source ${PALUDIS_ECHO_FUNCTIONS_DIR:-${PALUDIS_EBUILD_DIR}}/echo_functions.bash
count="$(eselect news count )"
done_echo=
diff --git a/hooks/update_config_protect_list.bash b/hooks/update_config_protect_list.bash
index 37febc3..77f1630 100755
--- a/hooks/update_config_protect_list.bash
+++ b/hooks/update_config_protect_list.bash
@@ -17,7 +17,7 @@
# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
# Place, Suite 330, Boston, MA 02111-1307 USA
-source ${PALUDIS_EBUILD_DIR}/echo_functions.bash
+source ${PALUDIS_ECHO_FUNCTIONS_DIR:-${PALUDIS_EBUILD_DIR}}/echo_functions.bash
if [[ -n "${PALUDIS_NO_LIVE_DESTINATION}" ]] ; then
einfo_unhooked "No need to update CONFIG_PROTECT lists"
diff --git a/hooks/write_cache_clean.bash b/hooks/write_cache_clean.bash
index 03e6c74..85f83b4 100755
--- a/hooks/write_cache_clean.bash
+++ b/hooks/write_cache_clean.bash
@@ -1,7 +1,7 @@
#!/bin/bash
# vim: set et sw=4 sts=4 :
-# Copyright (c) 2007 Ciaran McCreesh
+# 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
@@ -17,7 +17,7 @@
# Place, Suite 330, Boston, MA 02111-1307 USA
export PATH="$(${PALUDIS_EBUILD_DIR}/utils/canonicalise ${PALUDIS_EBUILD_DIR}/utils/ ):${PATH}"
-source ${PALUDIS_EBUILD_DIR}/echo_functions.bash
+source ${PALUDIS_ECHO_FUNCTIONS_DIR:-${PALUDIS_EBUILD_DIR}}/echo_functions.bash
[[ -n "${PALUDIS_NO_WRITE_CACHE_CLEAN}" ]] && exit 0
diff --git a/paludis/repositories/e/Makefile.am b/paludis/repositories/e/Makefile.am
index aa18120..1784388 100644
--- a/paludis/repositories/e/Makefile.am
+++ b/paludis/repositories/e/Makefile.am
@@ -386,6 +386,7 @@ TESTS_ENVIRONMENT = env \
PALUDIS_OUTPUTWRAPPER_DIR="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/util/`" \
PALUDIS_EBUILD_DIR="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(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_EXTRA_EBUILD_MODULES_DIRS="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/util/`" \
PALUDIS_EAPIS_DIR="$(top_srcdir)/paludis/repositories/e/eapis/" \
PALUDIS_DISTRIBUTIONS_DIR="$(top_srcdir)/paludis/distributions/" \
PALUDIS_DISTRIBUTION="gentoo" \
diff --git a/paludis/repositories/e/ebuild/Makefile.am b/paludis/repositories/e/ebuild/Makefile.am
index a81190a..8d03622 100644
--- a/paludis/repositories/e/ebuild/Makefile.am
+++ b/paludis/repositories/e/ebuild/Makefile.am
@@ -19,9 +19,9 @@ libexecprog_SCRIPTS = \
builtin_tidyup.bash \
builtin_unpackbin.bash \
builtin_variable.bash \
+ conditional_functions.bash \
die_functions.bash \
ebuild.bash \
- echo_functions.bash \
kernel_functions.bash \
eclass_functions.bash \
ever_functions.bash \
@@ -51,6 +51,7 @@ libexecprog_SCRIPTS = \
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_EXTRA_EBUILD_MODULES_DIRS="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/util/`" \
PALUDIS_EAPIS_DIR="$(top_srcdir)/paludis/eapis/" \
PALUDIS_DISTRIBUTIONS_DIR="$(top_srcdir)/paludis/distributions/" \
PALUDIS_DISTRIBUTION="gentoo" \
@@ -59,7 +60,7 @@ TESTS_ENVIRONMENT = env \
TEST_SCRIPT_DIR="$(srcdir)/" \
bash $(top_srcdir)/test/run_test.sh $(top_srcdir)/paludis/repositories/e/ebuild/run_test.bash
-TESTS = echo_functions_TEST.bash list_functions_TEST.bash kernel_functions_TEST.bash
+TESTS = conditional_functions_TEST.bash list_functions_TEST.bash kernel_functions_TEST.bash
EXTRA_DIST = $(libexecprog_SCRIPTS) run_test.bash $(TESTS) $(check_SCRIPTS)
@@ -73,3 +74,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/conditional_functions.bash b/paludis/repositories/e/ebuild/conditional_functions.bash
new file mode 100644
index 0000000..3bd41c5
--- /dev/null
+++ b/paludis/repositories/e/ebuild/conditional_functions.bash
@@ -0,0 +1,40 @@
+#!/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
+
+use_with()
+{
+ if useq "${1}" ; then
+ echo "--with-${2:-${1}}${3+=${3}}"
+ else
+ echo "--without-${2:-${1}}"
+ fi
+}
+
+use_enable()
+{
+ if useq "${1}" ; then
+ echo "--enable-${2:-${1}}${3+=${3}}"
+ else
+ echo "--disable-${2:-${1}}"
+ fi
+}
+
diff --git a/paludis/repositories/e/ebuild/echo_functions_TEST.bash b/paludis/repositories/e/ebuild/conditional_functions_TEST.bash
index 68abc07..68abc07 100644
--- a/paludis/repositories/e/ebuild/echo_functions_TEST.bash
+++ b/paludis/repositories/e/ebuild/conditional_functions_TEST.bash
diff --git a/paludis/repositories/e/ebuild/ebuild.bash b/paludis/repositories/e/ebuild/ebuild.bash
index 981b9ca..cfb3fe6 100755
--- a/paludis/repositories/e/ebuild/ebuild.bash
+++ b/paludis/repositories/e/ebuild/ebuild.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
@@ -75,6 +75,9 @@ export PALUDIS_EBUILD_MODULES_DIR="${EBUILD_MODULES_DIR}"
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}"
ebuild_load_module()
@@ -131,6 +134,7 @@ paludis_pipe_command()
ebuild_load_module die_functions
ebuild_load_module echo_functions
+ebuild_load_module conditional_functions
ebuild_load_module kernel_functions
ebuild_load_module sandbox
ebuild_load_module portage_stubs
diff --git a/paludis/repositories/e/ebuild/exheres-0/Makefile.am b/paludis/repositories/e/ebuild/exheres-0/Makefile.am
index 18be6c9..64e1bc7 100644
--- a/paludis/repositories/e/ebuild/exheres-0/Makefile.am
+++ b/paludis/repositories/e/ebuild/exheres-0/Makefile.am
@@ -8,7 +8,7 @@ libexecprogexheres_SCRIPTS = \
builtin_fetch.bash \
pkg_nofetch.bash \
list_functions.bash \
- echo_functions.bash \
+ conditional_functions.bash \
ever_functions.bash \
portage_stubs.bash
diff --git a/paludis/repositories/e/ebuild/exheres-0/conditional_functions.bash b/paludis/repositories/e/ebuild/exheres-0/conditional_functions.bash
new file mode 100755
index 0000000..15bcd64
--- /dev/null
+++ b/paludis/repositories/e/ebuild/exheres-0/conditional_functions.bash
@@ -0,0 +1,50 @@
+#!/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
+
+use_with()
+{
+ die "Function 'use_with' banned in this EAPI"
+}
+
+use_enable()
+{
+ die "Function 'use_enable' banned in this EAPI"
+}
+
+option_with()
+{
+ if optionq "${1}" ; then
+ echo "--with-${2:-${1}}${3+=${3}}"
+ else
+ echo "--without-${2:-${1}}"
+ fi
+}
+
+option_enable()
+{
+ if optionq "${1}" ; then
+ echo "--enable-${2:-${1}}${3+=${3}}"
+ else
+ echo "--disable-${2:-${1}}"
+ fi
+}
+
diff --git a/paludis/repositories/e/ebuild/exheres-0/echo_functions.bash.in b/paludis/repositories/e/ebuild/exheres-0/echo_functions.bash.in
deleted file mode 100755
index d981045..0000000
--- a/paludis/repositories/e/ebuild/exheres-0/echo_functions.bash.in
+++ /dev/null
@@ -1,212 +0,0 @@
-#!/bin/bash
-# vim: set sw=4 sts=4 et :
-
-@GENERATED_FILE@
-
-# 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
-
-[[ -z ${PALUDIS_COLOURS} ]] && PALUDIS_COLOURS=@COLOURSCHEME@
-
-COLOUR_GREEN=$'\e[32;01m'
-COLOUR_YELLOW=$'\e[33;01m'
-COLOUR_RED=$'\e[31;01m'
-COLOUR_BLUE=$'\e[34;01m'
-COLOUR_PINK=$'\e[35;01m'
-
-if [[ ${PALUDIS_COLOURS} == pink ]]; then
- COLOUR_GOOD=${COLOUR_PINK}
- COLOUR_WARN=${COLOUR_YELLOW}
- COLOUR_BAD=${COLOUR_RED}
- COLOUR_BRACKET=${COLOUR_PINK}
-else
- COLOUR_GOOD=${COLOUR_GREEN}
- COLOUR_WARN=${COLOUR_YELLOW}
- COLOUR_BAD=${COLOUR_RED}
- COLOUR_BRACKET=${COLOUR_BLUE}
-fi
-
-COLOUR_NORMAL=$'\e[0m'
-PALUDIS_ENDCOL=$'\e[A\e['$(( ${COLUMNS:-80} - 7 ))'G'
-
-paludis_ecmd()
-{
- local cmd="$1" hook="$2" prefix="$3" message="$4" newline="$5"
-
- echo -n "${prefix}${message}"
- [[ -z "${newline}" ]] && echo
-
- if type perform_hook &>/dev/null ; then
- if [[ -n "${hook}" ]] ; then
- MESSAGE="${message}" perform_hook "${hook}"
- fi
- fi
-}
-
-einfon()
-{
- paludis_ecmd \
- "einfon" \
- "einfo" \
- "`echo -ne " ${COLOUR_GOOD}*${COLOUR_NORMAL} "`" \
- "$*" \
- "no"
-}
-
-einfo()
-{
- paludis_ecmd \
- "einfo" \
- "einfo" \
- "`echo -ne " ${COLOUR_GOOD}*${COLOUR_NORMAL} "`" \
- "$*"
-}
-
-einfo_unhooked()
-{
- paludis_ecmd \
- "einfo" \
- "" \
- "`echo -ne " ${COLOUR_GOOD}*${COLOUR_NORMAL} "`" \
- "$*"
-}
-
-elog()
-{
- paludis_ecmd \
- "elog" \
- "elog" \
- "`echo -ne " ${COLOUR_GOOD}*${COLOUR_NORMAL} "`" \
- "$*"
-
- if [[ -n "${PALUDIS_ELOG_FILE}" ]] ; then
- echo "$@" >> "${PALUDIS_ELOG_FILE}"
- fi
-}
-
-ewarn()
-{
- paludis_ecmd \
- "ewarn" \
- "ewarn" \
- "`echo -ne " ${COLOUR_WARN}*${COLOUR_NORMAL} "`" \
- "$*"
-}
-
-eerror()
-{
- paludis_ecmd \
- "eerror" \
- "eerror" \
- "`echo -ne " ${COLOUR_BAD}*${COLOUR_NORMAL} "`" \
- "$*"
-}
-
-ebegin()
-{
- paludis_ecmd \
- "ebegin" \
- "einfo" \
- "`echo -ne " ${COLOUR_GOOD}*${COLOUR_NORMAL} "`" \
- "$* ..."
-}
-
-ebegin_unhooked()
-{
- paludis_ecmd \
- "ebegin" \
- "" \
- "`echo -ne " ${COLOUR_GOOD}*${COLOUR_NORMAL} "`" \
- "$* ..."
-}
-
-_eend()
-{
- local retval=${1:-0} efunc=${2:-eerror} msg
- shift 2
-
- if [[ ${retval} == 0 ]]; then
- msg="${COLOUR_BRACKET}[ ${COLOUR_GOOD}ok${COLOUR_BRACKET} ]${COLOUR_NORMAL}"
- else
- if [[ -n "$*" ]]; then
- ${efunc} $*
- fi
- msg="${COLOUR_BRACKET}[ ${COLOUR_BAD}!!${COLOUR_BRACKET} ]${COLOUR_NORMAL}"
- fi
-
- echo -e "${PALUDIS_ENDCOL} ${msg}"
-
- return ${retval}
-}
-
-eend()
-{
- local retval=${1:-0}
- shift
- _eend ${retval} eerror "$*"
- return ${retval}
-}
-
-ewend()
-{
- local retval=${1:-0}
- shift
- _eend ${retval} ewarn "$*"
- return ${retval}
-}
-
-use_with()
-{
- die "Function 'use_with' banned in this EAPI"
-}
-
-use_enable()
-{
- die "Function 'use_enable' banned in this EAPI"
-}
-
-option_with()
-{
- if optionq "${1}" ; then
- echo "--with-${2:-${1}}${3+=${3}}"
- else
- echo "--without-${2:-${1}}"
- fi
-}
-
-option_enable()
-{
- if optionq "${1}" ; then
- echo "--enable-${2:-${1}}${3+=${3}}"
- else
- echo "--disable-${2:-${1}}"
- fi
-}
-
-ebuild_notice()
-{
- [[ -z "${PALUDIS_PIPE_COMMANDS_SUPPORTED}" ]] && return
- paludis_pipe_command LOG "$EAPI" "$@" >/dev/null
-}
-
-ebuild_section()
-{
- echo ">>> $*"
-}
-
diff --git a/paludis/repositories/e/ebuild/write_vdb_entry.bash b/paludis/repositories/e/ebuild/write_vdb_entry.bash
index ab5fb44..478345c 100755
--- a/paludis/repositories/e/ebuild/write_vdb_entry.bash
+++ b/paludis/repositories/e/ebuild/write_vdb_entry.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
#
# 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
@@ -28,6 +28,14 @@ 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
@@ -35,13 +43,29 @@ if ! [[ -d ${EBUILD_MODULES_DIR} ]] ; then
fi
export PALUDIS_EBUILD_MODULES_DIR="${EBUILD_MODULES_DIR}"
+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}"
+
ebuild_load_module()
{
- if ! source "${EBUILD_MODULES_DIR}/${1}.bash" ; then
- type die && die "Error loading module ${1}"
- echo "Error loading module ${1}" 1>&2
- exit 123
- fi
+ 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
diff --git a/paludis/repositories/e/qa/Makefile.am b/paludis/repositories/e/qa/Makefile.am
index bf6616b..ebf1807 100644
--- a/paludis/repositories/e/qa/Makefile.am
+++ b/paludis/repositories/e/qa/Makefile.am
@@ -85,6 +85,7 @@ TESTS_ENVIRONMENT = env \
PALUDIS_OUTPUTWRAPPER_DIR="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/util/`" \
PALUDIS_EBUILD_DIR="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(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_EXTRA_EBUILD_MODULES_DIRS="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/util/`" \
PALUDIS_EAPIS_DIR="$(top_srcdir)/paludis/repositories/e/eapis/" \
PALUDIS_QA_DATA_DIR="$(top_srcdir)/paludis/repositories/e/qa/" \
PALUDIS_DISTRIBUTIONS_DIR="$(top_srcdir)/paludis/distributions/" \
diff --git a/paludis/util/Makefile.am.m4 b/paludis/util/Makefile.am.m4
index c7cec8d..0c6d210 100644
--- a/paludis/util/Makefile.am.m4
+++ b/paludis/util/Makefile.am.m4
@@ -66,7 +66,7 @@ include(`paludis/util/files.m4')
CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda
MAINTAINERCLEANFILES = Makefile.in Makefile.am paludis.hh \
- hashed_containers.hh util.hh
+ hashed_containers.hh util.hh echo_functions.bash
DISTCLEANFILES = srcleanlist secleanlist
BUILT_SOURCES = srcleanlist secleanlist
DEFS=\
@@ -74,7 +74,8 @@ DEFS=\
-DLIBEXECDIR=\"$(libexecdir)\"
EXTRA_DIST = util.hh.m4 Makefile.am.m4 files.m4 srlist srcleanlist selist secleanlist \
testscriptlist \
- test_extras.cc
+ test_extras.cc \
+ echo_functions.bash.in
SUBDIRS = .
libpaludisutil_la_SOURCES = filelist
@@ -102,8 +103,12 @@ Makefile.am : Makefile.am.m4 files.m4
util.hh : util.hh.m4 files.m4
$(top_srcdir)/misc/do_m4.bash util.hh
-libexecprogdir = $(libexecdir)/paludis/utils
-libexecprog_PROGRAMS = outputwrapper
+libexecutilsdir = $(libexecdir)/paludis/utils
+libexecutils_PROGRAMS = outputwrapper
+
+libexecpaludisdir = $(libexecdir)/paludis
+libexecpaludis_SCRIPTS = echo_functions.bash
+
outputwrapper_SOURCES = output_wrapper.cc
changequote(`<', `>')
diff --git a/paludis/repositories/e/ebuild/echo_functions.bash.in b/paludis/util/echo_functions.bash.in
index 39affa5..931c3e3 100644
--- a/paludis/repositories/e/ebuild/echo_functions.bash.in
+++ b/paludis/util/echo_functions.bash.in
@@ -171,24 +171,6 @@ ewend()
return ${retval}
}
-use_with()
-{
- if useq "${1}" ; then
- echo "--with-${2:-${1}}${3+=${3}}"
- else
- echo "--without-${2:-${1}}"
- fi
-}
-
-use_enable()
-{
- if useq "${1}" ; then
- echo "--enable-${2:-${1}}${3+=${3}}"
- else
- echo "--disable-${2:-${1}}"
- fi
-}
-
ebuild_notice()
{
[[ -z "${PALUDIS_PIPE_COMMANDS_SUPPORTED}" ]] && return
diff --git a/python/Makefile.am b/python/Makefile.am
index ff53d4d..b2dbd9a 100644
--- a/python/Makefile.am
+++ b/python/Makefile.am
@@ -106,6 +106,7 @@ TESTS_ENVIRONMENT = env \
PALUDIS_NO_XTERM_TITLES="yes" \
PALUDIS_EBUILD_DIR="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(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_EXTRA_EBUILD_MODULES_DIRS="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/util/`" \
PALUDIS_EAPIS_DIR="$(top_srcdir)/paludis/repositories/e/eapis/" \
PALUDIS_DISTRIBUTIONS_DIR="$(top_srcdir)/paludis/distributions/" \
PALUDIS_DISTRIBUTION="gentoo" \
diff --git a/ruby/Makefile.am b/ruby/Makefile.am
index eac409a..042e65f 100644
--- a/ruby/Makefile.am
+++ b/ruby/Makefile.am
@@ -80,6 +80,7 @@ TESTS_ENVIRONMENT = env \
PALUDIS_NO_XTERM_TITLES="yes" \
PALUDIS_EBUILD_DIR="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(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_EXTRA_EBUILD_MODULES_DIRS="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/util/`" \
PALUDIS_EAPIS_DIR="$(top_srcdir)/paludis/repositories/e/eapis/" \
PALUDIS_QA_DATA_DIR="$(top_srcdir)/paludis/repositories/e/qa/" \
PALUDIS_DISTRIBUTIONS_DIR="$(top_srcdir)/paludis/distributions/" \
diff --git a/src/clients/accerso/Makefile.am b/src/clients/accerso/Makefile.am
index 1e1232b..b7dd971 100644
--- a/src/clients/accerso/Makefile.am
+++ b/src/clients/accerso/Makefile.am
@@ -47,6 +47,7 @@ TESTS_ENVIRONMENT = env \
PALUDIS_OPTIONS="" \
PALUDIS_EBUILD_DIR="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(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_EXTRA_EBUILD_MODULES_DIRS="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/util/`" \
PALUDIS_EAPIS_DIR="$(top_srcdir)/paludis/repositories/e/eapis/" \
PALUDIS_DISTRIBUTIONS_DIR="$(top_srcdir)/paludis/distributions/" \
PALUDIS_DISTRIBUTION="gentoo" \
diff --git a/src/clients/adjutrix/Makefile.am b/src/clients/adjutrix/Makefile.am
index b2b1fd9..d91b814 100644
--- a/src/clients/adjutrix/Makefile.am
+++ b/src/clients/adjutrix/Makefile.am
@@ -59,6 +59,7 @@ TESTS_ENVIRONMENT = env \
PALUDIS_NO_XTERM_TITLES="yes" \
PALUDIS_EBUILD_DIR="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(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_EXTRA_EBUILD_MODULES_DIRS="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/util/`" \
PALUDIS_EAPIS_DIR="$(top_srcdir)/paludis/repositories/e/eapis/" \
PALUDIS_DISTRIBUTIONS_DIR="$(top_srcdir)/paludis/distributions/" \
PALUDIS_DISTRIBUTION="gentoo" \
diff --git a/src/clients/paludis/Makefile.am b/src/clients/paludis/Makefile.am
index cd28da8..a503f63 100644
--- a/src/clients/paludis/Makefile.am
+++ b/src/clients/paludis/Makefile.am
@@ -59,6 +59,7 @@ TESTS_ENVIRONMENT = env \
PALUDIS_OPTIONS="" \
PALUDIS_EBUILD_DIR="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(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_EXTRA_EBUILD_MODULES_DIRS="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/util/`" \
PALUDIS_EAPIS_DIR="$(top_srcdir)/paludis/repositories/e/eapis/" \
PALUDIS_DISTRIBUTIONS_DIR="$(top_srcdir)/paludis/distributions/" \
PALUDIS_DISTRIBUTION="gentoo" \