summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorheracles <heracles@localhost>2007-03-27 12:19:59 +0000
committerheracles <heracles@localhost>2007-03-27 12:19:59 +0000
commit46d19b92b4f4fe3b19662d4e2adedeed37d8fe2f (patch)
tree3bde89aac2e6ee63ed52feb6c5841e3b9f0a2be6 /eclass
parentapp-admin/eselect-postgresql dev-db/{pgcluster,postgresql-server}: adjuste es... (diff)
downloadexperimental-46d19b92b4f4fe3b19662d4e2adedeed37d8fe2f.tar.gz
experimental-46d19b92b4f4fe3b19662d4e2adedeed37d8fe2f.tar.bz2
experimental-46d19b92b4f4fe3b19662d4e2adedeed37d8fe2f.zip
adjusted multislot to abstain from exporting illicit functions
svn path=/experimental/; revision=245
Diffstat (limited to 'eclass')
-rw-r--r--eclass/multislot.eclass40
-rw-r--r--eclass/postgresql-ext.eclass29
2 files changed, 38 insertions, 31 deletions
diff --git a/eclass/multislot.eclass b/eclass/multislot.eclass
index 56fbfd8..17d55ea 100644
--- a/eclass/multislot.eclass
+++ b/eclass/multislot.eclass
@@ -10,9 +10,24 @@
ECLASS="multislot"
INHERITED="$INHERITED $ECLASS"
-EXPORT_FUNCTIONS \
- src_unpack src_compile src_test src_install \
- slot_src_unpack slot_src_compile slot_src_test slot_src_install
+EXPORT_FUNCTIONS src_unpack src_compile src_test src_install
+
+# Return the list of functions to try (the first match takes precedence)
+# multislot_funs <function_name> <parameters>
+multislot_run_fun() {
+ local fun="${1}"
+ shift
+ if [[ "$(type -t "$fun")" == function ]] ; then
+ $fun "$@"
+ return $?
+ fi
+ for e in ${MULTISLOT_ECLASSES} multislot ; do
+ if [[ "$(type -t "${e}_$fun")" == function ]] ; then
+ ${e}_$fun "$@"
+ return $?
+ fi
+ done
+}
# Store unslotted workdir for future reference if it wasn't stored yet.
multislot_storeWD() {
@@ -20,7 +35,7 @@ multislot_storeWD() {
}
# Discover what slots are we building for
multislot_storeSlots() {
- [[ -z "${MULTISLOT_SLOTS}" ]] && MULTISLOT_SLOTS="$(slots_enumerate)"
+ [[ -z "${MULTISLOT_SLOTS}" ]] && MULTISLOT_SLOTS="$(multislot_run_fun slots_enumerate)"
}
# Set up WORKDIR, S and SLOTSLOT variables for particular slot
@@ -40,7 +55,7 @@ multislot_src_unpack() {
multislot_slot_vars $slot
mkdir -p "${WORKDIR}"
cd "${WORKDIR}"
- slot_src_unpack
+ multislot_run_fun slot_src_unpack "$@"
done
}
@@ -50,7 +65,7 @@ multislot_src_compile() {
for slot in ${MULTISLOT_SLOTS} ; do
multislot_slot_vars $slot
cd ${S}
- slot_src_compile
+ multislot_run_fun slot_src_compile "$@"
done
}
multislot_src_test() {
@@ -59,7 +74,7 @@ multislot_src_test() {
for slot in ${MULTISLOT_SLOTS} ; do
multislot_slot_vars $slot
cd ${S}
- slot_src_test
+ multislot_run_fun slot_src_test "$@"
done
}
multislot_src_install() {
@@ -68,19 +83,10 @@ multislot_src_install() {
for slot in ${MULTISLOT_SLOTS} ; do
multislot_slot_vars $slot
cd ${S}
- slot_src_install
+ multislot_run_fun slot_src_install "$@"
done
}
multislot_slot_src_unpack() {
unpack ${A}
}
-multislot_slot_src_compile() {
- :
-}
-multislot_slot_src_test() {
- :
-}
-multislot_slot_src_install() {
- :
-}
diff --git a/eclass/postgresql-ext.eclass b/eclass/postgresql-ext.eclass
index fedce0a..de258b4 100644
--- a/eclass/postgresql-ext.eclass
+++ b/eclass/postgresql-ext.eclass
@@ -10,14 +10,12 @@
ECLASS="postgresql-ext"
INHERITED="$INHERITED $ECLASS"
inherit postgresql multislot
-EXPORT_FUNCTIONS \
- src_unpack src_compile src_install \
- slot_src_unpack slot_src_compile slot_src_test slot_src_install \
- pgslot_src_unpack pgslot_src_compile pgslot_src_test pgslot_src_install \
- slots_enumerate
+EXPORT_FUNCTIONS src_unpack src_compile src_test src_install
+
+MULTISLOT_ECLASSES="postgresql-ext ${MULTISLOT_ECLASSES}"
postgresql-ext_slots_enumerate() {
- postgresql_get_versions_range ${POSTGREXT_SLOTS}
+ postgresql_get_versions_range ${WANT_POSTGRES_SLOTS}
}
postgresql-ext_src_unpack() {
@@ -34,16 +32,16 @@ postgresql-ext_src_test() {
}
postgresql-ext_slot_src_unpack() {
- PATH="$(postgresql_get_bindir_for_slot $SLOTSLOT):${PATH}" pgslot_src_unpack
+ PATH="$(postgresql_get_bindir_for_slot $SLOTSLOT):${PATH}" multislot_run_fun pgslot_src_unpack "$@"
}
postgresql-ext_slot_src_compile() {
- PATH="$(postgresql_get_bindir_for_slot $SLOTSLOT):${PATH}" pgslot_src_compile
+ PATH="$(postgresql_get_bindir_for_slot $SLOTSLOT):${PATH}" multislot_run_fun pgslot_src_compile "$@"
}
postgresql-ext_slot_src_test() {
- PATH="$(postgresql_get_bindir_for_slot $SLOTSLOT):${PATH}" pgslot_src_test
+ PATH="$(postgresql_get_bindir_for_slot $SLOTSLOT):${PATH}" multislot_run_fun pgslot_src_test "$@"
}
postgresql-ext_slot_src_install() {
- PATH="$(postgresql_get_bindir_for_slot $SLOTSLOT):${PATH}" pgslot_src_install
+ PATH="$(postgresql_get_bindir_for_slot $SLOTSLOT):${PATH}" multislot_run_fun pgslot_src_install "$@"
}
postgresql-ext_pgslot_src_unpack() {
@@ -59,14 +57,17 @@ postgresql-ext_pgslot_src_install() {
multislot_slot_src_install
}
-pg_slots_depend() {
- local vers=( ${POSTGREXT_SLOTS} )
+postgresql-ext_pg_slots_depend() {
+ local vers=( ${WANT_POSTGRES_SLOTS} )
if [[ -z "${vers[0]}" ]] ; then
echo 'virtual/postgresql-server'
else
- echo ">=virtual/postgresql-server-${vers[0]}*"
+ echo ">=virtual/postgresql-server-${vers[0]}"
if [[ ! -z "${vers[1]}" ]] ; then
- echo "<=virtual/postgresql-server-${vers[1]}*"
+ echo "<=virtual/postgresql-server-${vers[1]}"
fi
fi
}
+
+DEPEND="$(postgresql-ext_pg_slots_depend)"
+RDEPEND="$(postgresql-ext_pg_slots_depend)"