Gentoo Archives: gentoo-commits

From: Aaron Swenson <titanofold@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/pgsql-patches:eselect commit in: /
Date: Sat, 02 Apr 2011 11:24:30
Message-Id: 12c9b1948d79dac76e1f1a5148de1c2260838673.titanofold@gentoo
1 commit: 12c9b1948d79dac76e1f1a5148de1c2260838673
2 Author: Aaron W. Swenson <titanofold <AT> gentoo <DOT> org>
3 AuthorDate: Sat Apr 2 11:17:29 2011 +0000
4 Commit: Aaron Swenson <titanofold <AT> gentoo <DOT> org>
5 CommitDate: Sat Apr 2 11:17:29 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/pgsql-patches.git;a=commit;h=12c9b194
7
8 Links all lib* files and symlinks in /usr/lib(64)?/postgresql${SLOT}/lib(64)?
9 Unset now calls do_update() as per bug #360467.
10 do_update() simply calls do_set() rather than do_reset() to avoid loops, and a
11 reset wasn't really necessary anyway.
12 Added '-mindepth 1' to 'find' in linker() so that only the contents are returned
13 and not the directory itself.
14 Fixed comments regarding linker().
15
16 ---
17 postgresql.eselect | 18 ++++++++++--------
18 1 files changed, 10 insertions(+), 8 deletions(-)
19
20 diff --git a/postgresql.eselect b/postgresql.eselect
21 index e4cc599..21eb803 100644
22 --- a/postgresql.eselect
23 +++ b/postgresql.eselect
24 @@ -7,7 +7,7 @@ inherit config multilib
25 DESCRIPTION="Manage active PostgreSQL client applications and libraries"
26 MAINTAINER="pgsql-bugs@g.o"
27 SVN_DATE='$Date: $'
28 -VERSION="1.0.5"
29 +VERSION="1.0.6"
30
31 # Global Data
32 B_PATH="${EROOT%/}/usr"
33 @@ -36,9 +36,9 @@ lib_dir() {
34 }
35
36 ### Linker Function ###
37 -# Takes three arguments:
38 +# Takes four arguments:
39 # - Full source path (e.g. /usr/lib/postgresql-9.0/lib)
40 -# _ Pattern to search for
41 +# - Pattern to search for
42 # - Full target directory path (e.g. /usr/bin)
43 # - Suffix (Optional) (e.g 84 to make /usr/bin/psql84)
44 linker() {
45 @@ -48,7 +48,7 @@ linker() {
46 local suffix=$4
47 local link_source
48
49 - for link_source in $(find "${source_dir}" -maxdepth 1 ${pattern}) ; do
50 + for link_source in $(find "${source_dir}" -maxdepth 1 -mindepth 1 ${pattern}) ; do
51 local link_target="${target_dir%/}/$(basename ${link_source})${suffix}"
52
53 # For good measure, remove target before creating the symlink
54 @@ -194,12 +194,12 @@ do_set() {
55 echo "${B_PATH}/${x}/postgresql" >> "${E_PATH}"/active.links
56 # Linker works for files
57 linker "${B_PATH}/${x}/postgresql-${SLOT}/${x}" \
58 - "-name lib*[a|dylib|so]" "${B_PATH}/${x}"
59 + "-name lib*" "${B_PATH}/${x}"
60 fi
61 done
62
63 # Link binaries to /usr/bin/
64 - linker "${B_PATH}/$(lib_dir)/postgresql-${SLOT}/bin/" \
65 + linker "${B_PATH}/$(lib_dir)/postgresql-${SLOT}/bin" \
66 "-xtype f" "${B_PATH}/bin"
67
68 # Default share path
69 @@ -223,6 +223,8 @@ do_unset() {
70 unlinker "${E_PATH}/active.links"
71 rm -f "${E_PATH}/active"
72 echo "done."
73 + echo "Setting a new slot as the default."
74 + do_update
75 else
76 echo "Inactive slot selected. No work to do."
77 fi
78 @@ -280,7 +282,7 @@ do_update() {
79
80 # Reset, otherwise set the highest slot available.
81 if [[ ${slots[@]} =~ ${slot} ]] ; then
82 - do_reset
83 + do_set ${slot}
84 else
85 # best_version doesn't work here as pkg_postrm runs before the world
86 # file is updated, thereby returning a false positive.
87 @@ -313,7 +315,7 @@ do_update() {
88 done
89 local share_path="${B_PATH}/share/postgresql-${curslot}/"
90 [[ -d ${share_path} ]] && manpath+=":${share_path}"
91 - linker "${B_PATH}/$(lib_dir)/postgresql-${curslot}/bin/" \
92 + linker "${B_PATH}/$(lib_dir)/postgresql-${curslot}/bin" \
93 "-xtype f" "${B_PATH}/bin" "${curslot//.}"
94 echo "done."
95 done