aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Mike Kelly <pioto@pioto.org> 2008-10-26 01:20:29 -0400
committerAvatar Mike Kelly <pioto@pioto.org> 2008-10-26 01:20:29 -0400
commitfa60a909b04ba84d79556e7df7dd7d22e513302c (patch)
treec01fec90b39d1bf0bcf014e8f3c580ef8699ee7f
parent2775c7df7ac65dd9524924cf7d7bb0227956356c (diff)
downloadpaludis-fa60a909b04ba84d79556e7df7dd7d22e513302c.tar.gz
paludis-fa60a909b04ba84d79556e7df7dd7d22e513302c.tar.xz
Add --with-config-framework=[eselect|eclectic].
Defaults to eselect. Lets Exherbo finally drop eselect. Fixes: ticket:657
-rw-r--r--.gitignore2
-rw-r--r--configure.ac26
-rw-r--r--hooks/Makefile.am.m43
-rwxr-xr-xhooks/eselect_env_update.bash.in (renamed from hooks/eselect_env_update.bash)2
-rwxr-xr-xhooks/news.hook.in (renamed from hooks/news.hook)4
5 files changed, 26 insertions, 11 deletions
diff --git a/.gitignore b/.gitignore
index 79ecda8..8e6a4b6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -166,6 +166,8 @@ paludis-*.*.*.tar.bz2
/hooks/demos/new_packages.bash
/hooks/demos/pretend_resume.hook
/hooks/demos/report.bash
+/hooks/eselect_env_update.bash
+/hooks/news.hook
/image
/libtool
/paludis/Makefile.am
diff --git a/configure.ac b/configure.ac
index fabd17e..62433f0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1361,22 +1361,30 @@ if test "x$need_gem_check" = "xyes" ; then
fi
dnl }}}
-dnl {{{ check for eselect
-AC_MSG_CHECKING([for eselect])
-if eselect version >/dev/null 2>/dev/null ; then
- AC_MSG_RESULT([yes])
+dnl {{{ eselect or eclectic
+AC_MSG_CHECKING([for config framework])
+AC_ARG_WITH([config-framework],
+ AS_HELP_STRING([--with-config-framework=@<:@eselect|eclectic@:>@], [Specify whether to use eselect or eclectic (default: eselect)]),
+ CONFIG_FRAMEWORK=`eval echo $withval`,
+ CONFIG_FRAMEWORK=eselect)
+
+if $CONFIG_FRAMEWORK version >/dev/null 2>/dev/null ; then
+ AC_MSG_RESULT([$CONFIG_FRAMEWORK])
else
AC_MSG_RESULT([no])
- AC_MSG_ERROR([eselect is required])
+ AC_MSG_ERROR([eselect or eclectic are required])
fi
+AC_SUBST([CONFIG_FRAMEWORK])
+dnl }}}
+dnl {{{ check eselect/eclectic env and news
for m in env news ; do
- AC_MSG_CHECKING([for eselect $m])
- if eselect $m version >/dev/null 2>/dev/null ; then
+ AC_MSG_CHECKING([for $CONFIG_FRAMEWORK $m])
+ if $CONFIG_FRAMEWORK $m version >/dev/null 2>/dev/null ; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
- AC_MSG_ERROR([eselect $m is required])
+ AC_MSG_ERROR([$CONFIG_FRAMEWORK $m is required])
fi
done
dnl }}}
@@ -1417,6 +1425,8 @@ AC_OUTPUT(
doc/faq/Makefile
doc/overview/Makefile
hooks/Makefile
+ hooks/eselect_env_update.bash
+ hooks/news.hook
hooks/demos/Makefile
misc/Makefile
paludis/Makefile
diff --git a/hooks/Makefile.am.m4 b/hooks/Makefile.am.m4
index c1ce500..d9871a6 100644
--- a/hooks/Makefile.am.m4
+++ b/hooks/Makefile.am.m4
@@ -298,3 +298,6 @@ TESTS_ENVIRONMENT = env \
TOP_SRCDIR="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_srcdir)`" \
bash $(top_srcdir)/hooks/run_test.bash
+all-local :
+ chmod +x $(builddir)/news.hook $(builddir)/eselect_env_update.bash
+
diff --git a/hooks/eselect_env_update.bash b/hooks/eselect_env_update.bash.in
index 3371e44..7a8166f 100755
--- a/hooks/eselect_env_update.bash
+++ b/hooks/eselect_env_update.bash.in
@@ -26,7 +26,7 @@ fi
echo
einfo_unhooked "Regenerating environment..."
-eselect env update || ewarn "Regeneration failed"
+@CONFIG_FRAMEWORK@ env update || ewarn "Regeneration failed"
einfo_unhooked "Done regenerating environment"
true
diff --git a/hooks/news.hook b/hooks/news.hook.in
index 0f7039f..b5eeb08 100755
--- a/hooks/news.hook
+++ b/hooks/news.hook.in
@@ -21,12 +21,12 @@ check_for_news()
export PATH="$(${PALUDIS_EBUILD_DIR}/utils/canonicalise ${PALUDIS_EBUILD_DIR}/utils/ ):${PATH}"
export ROOT="${ROOT}"
source ${PALUDIS_ECHO_FUNCTIONS_DIR:-${PALUDIS_EBUILD_DIR}}/echo_functions.bash
- count="$(eselect news count )"
+ count="$(@CONFIG_FRAMEWORK@ news count )"
done_echo=
if [[ ${count} -gt 0 ]] ; then
[[ -z "${done_echo}" ]] && echo ; done_echo=yes
- ewarn "You have ${count} unread news items (use 'eselect news' to read)"
+ ewarn "You have ${count} unread news items (use '@CONFIG_FRAMEWORK@ news' to read)"
elif [[ "${HOOK/pretend}" == "${HOOK}" ]] ; then
[[ -z "${done_echo}" ]] && echo ; done_echo=yes
einfo_unhooked "No unread news items found"