aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--postgresql.eselect18
1 files changed, 10 insertions, 8 deletions
diff --git a/postgresql.eselect b/postgresql.eselect
index e4cc599..21eb803 100644
--- a/postgresql.eselect
+++ b/postgresql.eselect
@@ -7,7 +7,7 @@ inherit config multilib
DESCRIPTION="Manage active PostgreSQL client applications and libraries"
MAINTAINER="pgsql-bugs@gentoo.org"
SVN_DATE='$Date: $'
-VERSION="1.0.5"
+VERSION="1.0.6"
# Global Data
B_PATH="${EROOT%/}/usr"
@@ -36,9 +36,9 @@ lib_dir() {
}
### Linker Function ###
-# Takes three arguments:
+# Takes four arguments:
# - Full source path (e.g. /usr/lib/postgresql-9.0/lib)
-# _ Pattern to search for
+# - Pattern to search for
# - Full target directory path (e.g. /usr/bin)
# - Suffix (Optional) (e.g 84 to make /usr/bin/psql84)
linker() {
@@ -48,7 +48,7 @@ linker() {
local suffix=$4
local link_source
- for link_source in $(find "${source_dir}" -maxdepth 1 ${pattern}) ; do
+ for link_source in $(find "${source_dir}" -maxdepth 1 -mindepth 1 ${pattern}) ; do
local link_target="${target_dir%/}/$(basename ${link_source})${suffix}"
# For good measure, remove target before creating the symlink
@@ -194,12 +194,12 @@ do_set() {
echo "${B_PATH}/${x}/postgresql" >> "${E_PATH}"/active.links
# Linker works for files
linker "${B_PATH}/${x}/postgresql-${SLOT}/${x}" \
- "-name lib*[a|dylib|so]" "${B_PATH}/${x}"
+ "-name lib*" "${B_PATH}/${x}"
fi
done
# Link binaries to /usr/bin/
- linker "${B_PATH}/$(lib_dir)/postgresql-${SLOT}/bin/" \
+ linker "${B_PATH}/$(lib_dir)/postgresql-${SLOT}/bin" \
"-xtype f" "${B_PATH}/bin"
# Default share path
@@ -223,6 +223,8 @@ do_unset() {
unlinker "${E_PATH}/active.links"
rm -f "${E_PATH}/active"
echo "done."
+ echo "Setting a new slot as the default."
+ do_update
else
echo "Inactive slot selected. No work to do."
fi
@@ -280,7 +282,7 @@ do_update() {
# Reset, otherwise set the highest slot available.
if [[ ${slots[@]} =~ ${slot} ]] ; then
- do_reset
+ do_set ${slot}
else
# best_version doesn't work here as pkg_postrm runs before the world
# file is updated, thereby returning a false positive.
@@ -313,7 +315,7 @@ do_update() {
done
local share_path="${B_PATH}/share/postgresql-${curslot}/"
[[ -d ${share_path} ]] && manpath+=":${share_path}"
- linker "${B_PATH}/$(lib_dir)/postgresql-${curslot}/bin/" \
+ linker "${B_PATH}/$(lib_dir)/postgresql-${curslot}/bin" \
"-xtype f" "${B_PATH}/bin" "${curslot//.}"
echo "done."
done