* [gentoo-commits] proj/postgresql/eselect:master commit in: /
@ 2017-04-18 19:43 Aaron Swenson
0 siblings, 0 replies; 28+ messages in thread
From: Aaron Swenson @ 2017-04-18 19:43 UTC (permalink / raw
To: gentoo-commits
commit: 019fd73a6afaffad2126e617acc6fbd894bfd4db
Author: Aaron W. Swenson <titanofold <AT> gentoo <DOT> org>
AuthorDate: Fri May 20 13:55:16 2016 +0000
Commit: Aaron Swenson <titanofold <AT> gentoo <DOT> org>
CommitDate: Fri May 20 13:55:16 2016 +0000
URL: https://gitweb.gentoo.org/proj/postgresql/eselect.git/commit/?id=019fd73a
Use pg_config to get version numbers
Now that the ebuilds are unified, we don't really need a bunch of files
laying around containing version number and which ebuild is providing
it.
And, pg_config can give us the version number anyway. Sure, we miss out
on revision numbers, but people really shouldn't be using this tool to
get that detailed.
So, given that, rework the do_list.
postgresql.eselect | 36 +++++++++++++++++++++++-------------
1 file changed, 23 insertions(+), 13 deletions(-)
diff --git a/postgresql.eselect b/postgresql.eselect
index 1e9ff3b..8d816dc 100644
--- a/postgresql.eselect
+++ b/postgresql.eselect
@@ -122,28 +122,36 @@ describe_list() {
}
do_list() {
- write_list_start "Available PostgreSQL Slots"
-
if $(is_output_mode brief) ; then
echo $(get_slots)
else
+ write_list_start "Available PostgreSQL Slots"
+
+ local provider
local slot
+ local bindir
for slot in $(get_slots) ; do
- local postgres_ebuilds=""
- local src
- for src in "${E_PATH}"/slots/${slot}/{server,service,base,docs} ; do
- [[ -r ${src} ]] && source "${src}"
- done
+ bindir="${B_PATH}/$(lib_dir)/postgresql-${slot}/bin"
+
+ # The output of `pg_config --version` also includes "PostgreSQL" in
+ # the string, which is a bit redundant.
+ provider=$("${bindir}"/pg_config --version | \
+ sed 's/[^0-9]*\(.*\)/\1/')
+
+ # Unless a file exists that's controlled by the 'server' use flag,
+ # report that it's client only.
+ [[ -e "${bindir}/postmaster" ]] || provider+=' (Clients Only)'
case "${slot}" in
- "$(active_slot)" ) write_kv_list_entry \
- "$(highlight_marker ${slot})" "${postgres_ebuilds//postgresql-/}";;
- * ) write_kv_list_entry \
- "${slot}" "${postgres_ebuilds//postgresql-/}";;
+ "$(active_slot)" )
+ write_kv_list_entry \
+ "$(highlight_marker ${slot})" "${provider}";;
+ * )
+ write_kv_list_entry "${slot}" "${provider}";;
esac
done
- [[ -z ${postgres_ebuilds} ]] && write_warning_msg "No slots available."
+ [[ -z "$(get_slots)" ]] && write_warning_msg "No slots available."
fi
}
@@ -292,8 +300,10 @@ do_update() {
local slot=$(active_slot)
# Remove some files outright as they're entirely useless now.
+ # ${E_PATH}/active: Contents was the active slot (e.g., 9.5)
+ # ${E_PATH}/service: Told the initscript which slot to start
local f
- for f in "${E_PATH}/active" "${E_PATH}/service"; do
+ for f in "${E_PATH}/active" "${E_PATH}/service" ; do
[[ -e "${f}" ]] && rm -f "${f}"
done
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [gentoo-commits] proj/postgresql/eselect:master commit in: /
@ 2017-04-18 19:43 Aaron Swenson
0 siblings, 0 replies; 28+ messages in thread
From: Aaron Swenson @ 2017-04-18 19:43 UTC (permalink / raw
To: gentoo-commits
commit: 7190ae6e3da59f7390b0e00081594d672bffc0db
Author: Aaron W. Swenson <titanofold <AT> gentoo <DOT> org>
AuthorDate: Wed May 18 19:10:19 2016 +0000
Commit: Aaron Swenson <titanofold <AT> gentoo <DOT> org>
CommitDate: Wed May 18 19:10:19 2016 +0000
URL: https://gitweb.gentoo.org/proj/postgresql/eselect.git/commit/?id=7190ae6e
Stateless: No longer rely on an 'active' file
Working towards a stateless module, no need to keep track of links or
active slot in a collection of files.
/usr/share/postgresql is symbolic link generated by this module. So, we're
able to determine which real directory it's pointing to, which will be
/usr/share/postgresql-SLOT. A bit of sed magic gets just the slot
portion off the end. Et voila! We no longer need to store the active
slot in a file.
If /usr/share/postgresql doesn't exist, then we haven't set a slot.
postgresql.eselect | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/postgresql.eselect b/postgresql.eselect
index 6468ab6..1e9ff3b 100644
--- a/postgresql.eselect
+++ b/postgresql.eselect
@@ -14,8 +14,11 @@ E_PATH="${EROOT%/}/etc/eselect/postgresql"
ENV_FILE="${EROOT%/}/etc/env.d/50postgresql"
active_slot() {
- if [[ -r ${E_PATH}/active && -n ${E_PATH}/active ]] ; then
- echo $( <"${E_PATH}"/active )
+ # ${B_PATH}/share/postgresql is a symlink. See if it's there, then
+ # find out where it links to
+ if [[ -h "${B_PATH}/share/postgresql" ]] ; then
+ canonicalise "${B_PATH}/share/postgresql" | \
+ sed 's|.*postgresql-\([1-9][0-9.]*\)|\1|'
else
echo "(none)"
fi
@@ -246,7 +249,6 @@ do_set() {
ln -s "postgresql-${SLOT}" "${B_PATH}/share/postgresql"
echo "${B_PATH##${ROOT%/}/}/share/postgresql" >> "${E_PATH}/active.links"
- echo ${SLOT} > "${E_PATH}/active"
echo "done."
echo "Setting ${SLOT} as default was successful!"
}
@@ -261,7 +263,6 @@ do_unset() {
if [[ ${SLOT} = $(active_slot) ]] ; then
echo -n "Unsetting ${SLOT} as the default installation..."
unlinker "${E_PATH}/active.links"
- rm -f "${E_PATH}/active"
echo "done."
echo "Setting a new slot as the default."
do_update
@@ -289,13 +290,13 @@ describe_update() {
do_update() {
local slot=$(active_slot)
- # Check for files managed by postgresql.eselect before 1.0
- if [[ -h ${E_PATH}/active ]] ; then
- slot="$(basename $(canonicalise ${E_PATH}/active)))"
- rm -f "${E_PATH}/active"
- fi
- # Remove service file outright.
- [[ -h ${E_PATH}/service ]] && rm -f "${E_PATH}/service"
+
+ # Remove some files outright as they're entirely useless now.
+ local f
+ for f in "${E_PATH}/active" "${E_PATH}/service"; do
+ [[ -e "${f}" ]] && rm -f "${f}"
+ done
+
local slots=($(get_slots))
local index=${#slots[@]}
@@ -313,7 +314,6 @@ do_update() {
for sym_links in "${E_PATH}"/active.links* ; do
unlinker "${sym_links}"
done
- rm -f "${E_PATH}/active"
rm -f "${ENV_FILE}"
do_action env update &> /dev/null
echo "Done!"
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [gentoo-commits] proj/postgresql/eselect:master commit in: /
@ 2017-04-18 19:43 Aaron Swenson
0 siblings, 0 replies; 28+ messages in thread
From: Aaron Swenson @ 2017-04-18 19:43 UTC (permalink / raw
To: gentoo-commits
commit: 2901113fc0cf9f574729af30aef33cea26becbc9
Author: Aaron W. Swenson <titanofold <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 6 11:43:41 2017 +0000
Commit: Aaron Swenson <titanofold <AT> gentoo <DOT> org>
CommitDate: Mon Feb 6 11:43:41 2017 +0000
URL: https://gitweb.gentoo.org/proj/postgresql/eselect.git/commit/?id=2901113f
Eliminate some noise
Removed unnecessary echo about generating new links.
postgresql.eselect | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/postgresql.eselect b/postgresql.eselect
index b8ecbe1..67f7b74 100644
--- a/postgresql.eselect
+++ b/postgresql.eselect
@@ -199,9 +199,8 @@ do_set() {
echo "done."
fi
- echo "Setting ${slot} as the default..."
+ echo -ne "Setting ${slot} as the default..."
- echo -ne "\tGenerating new links..."
# Sources for header files
# Targets are listed in the global variable INCLUDE_TARGETS.
#
@@ -264,8 +263,7 @@ do_set() {
# base name
ln -s "postgresql-${slot}" "${USR_PATH}/share/postgresql"
- echo "done."
- echo "Setting ${slot} as default was successful!"
+ echo "success!"
}
### Unset Action ###
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [gentoo-commits] proj/postgresql/eselect:master commit in: /
2017-04-18 19:43 [gentoo-commits] proj/postgresql/eselect:stateless " Aaron Swenson
@ 2017-04-18 19:43 ` Aaron Swenson
0 siblings, 0 replies; 28+ messages in thread
From: Aaron Swenson @ 2017-04-18 19:43 UTC (permalink / raw
To: gentoo-commits
commit: a49cc145883fdb24113096e3c73a1c6f76eb46de
Author: Aaron W. Swenson <titanofold <AT> gentoo <DOT> org>
AuthorDate: Tue Apr 18 19:43:07 2017 +0000
Commit: Aaron Swenson <titanofold <AT> gentoo <DOT> org>
CommitDate: Tue Apr 18 19:43:07 2017 +0000
URL: https://gitweb.gentoo.org/proj/postgresql/eselect.git/commit/?id=a49cc145
Change to the proper directory level for tar
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 22dec4a..f2937fe 100644
--- a/Makefile
+++ b/Makefile
@@ -4,7 +4,7 @@ V := $(shell grep V $(D)/postgresql.eselect | grep -Po '[0-9.]+')
all:
mkdir -p $(D)/eselect-postgresql-$(V)
cp $(D)/postgresql.eselect $(D)/eselect-postgresql-$(V)/
- tar cjf $(D)/eselect-postgresql-$(V).tbz2 $(D)/eselect-postgresql-$(V)
+ cd ${D} && tar cjf eselect-postgresql-$(V).tbz2 eselect-postgresql-$(V)
clean:
rm $(D)/eselect-postgresql-$(V)/postgresql.eselect
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [gentoo-commits] proj/postgresql/eselect:master commit in: /
@ 2017-04-18 19:43 Aaron Swenson
0 siblings, 0 replies; 28+ messages in thread
From: Aaron Swenson @ 2017-04-18 19:43 UTC (permalink / raw
To: gentoo-commits
commit: 5d82111e0fe1b9002f07855a523186da5fdbeb78
Author: Aaron W. Swenson <titanofold <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 12 12:54:18 2017 +0000
Commit: Aaron Swenson <titanofold <AT> gentoo <DOT> org>
CommitDate: Wed Apr 12 12:54:18 2017 +0000
URL: https://gitweb.gentoo.org/proj/postgresql/eselect.git/commit/?id=5d82111e
Add gitignore and makefile
.gitignore | 1 +
Makefile | 12 ++++++++++++
2 files changed, 13 insertions(+)
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..77482bd
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+eselect-postgresql*
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..22dec4a
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,12 @@
+D := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
+V := $(shell grep V $(D)/postgresql.eselect | grep -Po '[0-9.]+')
+
+all:
+ mkdir -p $(D)/eselect-postgresql-$(V)
+ cp $(D)/postgresql.eselect $(D)/eselect-postgresql-$(V)/
+ tar cjf $(D)/eselect-postgresql-$(V).tbz2 $(D)/eselect-postgresql-$(V)
+
+clean:
+ rm $(D)/eselect-postgresql-$(V)/postgresql.eselect
+ rmdir $(D)/eselect-postgresql-$(V)
+ rm $(D)/eselect-postgresql-$(V).tbz2
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [gentoo-commits] proj/postgresql/eselect:master commit in: /
2017-02-06 13:19 [gentoo-commits] proj/postgresql/eselect:stateless " Aaron Swenson
@ 2017-04-18 19:43 ` Aaron Swenson
0 siblings, 0 replies; 28+ messages in thread
From: Aaron Swenson @ 2017-04-18 19:43 UTC (permalink / raw
To: gentoo-commits
commit: 4a6f0ad3208a0e27a24377c4a2aa3d3cb78517c4
Author: Aaron W. Swenson <titanofold <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 6 11:53:49 2017 +0000
Commit: Aaron Swenson <titanofold <AT> gentoo <DOT> org>
CommitDate: Mon Feb 6 11:53:49 2017 +0000
URL: https://gitweb.gentoo.org/proj/postgresql/eselect.git/commit/?id=4a6f0ad3
Remove redundant do_unset() call
do_set() calls do_unset(). No need to call it before do_set().
postgresql.eselect | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/postgresql.eselect b/postgresql.eselect
index 83db02f..d7229e5 100644
--- a/postgresql.eselect
+++ b/postgresql.eselect
@@ -382,11 +382,8 @@ do_update() {
# may have changed.
do_set ${active_slot}
elif [[ ${#slots[@]} -ne 0 ]] ; then
- # If $slots is not empty but ${active_slot} is set, the active_slot
- # must have been unmerged and its links need to be cleaned before...
- [[ ${active_slot} != "(none)" ]] && do_unset ${active_slot}
-
- # Setting the highest slot available.
+ # If $slots is not empty and active_slot is not in the list, set the
+ # highest slot available.
do_set ${slots[-1]}
elif [[ ${active_slot} != "(none)" ]] ; then
# If slots is empty, but active_slot still has a value, an unset must
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [gentoo-commits] proj/postgresql/eselect:master commit in: /
@ 2017-04-18 19:43 Aaron Swenson
0 siblings, 0 replies; 28+ messages in thread
From: Aaron Swenson @ 2017-04-18 19:43 UTC (permalink / raw
To: gentoo-commits
commit: fec9c553ad737a3fe6b5fae6f07b02d84ce6f7bc
Author: Aaron W. Swenson <titanofold <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 6 11:49:53 2017 +0000
Commit: Aaron Swenson <titanofold <AT> gentoo <DOT> org>
CommitDate: Mon Feb 6 11:49:53 2017 +0000
URL: https://gitweb.gentoo.org/proj/postgresql/eselect.git/commit/?id=fec9c553
Remove useless reset action
The reset action is usless as do_set calls do_unset if active_slot is
something other than (none).
postgresql.eselect | 16 ++--------------
1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/postgresql.eselect b/postgresql.eselect
index 67f7b74..83db02f 100644
--- a/postgresql.eselect
+++ b/postgresql.eselect
@@ -328,18 +328,6 @@ do_unset() {
done
}
-### Reset Action ###
-describe_reset() {
- echo "Recreate symbolic links for currently active slot."
-}
-
-do_reset() {
- local slot=$(active_slot)
- [[ ${slot} == "(none)" ]] && die -q "No active slot to reset."
- do_unset ${slot}
- do_set ${slot}
-}
-
### Update Action ###
describe_update() {
echo "Refreshes all symbolic links managed by this module"
@@ -390,9 +378,9 @@ do_update() {
local slots=($(get_slots))
if [[ ${slots[@]} =~ ${active_slot} ]] ; then
- # If active_slot is in the slots list, do a reset as the installation
+ # If active_slot is in the slots list, set it again as the installation
# may have changed.
- do_reset
+ do_set ${active_slot}
elif [[ ${#slots[@]} -ne 0 ]] ; then
# If $slots is not empty but ${active_slot} is set, the active_slot
# must have been unmerged and its links need to be cleaned before...
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [gentoo-commits] proj/postgresql/eselect:master commit in: /
@ 2017-04-18 19:43 Aaron Swenson
0 siblings, 0 replies; 28+ messages in thread
From: Aaron Swenson @ 2017-04-18 19:43 UTC (permalink / raw
To: gentoo-commits
commit: cf8d18a608598ed63775ad44c423f7a8e0320399
Author: Aaron W. Swenson <titanofold <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 8 22:53:26 2016 +0000
Commit: Aaron Swenson <titanofold <AT> gentoo <DOT> org>
CommitDate: Mon Aug 8 22:53:26 2016 +0000
URL: https://gitweb.gentoo.org/proj/postgresql/eselect.git/commit/?id=cf8d18a6
Remove TODO Refactor out finder
It’s been moved.
postgresql.eselect | 2 --
1 file changed, 2 deletions(-)
diff --git a/postgresql.eselect b/postgresql.eselect
index 93dc723..2d4b84c 100644
--- a/postgresql.eselect
+++ b/postgresql.eselect
@@ -71,8 +71,6 @@ finder() {
set +f
}
-### TODO: Refactor to move find into a separate function
-
### Linker Function ###
# Takes four arguments:
# - Full source path (e.g. /usr/lib/postgresql-9.0/lib)
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [gentoo-commits] proj/postgresql/eselect:master commit in: /
@ 2017-04-18 19:43 Aaron Swenson
0 siblings, 0 replies; 28+ messages in thread
From: Aaron Swenson @ 2017-04-18 19:43 UTC (permalink / raw
To: gentoo-commits
commit: 64844b8bf854a1651efb7e0d0473e808a0f5aa8b
Author: Aaron W. Swenson <titanofold <AT> gentoo <DOT> org>
AuthorDate: Sat May 21 13:22:24 2016 +0000
Commit: Aaron Swenson <titanofold <AT> gentoo <DOT> org>
CommitDate: Sat May 21 13:22:24 2016 +0000
URL: https://gitweb.gentoo.org/proj/postgresql/eselect.git/commit/?id=64844b8b
Remove most/all active.links creation points
Refactor do_set so that it doesn't create active.links* files. Will need
to refactor unlinker and move its content into do_update.
do_unset now does a lot more work to look for and remove symlinks
managed by this module.
postgresql.eselect | 100 ++++++++++++++++++++++++++++++++++++-----------------
1 file changed, 68 insertions(+), 32 deletions(-)
diff --git a/postgresql.eselect b/postgresql.eselect
index 8d816dc..160e60e 100644
--- a/postgresql.eselect
+++ b/postgresql.eselect
@@ -13,6 +13,20 @@ B_PATH="${EROOT%/}/usr"
E_PATH="${EROOT%/}/etc/eselect/postgresql"
ENV_FILE="${EROOT%/}/etc/env.d/50postgresql"
+# This list of files/directories are the symbolic link targets that need to be
+# created when a slot is set.
+#
+# If you change this list, remember to change include_sources in do_set. And,
+# they must be listed in the same order.
+INCLUDE_TARGETS=(
+ "${B_PATH}"/include/postgresql
+ "${B_PATH}"/include/libpq-fe.h
+ "${B_PATH}"/include/pg_config_ext.h
+ "${B_PATH}"/include/pg_config_manual.h
+ "${B_PATH}"/include/libpq
+ "${B_PATH}"/include/postgres_ext.h
+)
+
active_slot() {
# ${B_PATH}/share/postgresql is a symlink. See if it's there, then
# find out where it links to
@@ -40,6 +54,8 @@ lib_dir() {
fi
}
+### TODO: Refactor to move find into a separate function
+
### Linker Function ###
# Takes four arguments:
# - Full source path (e.g. /usr/lib/postgresql-9.0/lib)
@@ -75,10 +91,12 @@ linker() {
# root if $ROOT is not "/".
rel_source=$(relative_name "${link_source}" "${target_dir}")
ln -s "${rel_source}" "${link_target}" || die -q "Unable to create link!"
- echo "${link_target##${ROOT%/}/}" >> "${E_PATH}"/active.links${suffix}
done
}
+### TODO: Refactor so that it searches source directories for removal targets,
+### and move the old stuff into do_update
+
### Unlinker Function ###
# Takes one argument:
# - Full path to active links file (e.g. /etc/eselect/postgresql/active.links)
@@ -181,20 +199,31 @@ describe_set() {
do_set() {
local SLOT=$1
+
if [[ ! -d ${B_PATH}/$(lib_dir)/postgresql-${SLOT} ]] ; then
die -q "Not a valid slot."
fi
- echo "Setting ${SLOT} as the default installation..."
+ # If there's an active slot, unset that one first
+ if [[ "$(active_slot)" == "${SLOT}" ]] ; then
+ echo $(highlight "No work to do.")
+ echo "If you think the links need to be reset, use the reset action."
+ return 0
+ elif [[ "$(active_slot)" != "(none)" ]] ; then
+ echo -ne "\tRemoving old links..."
+ do_unset $(active_slot)
+ echo "done."
+ fi
- # Remove the active links to start a fresh list
- echo -ne "\tRemoving old links..."
- unlinker ${E_PATH}/active.links
- echo "done."
+ echo "Setting ${SLOT} as the default installation..."
echo -ne "\tGenerating new links..."
- # Sources and targets for header files
- local sources=(
+ # Sources for header files
+ # Targets are listed in the global variable INCLUDE_TARGETS.
+ #
+ # If you change this list, you must change the INCLUDE_TARGETS list,
+ # too. And, they must be listed in the same order.
+ local include_sources=(
"${B_PATH}"/include/postgresql-${SLOT}
"${B_PATH}"/include/postgresql-${SLOT}/libpq-fe.h
"${B_PATH}"/include/postgresql-${SLOT}/pg_config_ext.h
@@ -202,35 +231,20 @@ do_set() {
"${B_PATH}"/include/postgresql-${SLOT}/libpq
"${B_PATH}"/include/postgresql-${SLOT}/postgres_ext.h
)
- local targets=(
- "${B_PATH}"/include/postgresql
- "${B_PATH}"/include/libpq-fe.h
- "${B_PATH}"/include/pg_config_ext.h
- "${B_PATH}"/include/pg_config_manual.h
- "${B_PATH}"/include/libpq
- "${B_PATH}"/include/postgres_ext.h
- )
# The linker function cannot accomadate this special purpose.
local rel_source
local i
- for (( i=0; $i < ${#sources[@]}; i++ )) ; do
- # Remove target before creating the symlink
- [[ -h ${targets[$i]} ]] && rm -f "${targets[$i]}"
-
- # Check if link_target still exists
- [[ -e ${targets[$i]} ]] && \
- die -q "The target '${targets[$i]}' exists and could not be removed!"
-
+ for (( i=0; $i < ${#include_sources[@]}; i++ )) ; do
# Some headers are present only in specific versions of PostgreSQL
- [[ -e ${sources[$i]} ]] || continue
+ [[ -e ${include_sources[$i]} ]] || continue
# Create relative links so that they work both here and inside the new
# root if $ROOT is not "/"
- rel_source=$(relative_name "${sources[$i]}" "$(dirname "${targets[$i]}")")
+ rel_source=$(relative_name "${include_sources[$i]}" "$(dirname "${INCLUDE_TARGETS[$i]}")")
- ln -s "$rel_source" "${targets[$i]}" || die -q "Unable to create link!"
- echo "${targets[$i]##${ROOT%/}/}" >> "${E_PATH}"/active.links
+ ln -s "$rel_source" "${INCLUDE_TARGETS[$i]}" || \
+ die -q "Unable to create link!"
done
# Link modules to /usr/lib{,32,64}/
@@ -240,8 +254,7 @@ do_set() {
# 'linker' function doesn't work for linking directories.
# Default lib path - create a relative link
ln -s "postgresql-${SLOT}/${x}" "${B_PATH}/${x}/postgresql"
- echo "${B_PATH##${ROOT%/}/}/${x}/postgresql" >> \
- "${E_PATH}"/active.links
+
# Linker works for files
linker "${B_PATH}/${x}/postgresql-${SLOT}/${x}/" \
"-name lib*" "${B_PATH}/${x}"
@@ -255,7 +268,6 @@ do_set() {
# Default share path - use a relative link here by just specifying the
# base name
ln -s "postgresql-${SLOT}" "${B_PATH}/share/postgresql"
- echo "${B_PATH##${ROOT%/}/}/share/postgresql" >> "${E_PATH}/active.links"
echo "done."
echo "Setting ${SLOT} as default was successful!"
@@ -266,17 +278,41 @@ describe_unset() {
echo "Remove symbolic links."
}
+# Undo everything done by do_set().
do_unset() {
local SLOT=$1
if [[ ${SLOT} = $(active_slot) ]] ; then
echo -n "Unsetting ${SLOT} as the default installation..."
- unlinker "${E_PATH}/active.links"
+
echo "done."
echo "Setting a new slot as the default."
do_update
else
echo "Inactive slot selected. No work to do."
fi
+
+ local l
+ for l in ${INCLUDE_TARGETS[@]} "${B_PATH}/share/postgresql" ; do
+ # Remove target before creating the symlink
+ [[ -h ${l} ]] && rm -f "${l}"
+
+ # Check if include target still exists
+ [[ -e ${l} ]] && \
+ die -q "The target '${l}' exists and could not be removed!"
+ done
+
+ for x in $(list_libdirs) ; do
+ if [[ -d ${B_PATH}/${x}/postgresql-${SLOT}/${x} ]] ; then
+ if [[ -h "${B_PATH}/${x}/postgresql" ]] ; then
+ rm -f "${B_PATH}/${x}/postgresql"
+ [[ -e "${B_PATH}/${x}/postgresql" ]] && \
+ die -q "Unable to remove '${B_PATH}/${x}/postgresql'"
+ fi
+
+ unlinker "${B_PATH}/${x}/postgresql-${SLOT}/${x}/" \
+ "-name lib*" "${B_PATH}/${x}"
+ fi
+ done
}
### Reset Action ###
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [gentoo-commits] proj/postgresql/eselect:master commit in: /
@ 2017-04-18 19:43 Aaron Swenson
0 siblings, 0 replies; 28+ messages in thread
From: Aaron Swenson @ 2017-04-18 19:43 UTC (permalink / raw
To: gentoo-commits
commit: c92b58550953bdb5d82b1068bfb99225efd65e29
Author: Aaron W. Swenson <aaron.w.swenson <AT> gmail <DOT> com>
AuthorDate: Sat Feb 4 21:10:28 2017 +0000
Commit: Aaron Swenson <titanofold <AT> gentoo <DOT> org>
CommitDate: Sat Feb 4 21:10:28 2017 +0000
URL: https://gitweb.gentoo.org/proj/postgresql/eselect.git/commit/?id=c92b5855
Huge Changes
No longer use an environment file. All links are in locations that are
searched by default by man and pkgconfig.
Remove several files outright in /etc/eselect/postgresql as they’re
unnecessary.
Added linking for man pages and pkgconfig files.
Rename ${SLOT} to ${slot} as it isn’t a global variable.
Now compatible with the upcoming slot scheme where there is no
dot. (Release 10.0 is just 10.)
postgresql.eselect | 262 ++++++++++++++++++++++++++---------------------------
1 file changed, 129 insertions(+), 133 deletions(-)
diff --git a/postgresql.eselect b/postgresql.eselect
index 7ff9b83..b8ecbe1 100644
--- a/postgresql.eselect
+++ b/postgresql.eselect
@@ -1,4 +1,4 @@
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id: $
@@ -6,12 +6,11 @@ inherit config multilib
DESCRIPTION="Manage active PostgreSQL client applications and libraries"
MAINTAINER="pgsql-bugs@gentoo.org"
-VERSION="1.3"
+VERSION="2.0"
-# Global Data
+# We do a lot of things in /usr and it's a bit of a pain to write this
+# constantly.
USR_PATH="${EROOT%/}/usr"
-ETC_PATH="${EROOT%/}/etc/eselect/postgresql"
-ENV_FILE="${EROOT%/}/etc/env.d/50postgresql"
# This list of files/directories are the symbolic link targets that need to be
# created when a slot is set.
@@ -28,11 +27,11 @@ INCLUDE_TARGETS=(
)
active_slot() {
- # ${USR_PATH}/share/postgresql is a symlink. See if it's there, then
- # find out where it links to
+ # ${USR_PATH}/share/postgresql is a symlink to the active
+ # slot. See if it's there, then find out where it links to.
if [[ -h "${USR_PATH}/share/postgresql" ]] ; then
canonicalise "${USR_PATH}/share/postgresql" | \
- sed 's|.*postgresql-\([1-9][0-9.]*\)|\1|'
+ sed -re 's#.*([1-9][0-9.]+)$#\1#'
else
echo "(none)"
fi
@@ -86,7 +85,7 @@ linker() {
local findings
local rel_source
- findings=$(finder "${source_dir}" ${pattern})
+ findings=$(finder "${source_dir}" "${pattern}")
for link_source in ${findings} ; do
local link_target="${target_dir%/}/$(basename ${link_source})${suffix}"
@@ -109,9 +108,9 @@ get_slots() {
local slot
local found_slots
- for slot in $(find "${USR_PATH}/$(lib_dir)/" -maxdepth 1 -type d \
- -regex '.*/postgresql-[1-9][0-9]*\.*[0-9]*' | \
- sed -re 's#.*([1-9][0-9]*\.*[0-9]*)$#\1#' | sort -n)
+ for slot in $(find "${USR_PATH}/$(lib_dir)/" \
+ -mindepth 1 -maxdepth 1 -type d -name 'postgresql-*' | \
+ sed -re 's#.*([1-9][0-9.]+)$#\1#' | sort -n)
do
# Check that pg_config exists for this slot, otherwise we have
# a false positive.
@@ -186,24 +185,21 @@ describe_set() {
}
do_set() {
- local SLOT=$1
+ local slot=$1
- if [[ ! -d ${USR_PATH}/$(lib_dir)/postgresql-${SLOT} ]] ; then
+ if [[ ! -d ${USR_PATH}/$(lib_dir)/postgresql-${slot} ]] ; then
die -q "Not a valid slot."
fi
# If there's an active slot, unset that one first
- if [[ "$(active_slot)" == "${SLOT}" ]] ; then
- echo $(highlight "No work to do.")
- echo "If you think the links need to be reset, use the reset action."
- return 0
- elif [[ "$(active_slot)" != "(none)" ]] ; then
- echo -ne "\tRemoving old links..."
- do_unset $(active_slot)
+ local active_slot=$(active_slot)
+ if [[ "${active_slot}" != "(none)" ]] ; then
+ echo -ne "Unsetting ${active_slot} as default..."
+ do_unset ${active_slot}
echo "done."
fi
- echo "Setting ${SLOT} as the default installation..."
+ echo "Setting ${slot} as the default..."
echo -ne "\tGenerating new links..."
# Sources for header files
@@ -212,12 +208,12 @@ do_set() {
# If you change this list, you must change the INCLUDE_TARGETS list,
# too. And, they must be listed in the same order.
local include_sources=(
- "${USR_PATH}"/include/postgresql-${SLOT}
- "${USR_PATH}"/include/postgresql-${SLOT}/libpq-fe.h
- "${USR_PATH}"/include/postgresql-${SLOT}/pg_config_ext.h
- "${USR_PATH}"/include/postgresql-${SLOT}/pg_config_manual.h
- "${USR_PATH}"/include/postgresql-${SLOT}/libpq
- "${USR_PATH}"/include/postgresql-${SLOT}/postgres_ext.h
+ "${USR_PATH}"/include/postgresql-${slot}
+ "${USR_PATH}"/include/postgresql-${slot}/libpq-fe.h
+ "${USR_PATH}"/include/postgresql-${slot}/pg_config_ext.h
+ "${USR_PATH}"/include/postgresql-${slot}/pg_config_manual.h
+ "${USR_PATH}"/include/postgresql-${slot}/libpq
+ "${USR_PATH}"/include/postgresql-${slot}/postgres_ext.h
)
# The linker function cannot accommodate this special purpose.
@@ -227,38 +223,49 @@ do_set() {
# Some headers are present only in specific versions of PostgreSQL
[[ -e ${include_sources[$i]} ]] || continue
- # Create relative links so that they work both here and inside the new
+ # Create relative links so that they work both here and inside a new
# root if $ROOT is not "/"
rel_source=$(relative_name "${include_sources[$i]}" "$(dirname "${INCLUDE_TARGETS[$i]}")")
ln -s "$rel_source" "${INCLUDE_TARGETS[$i]}" || \
- die -q "Unable to create link!"
+ die -q "Unable to create link! $rel_source -> ${INCLUDE_TARGETS[$i]}"
done
# Link modules to /usr/lib{,32,64}/
local x
for x in $(list_libdirs) ; do
- if [[ -d ${USR_PATH}/${x}/postgresql-${SLOT}/${x} ]] ; then
+ if [[ -d "${USR_PATH}/${x}/postgresql-${slot}/${x}" ]] ; then
# 'linker' function doesn't work for linking directories.
# Default lib path - create a relative link
- ln -s "postgresql-${SLOT}/${x}" "${USR_PATH}/${x}/postgresql"
+ ln -s "postgresql-${slot}/${x}" "${USR_PATH}/${x}/postgresql"
# Linker works for files
- linker "${USR_PATH}/${x}/postgresql-${SLOT}/${x}/" \
+ linker "${USR_PATH}/${x}/postgresql-${slot}/${x}/" \
"-name lib*" "${USR_PATH}/${x}"
fi
done
# Link binaries to /usr/bin/
- linker "${USR_PATH}/$(lib_dir)/postgresql-${SLOT}/bin/" \
- "-type f" "${USR_PATH}/bin"
+ linker "${USR_PATH}/$(lib_dir)/postgresql-${slot}/bin/" \
+ "" "${USR_PATH}/bin"
+
+ # Link pkg-config metadata files
+ linker "${USR_PATH}/$(lib_dir)/postgresql-${slot}/$(lib_dir)/pkgconfig/" \
+ "" "${USR_PATH}/share/pkgconfig/"
+
+ # Link man pages
+ local mandir mansec
+ for mandir in "${USR_PATH}"/share/postgresql-${slot}/man/man{1,3,7} ; do
+ mansec=$(basename "${mandir}")
+ linker "${mandir}" "" "${USR_PATH}/share/man/${mansec}"
+ done
# Default share path - use a relative link here by just specifying the
# base name
- ln -s "postgresql-${SLOT}" "${USR_PATH}/share/postgresql"
+ ln -s "postgresql-${slot}" "${USR_PATH}/share/postgresql"
echo "done."
- echo "Setting ${SLOT} as default was successful!"
+ echo "Setting ${slot} as default was successful!"
}
### Unset Action ###
@@ -268,35 +275,58 @@ describe_unset() {
# Undo everything done by do_set().
do_unset() {
- local SLOT=$1
- if [[ ${SLOT} != $(active_slot) ]] ; then
+ local slot=$1
+ if [[ ${slot} != $(active_slot) ]] ; then
echo "Slot already inactive; no work to do."
return 0
fi
- local l
- for l in ${INCLUDE_TARGETS[@]} "${USR_PATH}/share/postgresql" ; do
- [[ -h ${l} ]] && rm -f "${l}"
+ # Start with some known locations that are, or will contain, symlinks.
+ local paths=(
+ "${INCLUDE_TARGETS[@]}"
+ "${USR_PATH}"/share/man/man{1,3,7}
+ "${USR_PATH}/share/postgresql"
+ "${USR_PATH}/bin"
+ "${USR_PATH}/share/pkgconfig"
+ )
- # Check if include target still exists
- [[ -e ${l} ]] && \
- die -q "The target '${l}' exists and could not be removed!"
- done
+ local lib
+ for lib in $(list_libdirs) ; do
+ # If $libdir is a symlink, it will point to a real lib directory that
+ # will be or has been added in this loop.
+ [[ -h "${USR_PATH}/${lib}" ]] && continue
- for l in $(find "${USR_PATH}/bin" -type l) ; do
- if [[ $(realpath ${l} | grep -c postgresql) -ge 1 ]] ; then
- rm "${l}"
+ # If the $libdir/postgresql symlink exists, then there are certainly
+ # others within that same directory that must be cleaned up.
+ if [[ -h "${USR_PATH}/${lib}/postgresql" ]] ; then
+ paths+=( "${USR_PATH}/${lib}" )
fi
done
- for x in $(list_libdirs) ; do
- if [[ -h "${USR_PATH}/${x}/postgresql" ]] ; then
- for l in $(find "${USR_PATH}/${x}" -type l) ; do
- if [[ $(realpath ${l} | grep -c postgresql) -ge 1 ]] ; then
- rm "${l}"
- fi
- done
+ local l path
+ for path in "${paths[@]}" ; do
+ # If path is a link that belongs to the slot in question, it can be
+ # removed without invoking find.
+ if [[ -h "${path}" && \
+ $(canonicalise "${path}") == *postgresql-${slot}* ]] ; then
+ rm "${path}" || write_warning_msg "Couldn't remove: ${path}"
+ continue
fi
+
+ # If path is a real directory, symlinks need to be found within it.
+ for l in $(find "${path}" -mindepth 1 -maxdepth 1 -type l) ; do
+ # Skip the slot specific links (e.g., psql96) in /usr/bin and
+ # /usr/share/man as they're managed by their ebuilds
+ [[ ${l} == ${USR_PATH}/bin/*${slot/.} ]] && continue
+ [[ ${l} == ${USR_PATH}/share/man/man?/*${slot/.}* ]] && continue
+
+ # Get the file path that the link is pointing to. If it has the
+ # string "postgresql-${slot}" somewhere in it, then it's a link that
+ # needs to be removed.
+ if [[ $(canonicalise "${l}") == *postgresql-${slot}* ]] ; then
+ rm "${l}" || write_warning_msg "Couldn't remove: ${l}"
+ fi
+ done
done
}
@@ -306,10 +336,10 @@ describe_reset() {
}
do_reset() {
- local SLOT=$(active_slot)
- [[ ${SLOT} = "(none)" ]] && die -q "No active slot to reset."
- do_unset ${SLOT}
- do_set ${SLOT}
+ local slot=$(active_slot)
+ [[ ${slot} == "(none)" ]] && die -q "No active slot to reset."
+ do_unset ${slot}
+ do_set ${slot}
}
### Update Action ###
@@ -318,99 +348,65 @@ describe_update() {
}
do_update() {
- local slot=$(active_slot)
-
- ## CLEAN UP ##
+ ## ANTIQUITY CLEAN UP ##
#
# Older versions of this module generated state and environment files of
# some sort or another. They're useless now and are just a waste of space.
- # Remove environment files that have been generated by the ebuilds
- rm -f "${ENV_FILE}"-*
- if [[ -d ${ETC_PATH} ]] ; then
+ # Environment files that have been generated by older ebuilds and
+ # previous versions of this module serve no purpose now.
+ rm -f "${EROOT%/}"/etc/env.d/50postgresql*
+
+ local etc_path="${EROOT%/}/etc/eselect/postgresql"
+ if [[ -d ${etc_path} ]] ; then
# Remove some files outright as they're entirely useless now.
- # ${ETC_PATH}/active: Contents was the active slot (e.g., 9.5)
- # ${ETC_PATH}/service: Told the initscript which slot to start
+ # ${etc_path}/active: Contents was the active slot (e.g.,
+ # 9.5), or it was a symlink to another file that was then
+ # canonicalised and parsed to get the active slot
+ # ${etc_path}/service: Told the initscript which slot to
+ # start. We now have separate scripts for each slot
+ # ${etc_path}/active.links*: Contained a list of symlinks
+ # created. We now search the known directories for the
+ # symlinks as only this module manage them.
local f
- for f in "${ETC_PATH}/active" "${ETC_PATH}/service" ; do
- [[ -e "${f}" ]] && rm -f "${f}"
- done
-
- local active_link_file
- for active_link_file in "${ETC_PATH}"/active.links* ; do
- local active_links=($(<"${active_link_file}"))
- for (( i=0; $i < ${#active_links[@]}; i++ )) ; do
- [[ -h "${ROOT%/}/${active_links[$i]}" ]] && \
- rm -f "${ROOT%/}/${active_links[$i]}"
- [[ -e "${ROOT%/}/${active_links[$i]}" ]] && \
- die -q "The target '${active_links[$i]}' still exists and could not be removed!"
- done
-
- rm "${active_link_file}" || \
- write_warning_msg "Can't remove '${active_link_file}'"
+ for f in "${etc_path}"/active* "${etc_path}/service" ; do
+ if [[ -e "${f}" ]] ; then
+ rm "${f}" || write_warning_msg "Can't remove: '${f}'"
+ fi
done
local unused_files
- unused_file=$(find "${ETC_PATH}" -type f -not -name '.keep*')
+ unused_file=( $(find "${etc_path}" -type f -not -name '.keep*') )
if [[ -n "${unused_file[@]}" ]] ; then
write_warning_msg "You have unused files that should be removed:"
for f in ${unused_file[@]} ; do
write_warning_msg $f
done
else
- echo "It's should be safe for you to remove '${ETC_PATH}'"
+ echo "It should be safe for you to remove '${etc_path}'"
fi
fi
+ ## End Antiquity Clean Up
- ## End Clean Up
-
+ local active_slot=$(active_slot)
local slots=($(get_slots))
- local index=${#slots[@]}
-
- if [[ ${index} -eq 0 ]] ; then
- write_warning_msg "No slots found!"
- rm -f "${ENV_FILE}"
- do_action env update &> /dev/null
- return 0
- fi
- # Reset, otherwise set the highest slot available.
- if [[ ${slots[@]} =~ ${slot} ]] ; then
- do_reset ${slot}
+ if [[ ${slots[@]} =~ ${active_slot} ]] ; then
+ # If active_slot is in the slots list, do a reset as the installation
+ # may have changed.
+ do_reset
+ elif [[ ${#slots[@]} -ne 0 ]] ; then
+ # If $slots is not empty but ${active_slot} is set, the active_slot
+ # must have been unmerged and its links need to be cleaned before...
+ [[ ${active_slot} != "(none)" ]] && do_unset ${active_slot}
+
+ # Setting the highest slot available.
+ do_set ${slots[-1]}
+ elif [[ ${active_slot} != "(none)" ]] ; then
+ # If slots is empty, but active_slot still has a value, an unset must
+ # happen as the links are now pointing to nothing.
+ do_unset ${active_slot}
else
- # best_version doesn't work here as pkg_postrm runs before the world
- # file is updated, thereby returning a false positive.
- do_set ${slots[$index-1]}
+ echo "Apparently, I have nothing to do."
fi
-
- # Update paths to libs and man pages
- local ldpath
- local pcpath
- local x
- for x in $(list_libdirs) ; do
- if [[ -h ${USR_PATH}/${x}/postgresql ]] ; then
- ldpath+="${USR_PATH}/${x}/postgresql:"
- pcpath+="${USR_PATH}/${x}/postgresql/pkgconfig:"
- fi
- done
- ldpath="${ldpath%:}"
- pcdpath="${pcpath%:}"
- local manpath="${USR_PATH}/share/postgresql/man/"
- while [[ $[--index] -gt -1 ]] ; do
- local curslot="${slots[$index]}"
- for x in $(list_libdirs) ; do
- local lib_path="${USR_PATH}/${x}/postgresql-${curslot}/${x}/"
- local pkg_path="${lib_path}/pkgconfig"
- [[ -d ${lib_path} ]] && ldpath+=":${lib_path}"
- [[ -d ${pkg_path} ]] && pcpath+=":${pcpath}"
- done
- local tmp_manpath="${USR_PATH}/share/postgresql-${curslot}/man/"
- [[ -d ${tmp_manpath} ]] && manpath+=":${tmp_manpath}"
- echo "done."
- done
-
- store_config "${ENV_FILE}" LDPATH "${ldpath}"
- store_config "${ENV_FILE}" MANPATH "${manpath}"
- store_config "${ENV_FILE}" PKG_CONFIG_PATH "${pcpath}"
- do_action env update &> /dev/null
}
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [gentoo-commits] proj/postgresql/eselect:master commit in: /
@ 2017-04-18 19:43 Aaron Swenson
0 siblings, 0 replies; 28+ messages in thread
From: Aaron Swenson @ 2017-04-18 19:43 UTC (permalink / raw
To: gentoo-commits
commit: 26ee12a9a78bc299518b7151c14b4f89f4d16cbc
Author: Aaron W. Swenson <titanofold <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 8 22:59:52 2016 +0000
Commit: Aaron Swenson <titanofold <AT> gentoo <DOT> org>
CommitDate: Mon Aug 8 22:59:52 2016 +0000
URL: https://gitweb.gentoo.org/proj/postgresql/eselect.git/commit/?id=26ee12a9
Fix typo
Whoa, can’t believe I let that go for so long.
postgresql.eselect | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/postgresql.eselect b/postgresql.eselect
index 2d4b84c..9bb009a 100644
--- a/postgresql.eselect
+++ b/postgresql.eselect
@@ -233,7 +233,7 @@ do_set() {
"${USR_PATH}"/include/postgresql-${SLOT}/postgres_ext.h
)
- # The linker function cannot accomadate this special purpose.
+ # The linker function cannot accommodate this special purpose.
local rel_source
local i
for (( i=0; $i < ${#include_sources[@]}; i++ )) ; do
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [gentoo-commits] proj/postgresql/eselect:master commit in: /
@ 2017-04-18 19:43 Aaron Swenson
0 siblings, 0 replies; 28+ messages in thread
From: Aaron Swenson @ 2017-04-18 19:43 UTC (permalink / raw
To: gentoo-commits
commit: 2ab66cffbfd5ff7111244eca0e4f7e06dcf7cae7
Author: Aaron W. Swenson <titanofold <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 8 22:39:19 2016 +0000
Commit: Aaron Swenson <titanofold <AT> gentoo <DOT> org>
CommitDate: Mon Aug 8 22:39:19 2016 +0000
URL: https://gitweb.gentoo.org/proj/postgresql/eselect.git/commit/?id=2ab66cff
Rename global variables to something sensible
Decoding those 1 character prefixes is exhausting!
postgresql.eselect | 102 ++++++++++++++++++++++++++---------------------------
1 file changed, 51 insertions(+), 51 deletions(-)
diff --git a/postgresql.eselect b/postgresql.eselect
index 8463344..93dc723 100644
--- a/postgresql.eselect
+++ b/postgresql.eselect
@@ -9,8 +9,8 @@ MAINTAINER="pgsql-bugs@gentoo.org"
VERSION="1.3"
# Global Data
-B_PATH="${EROOT%/}/usr"
-E_PATH="${EROOT%/}/etc/eselect/postgresql"
+USR_PATH="${EROOT%/}/usr"
+ETC_PATH="${EROOT%/}/etc/eselect/postgresql"
ENV_FILE="${EROOT%/}/etc/env.d/50postgresql"
# This list of files/directories are the symbolic link targets that need to be
@@ -19,19 +19,19 @@ ENV_FILE="${EROOT%/}/etc/env.d/50postgresql"
# If you change this list, remember to change include_sources in do_set. And,
# they must be listed in the same order.
INCLUDE_TARGETS=(
- "${B_PATH}"/include/postgresql
- "${B_PATH}"/include/libpq-fe.h
- "${B_PATH}"/include/pg_config_ext.h
- "${B_PATH}"/include/pg_config_manual.h
- "${B_PATH}"/include/libpq
- "${B_PATH}"/include/postgres_ext.h
+ "${USR_PATH}"/include/postgresql
+ "${USR_PATH}"/include/libpq-fe.h
+ "${USR_PATH}"/include/pg_config_ext.h
+ "${USR_PATH}"/include/pg_config_manual.h
+ "${USR_PATH}"/include/libpq
+ "${USR_PATH}"/include/postgres_ext.h
)
active_slot() {
- # ${B_PATH}/share/postgresql is a symlink. See if it's there, then
+ # ${USR_PATH}/share/postgresql is a symlink. See if it's there, then
# find out where it links to
- if [[ -h "${B_PATH}/share/postgresql" ]] ; then
- canonicalise "${B_PATH}/share/postgresql" | \
+ if [[ -h "${USR_PATH}/share/postgresql" ]] ; then
+ canonicalise "${USR_PATH}/share/postgresql" | \
sed 's|.*postgresql-\([1-9][0-9.]*\)|\1|'
else
echo "(none)"
@@ -41,13 +41,13 @@ active_slot() {
lib_dir() {
local lib_list=$(list_libdirs)
if [[ ${lib_list} =~ .*lib64.* && \
- -n $(ls -d ${B_PATH}/lib64/postgresql-*/lib64 2> /dev/null) ]] ; then
+ -n $(ls -d ${USR_PATH}/lib64/postgresql-*/lib64 2> /dev/null) ]] ; then
echo "lib64"
elif [[ ${lib_list} =~ .*lib32.* && \
- -n $(ls -d ${B_PATH}/lib32/postgresql-*/lib32 2> /dev/null) ]] ; then
+ -n $(ls -d ${USR_PATH}/lib32/postgresql-*/lib32 2> /dev/null) ]] ; then
echo "lib32"
elif [[ ${lib_list} =~ .*libx32.* && \
- -n $(ls -d ${B_PATH}/libx32/postgresql-*/libx32 2> /dev/null) ]] ; then
+ -n $(ls -d ${USR_PATH}/libx32/postgresql-*/libx32 2> /dev/null) ]] ; then
echo "libx32"
else
echo "lib"
@@ -124,13 +124,13 @@ get_slots() {
local slot
local found_slots
- for slot in $(find "${B_PATH}/$(lib_dir)/" -maxdepth 1 -type d \
+ for slot in $(find "${USR_PATH}/$(lib_dir)/" -maxdepth 1 -type d \
-regex '.*postgresql-[0-9][0-9]*\.[0-9][0-9]*' | \
sed -re 's#.*([0-9]+\.[0-9]+)$#\1#' | sort -n)
do
# Check that pg_config exists for this slot, otherwise we have
# a false positive.
- [[ -x "${B_PATH}/$(lib_dir)/postgresql-${slot}/bin/pg_config" ]] && \
+ [[ -x "${USR_PATH}/$(lib_dir)/postgresql-${slot}/bin/pg_config" ]] && \
found_slots+=( ${slot} )
done
@@ -152,7 +152,7 @@ do_list() {
local slot
local bindir
for slot in $(get_slots) ; do
- bindir="${B_PATH}/$(lib_dir)/postgresql-${slot}/bin"
+ bindir="${USR_PATH}/$(lib_dir)/postgresql-${slot}/bin"
# The output of `pg_config --version` also includes "PostgreSQL" in
# the string, which is a bit redundant.
@@ -203,7 +203,7 @@ describe_set() {
do_set() {
local SLOT=$1
- if [[ ! -d ${B_PATH}/$(lib_dir)/postgresql-${SLOT} ]] ; then
+ if [[ ! -d ${USR_PATH}/$(lib_dir)/postgresql-${SLOT} ]] ; then
die -q "Not a valid slot."
fi
@@ -227,12 +227,12 @@ do_set() {
# If you change this list, you must change the INCLUDE_TARGETS list,
# too. And, they must be listed in the same order.
local include_sources=(
- "${B_PATH}"/include/postgresql-${SLOT}
- "${B_PATH}"/include/postgresql-${SLOT}/libpq-fe.h
- "${B_PATH}"/include/postgresql-${SLOT}/pg_config_ext.h
- "${B_PATH}"/include/postgresql-${SLOT}/pg_config_manual.h
- "${B_PATH}"/include/postgresql-${SLOT}/libpq
- "${B_PATH}"/include/postgresql-${SLOT}/postgres_ext.h
+ "${USR_PATH}"/include/postgresql-${SLOT}
+ "${USR_PATH}"/include/postgresql-${SLOT}/libpq-fe.h
+ "${USR_PATH}"/include/postgresql-${SLOT}/pg_config_ext.h
+ "${USR_PATH}"/include/postgresql-${SLOT}/pg_config_manual.h
+ "${USR_PATH}"/include/postgresql-${SLOT}/libpq
+ "${USR_PATH}"/include/postgresql-${SLOT}/postgres_ext.h
)
# The linker function cannot accomadate this special purpose.
@@ -253,24 +253,24 @@ do_set() {
# Link modules to /usr/lib{,32,64}/
local x
for x in $(list_libdirs) ; do
- if [[ -d ${B_PATH}/${x}/postgresql-${SLOT}/${x} ]] ; then
+ if [[ -d ${USR_PATH}/${x}/postgresql-${SLOT}/${x} ]] ; then
# 'linker' function doesn't work for linking directories.
# Default lib path - create a relative link
- ln -s "postgresql-${SLOT}/${x}" "${B_PATH}/${x}/postgresql"
+ ln -s "postgresql-${SLOT}/${x}" "${USR_PATH}/${x}/postgresql"
# Linker works for files
- linker "${B_PATH}/${x}/postgresql-${SLOT}/${x}/" \
- "-name lib*" "${B_PATH}/${x}"
+ linker "${USR_PATH}/${x}/postgresql-${SLOT}/${x}/" \
+ "-name lib*" "${USR_PATH}/${x}"
fi
done
# Link binaries to /usr/bin/
- linker "${B_PATH}/$(lib_dir)/postgresql-${SLOT}/bin/" \
- "-type f" "${B_PATH}/bin"
+ linker "${USR_PATH}/$(lib_dir)/postgresql-${SLOT}/bin/" \
+ "-type f" "${USR_PATH}/bin"
# Default share path - use a relative link here by just specifying the
# base name
- ln -s "postgresql-${SLOT}" "${B_PATH}/share/postgresql"
+ ln -s "postgresql-${SLOT}" "${USR_PATH}/share/postgresql"
echo "done."
echo "Setting ${SLOT} as default was successful!"
@@ -295,7 +295,7 @@ do_unset() {
fi
local l
- for l in ${INCLUDE_TARGETS[@]} "${B_PATH}/share/postgresql" ; do
+ for l in ${INCLUDE_TARGETS[@]} "${USR_PATH}/share/postgresql" ; do
# Remove target before creating the symlink
[[ -h ${l} ]] && rm -f "${l}"
@@ -305,15 +305,15 @@ do_unset() {
done
for x in $(list_libdirs) ; do
- if [[ -d ${B_PATH}/${x}/postgresql-${SLOT}/${x} ]] ; then
- if [[ -h "${B_PATH}/${x}/postgresql" ]] ; then
- rm -f "${B_PATH}/${x}/postgresql"
- [[ -e "${B_PATH}/${x}/postgresql" ]] && \
- die -q "Unable to remove '${B_PATH}/${x}/postgresql'"
+ if [[ -d ${USR_PATH}/${x}/postgresql-${SLOT}/${x} ]] ; then
+ if [[ -h "${USR_PATH}/${x}/postgresql" ]] ; then
+ rm -f "${USR_PATH}/${x}/postgresql"
+ [[ -e "${USR_PATH}/${x}/postgresql" ]] && \
+ die -q "Unable to remove '${USR_PATH}/${x}/postgresql'"
fi
- unlinker "${B_PATH}/${x}/postgresql-${SLOT}/${x}/" \
- "-name lib*" "${B_PATH}/${x}"
+ unlinker "${USR_PATH}/${x}/postgresql-${SLOT}/${x}/" \
+ "-name lib*" "${USR_PATH}/${x}"
fi
done
}
@@ -345,17 +345,17 @@ do_update() {
# Remove environment files that have been generated by the ebuilds
rm -f "${ENV_FILE}"-*
- if [[ -d ${E_PATH} ]] ; then
+ if [[ -d ${ETC_PATH} ]] ; then
# Remove some files outright as they're entirely useless now.
- # ${E_PATH}/active: Contents was the active slot (e.g., 9.5)
- # ${E_PATH}/service: Told the initscript which slot to start
+ # ${ETC_PATH}/active: Contents was the active slot (e.g., 9.5)
+ # ${ETC_PATH}/service: Told the initscript which slot to start
local f
- for f in "${E_PATH}/active" "${E_PATH}/service" ; do
+ for f in "${ETC_PATH}/active" "${ETC_PATH}/service" ; do
[[ -e "${f}" ]] && rm -f "${f}"
done
local active_link_file
- for active_link_file in "${E_PATH}"/active.links* ; do
+ for active_link_file in "${ETC_PATH}"/active.links* ; do
local active_links=($(<"${active_link_file}"))
for (( i=0; $i < ${#active_links[@]}; i++ )) ; do
[[ -h "${ROOT%/}/${active_links[$i]}" ]] && \
@@ -369,14 +369,14 @@ do_update() {
done
local unused_files
- unused_file=$(find "${E_PATH}" -type f -not -name '.keep*')
+ unused_file=$(find "${ETC_PATH}" -type f -not -name '.keep*')
if [[ -n "${unused_file[@]}" ]] ; then
write_warning_msg "You have unused files that should be removed:"
for f in ${unused_file[@]} ; do
write_warning_msg $f
done
else
- echo "It's should be safe for you to remove '${E_PATH}'"
+ echo "It's should be safe for you to remove '${ETC_PATH}'"
fi
fi
@@ -405,18 +405,18 @@ do_update() {
local ldpath
local x
for x in $(list_libdirs) ; do
- [[ -h ${B_PATH}/${x}/postgresql ]] && \
- ldpath+="${B_PATH}/${x}/postgresql:"
+ [[ -h ${USR_PATH}/${x}/postgresql ]] && \
+ ldpath+="${USR_PATH}/${x}/postgresql:"
done
ldpath="${ldpath%:}"
- local manpath="${B_PATH}/share/postgresql/man/"
+ local manpath="${USR_PATH}/share/postgresql/man/"
while [[ $[--index] -gt -1 ]] ; do
local curslot="${slots[$index]}"
for x in $(list_libdirs) ; do
- local lib_path="${B_PATH}/${x}/postgresql-${curslot}/${x}/"
+ local lib_path="${USR_PATH}/${x}/postgresql-${curslot}/${x}/"
[[ -d ${lib_path} ]] && ldpath+=":${lib_path}"
done
- local tmp_manpath="${B_PATH}/share/postgresql-${curslot}/man/"
+ local tmp_manpath="${USR_PATH}/share/postgresql-${curslot}/man/"
[[ -d ${tmp_manpath} ]] && manpath+=":${tmp_manpath}"
echo "done."
done
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [gentoo-commits] proj/postgresql/eselect:master commit in: /
@ 2017-04-18 19:43 Aaron Swenson
0 siblings, 0 replies; 28+ messages in thread
From: Aaron Swenson @ 2017-04-18 19:43 UTC (permalink / raw
To: gentoo-commits
commit: 1fcb1813d38b60ab79556bf8bc1d464bbeec467e
Author: Aaron W. Swenson <titanofold <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 8 22:35:42 2016 +0000
Commit: Aaron Swenson <titanofold <AT> gentoo <DOT> org>
CommitDate: Mon Aug 8 22:35:42 2016 +0000
URL: https://gitweb.gentoo.org/proj/postgresql/eselect.git/commit/?id=1fcb1813
Refactor update to clean out old files and directories that are no longer used.
postgresql.eselect | 118 +++++++++++++++++++++++++++++------------------------
1 file changed, 65 insertions(+), 53 deletions(-)
diff --git a/postgresql.eselect b/postgresql.eselect
index 160e60e..8463344 100644
--- a/postgresql.eselect
+++ b/postgresql.eselect
@@ -54,6 +54,23 @@ lib_dir() {
fi
}
+### Finder Function ###
+# Takes two arguments:
+# - Absolute path to directory to search
+# - Pattern to search for
+finder() {
+ local source_dir=$1
+ local pattern=$2
+
+ # Prevent passed patterns from being globbed
+ # If this module is run in /usr, '-name lib*' ends up globbing 'lib*',
+ # passing to 'find' the pattern '-name lib lib32 lib64' and find interprets
+ # those as path arguments causing failure.
+ set -f
+ find -L "${source_dir}" -maxdepth 1 -mindepth 1 ${pattern}
+ set +f
+}
+
### TODO: Refactor to move find into a separate function
### Linker Function ###
@@ -71,13 +88,7 @@ linker() {
local findings
local rel_source
- # Prevent passed patterns from being globbed
- # If this module is run in /usr, '-name lib*' ends up globbing 'lib*',
- # passing to 'find' the pattern '-name lib lib32 lib64' and find interprets
- # those as path arguments causing failure.
- set -f
- findings=$(find -L "${source_dir}" -maxdepth 1 -mindepth 1 ${pattern})
- set +f
+ findings=$(finder "${source_dir}" ${pattern})
for link_source in ${findings} ; do
local link_target="${target_dir%/}/$(basename ${link_source})${suffix}"
@@ -101,18 +112,10 @@ linker() {
# Takes one argument:
# - Full path to active links file (e.g. /etc/eselect/postgresql/active.links)
unlinker() {
- local active_link_file=$1
- if [[ -r ${active_link_file} ]] ; then
- local active_links=($(<"${active_link_file}"))
- for (( i=0; $i < ${#active_links[@]}; i++ )) ; do
- [[ -h "${ROOT%/}/${active_links[$i]}" ]] && \
- rm -f "${ROOT%/}/${active_links[$i]}"
- [[ -e "${ROOT%/}/${active_links[$i]}" ]] && \
- die -q "The target '${active_links[$i]}' still exists and could not be removed!"
- done
+ local dir
+ local pattern
+ local findings
- rm -f "${active_link_file}"
- fi
}
### Get Slots Function ###
@@ -335,54 +338,70 @@ describe_update() {
do_update() {
local slot=$(active_slot)
- # Remove some files outright as they're entirely useless now.
- # ${E_PATH}/active: Contents was the active slot (e.g., 9.5)
- # ${E_PATH}/service: Told the initscript which slot to start
- local f
- for f in "${E_PATH}/active" "${E_PATH}/service" ; do
- [[ -e "${f}" ]] && rm -f "${f}"
- done
+ ## CLEAN UP ##
+ #
+ # Older versions of this module generated state and environment files of
+ # some sort or another. They're useless now and are just a waste of space.
+ # Remove environment files that have been generated by the ebuilds
+ rm -f "${ENV_FILE}"-*
+
+ if [[ -d ${E_PATH} ]] ; then
+ # Remove some files outright as they're entirely useless now.
+ # ${E_PATH}/active: Contents was the active slot (e.g., 9.5)
+ # ${E_PATH}/service: Told the initscript which slot to start
+ local f
+ for f in "${E_PATH}/active" "${E_PATH}/service" ; do
+ [[ -e "${f}" ]] && rm -f "${f}"
+ done
+
+ local active_link_file
+ for active_link_file in "${E_PATH}"/active.links* ; do
+ local active_links=($(<"${active_link_file}"))
+ for (( i=0; $i < ${#active_links[@]}; i++ )) ; do
+ [[ -h "${ROOT%/}/${active_links[$i]}" ]] && \
+ rm -f "${ROOT%/}/${active_links[$i]}"
+ [[ -e "${ROOT%/}/${active_links[$i]}" ]] && \
+ die -q "The target '${active_links[$i]}' still exists and could not be removed!"
+ done
+
+ rm "${active_link_file}" || \
+ write_warning_msg "Can't remove '${active_link_file}'"
+ done
+
+ local unused_files
+ unused_file=$(find "${E_PATH}" -type f -not -name '.keep*')
+ if [[ -n "${unused_file[@]}" ]] ; then
+ write_warning_msg "You have unused files that should be removed:"
+ for f in ${unused_file[@]} ; do
+ write_warning_msg $f
+ done
+ else
+ echo "It's should be safe for you to remove '${E_PATH}'"
+ fi
+ fi
+ ## End Clean Up
local slots=($(get_slots))
local index=${#slots[@]}
- # In case all slots have been unmerged
if [[ ${index} -eq 0 ]] ; then
write_warning_msg "No slots found!"
- write_warning_msg "Removing links (Control-C to abort) in..."
- local i=6
- while [[ $[i--] -gt 0 ]] ; do
- echo -n " $i"
- sleep 1
- done
- local sym_links
- for sym_links in "${E_PATH}"/active.links* ; do
- unlinker "${sym_links}"
- done
rm -f "${ENV_FILE}"
do_action env update &> /dev/null
- echo "Done!"
return 0
fi
# Reset, otherwise set the highest slot available.
if [[ ${slots[@]} =~ ${slot} ]] ; then
- do_set ${slot}
+ do_reset ${slot}
else
# best_version doesn't work here as pkg_postrm runs before the world
# file is updated, thereby returning a false positive.
do_set ${slots[$index-1]}
fi
- echo -en "\nCleaning out old links before refreshing..."
- local sym_links
- for sym_links in "${E_PATH}"/active.links?* ; do
- unlinker "${sym_links}"
- done
- echo "done."
-
- # Update paths to libs and docs
+ # Update paths to libs and man pages
local ldpath
local x
for x in $(list_libdirs) ; do
@@ -393,22 +412,15 @@ do_update() {
local manpath="${B_PATH}/share/postgresql/man/"
while [[ $[--index] -gt -1 ]] ; do
local curslot="${slots[$index]}"
- echo -n "Refreshing symbolic links for ${curslot} applications (like "
- echo -n "/usr/bin/psql${curslot//.})..."
for x in $(list_libdirs) ; do
local lib_path="${B_PATH}/${x}/postgresql-${curslot}/${x}/"
[[ -d ${lib_path} ]] && ldpath+=":${lib_path}"
done
local tmp_manpath="${B_PATH}/share/postgresql-${curslot}/man/"
[[ -d ${tmp_manpath} ]] && manpath+=":${tmp_manpath}"
- linker "${B_PATH}/$(lib_dir)/postgresql-${curslot}/bin/" \
- "-type f" "${B_PATH}/bin" "${curslot//.}"
echo "done."
done
- # Remove environment files that have been generated by the ebuilds
- rm -f "${ENV_FILE}"-*
-
store_config "${ENV_FILE}" LDPATH "${ldpath}"
store_config "${ENV_FILE}" MANPATH "${manpath}"
do_action env update &> /dev/null
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [gentoo-commits] proj/postgresql/eselect:master commit in: /
@ 2017-04-18 19:43 Aaron Swenson
0 siblings, 0 replies; 28+ messages in thread
From: Aaron Swenson @ 2017-04-18 19:43 UTC (permalink / raw
To: gentoo-commits
commit: bf55487f97abc7370d1ac4acefa521ef6baeecb8
Author: Aaron W. Swenson <titanofold <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 30 18:27:49 2016 +0000
Commit: Aaron Swenson <titanofold <AT> gentoo <DOT> org>
CommitDate: Sun Oct 30 18:27:49 2016 +0000
URL: https://gitweb.gentoo.org/proj/postgresql/eselect.git/commit/?id=bf55487f
Add pkg-config support
Among some other cleanups, add pkg-config support.
postgresql.eselect | 59 +++++++++++++++++++++++-------------------------------
1 file changed, 25 insertions(+), 34 deletions(-)
diff --git a/postgresql.eselect b/postgresql.eselect
index 9bb009a..7ff9b83 100644
--- a/postgresql.eselect
+++ b/postgresql.eselect
@@ -103,19 +103,6 @@ linker() {
done
}
-### TODO: Refactor so that it searches source directories for removal targets,
-### and move the old stuff into do_update
-
-### Unlinker Function ###
-# Takes one argument:
-# - Full path to active links file (e.g. /etc/eselect/postgresql/active.links)
-unlinker() {
- local dir
- local pattern
- local findings
-
-}
-
### Get Slots Function ###
# Find all available slots in the preferred lib_dir() and return them.
get_slots() {
@@ -123,8 +110,8 @@ get_slots() {
local found_slots
for slot in $(find "${USR_PATH}/$(lib_dir)/" -maxdepth 1 -type d \
- -regex '.*postgresql-[0-9][0-9]*\.[0-9][0-9]*' | \
- sed -re 's#.*([0-9]+\.[0-9]+)$#\1#' | sort -n)
+ -regex '.*/postgresql-[1-9][0-9]*\.*[0-9]*' | \
+ sed -re 's#.*([1-9][0-9]*\.*[0-9]*)$#\1#' | sort -n)
do
# Check that pg_config exists for this slot, otherwise we have
# a false positive.
@@ -282,19 +269,13 @@ describe_unset() {
# Undo everything done by do_set().
do_unset() {
local SLOT=$1
- if [[ ${SLOT} = $(active_slot) ]] ; then
- echo -n "Unsetting ${SLOT} as the default installation..."
-
- echo "done."
- echo "Setting a new slot as the default."
- do_update
- else
- echo "Inactive slot selected. No work to do."
+ if [[ ${SLOT} != $(active_slot) ]] ; then
+ echo "Slot already inactive; no work to do."
+ return 0
fi
local l
for l in ${INCLUDE_TARGETS[@]} "${USR_PATH}/share/postgresql" ; do
- # Remove target before creating the symlink
[[ -h ${l} ]] && rm -f "${l}"
# Check if include target still exists
@@ -302,16 +283,19 @@ do_unset() {
die -q "The target '${l}' exists and could not be removed!"
done
+ for l in $(find "${USR_PATH}/bin" -type l) ; do
+ if [[ $(realpath ${l} | grep -c postgresql) -ge 1 ]] ; then
+ rm "${l}"
+ fi
+ done
+
for x in $(list_libdirs) ; do
- if [[ -d ${USR_PATH}/${x}/postgresql-${SLOT}/${x} ]] ; then
- if [[ -h "${USR_PATH}/${x}/postgresql" ]] ; then
- rm -f "${USR_PATH}/${x}/postgresql"
- [[ -e "${USR_PATH}/${x}/postgresql" ]] && \
- die -q "Unable to remove '${USR_PATH}/${x}/postgresql'"
- fi
-
- unlinker "${USR_PATH}/${x}/postgresql-${SLOT}/${x}/" \
- "-name lib*" "${USR_PATH}/${x}"
+ if [[ -h "${USR_PATH}/${x}/postgresql" ]] ; then
+ for l in $(find "${USR_PATH}/${x}" -type l) ; do
+ if [[ $(realpath ${l} | grep -c postgresql) -ge 1 ]] ; then
+ rm "${l}"
+ fi
+ done
fi
done
}
@@ -401,18 +385,24 @@ do_update() {
# Update paths to libs and man pages
local ldpath
+ local pcpath
local x
for x in $(list_libdirs) ; do
- [[ -h ${USR_PATH}/${x}/postgresql ]] && \
+ if [[ -h ${USR_PATH}/${x}/postgresql ]] ; then
ldpath+="${USR_PATH}/${x}/postgresql:"
+ pcpath+="${USR_PATH}/${x}/postgresql/pkgconfig:"
+ fi
done
ldpath="${ldpath%:}"
+ pcdpath="${pcpath%:}"
local manpath="${USR_PATH}/share/postgresql/man/"
while [[ $[--index] -gt -1 ]] ; do
local curslot="${slots[$index]}"
for x in $(list_libdirs) ; do
local lib_path="${USR_PATH}/${x}/postgresql-${curslot}/${x}/"
+ local pkg_path="${lib_path}/pkgconfig"
[[ -d ${lib_path} ]] && ldpath+=":${lib_path}"
+ [[ -d ${pkg_path} ]] && pcpath+=":${pcpath}"
done
local tmp_manpath="${USR_PATH}/share/postgresql-${curslot}/man/"
[[ -d ${tmp_manpath} ]] && manpath+=":${tmp_manpath}"
@@ -421,5 +411,6 @@ do_update() {
store_config "${ENV_FILE}" LDPATH "${ldpath}"
store_config "${ENV_FILE}" MANPATH "${manpath}"
+ store_config "${ENV_FILE}" PKG_CONFIG_PATH "${pcpath}"
do_action env update &> /dev/null
}
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [gentoo-commits] proj/postgresql/eselect:master commit in: /
@ 2017-05-19 14:20 Aaron Swenson
0 siblings, 0 replies; 28+ messages in thread
From: Aaron Swenson @ 2017-05-19 14:20 UTC (permalink / raw
To: gentoo-commits
commit: f2de7834a881e387b7d26978848d754ee56b1e07
Author: Aaron W. Swenson <titanofold <AT> gentoo <DOT> org>
AuthorDate: Fri May 19 14:10:28 2017 +0000
Commit: Aaron Swenson <titanofold <AT> gentoo <DOT> org>
CommitDate: Fri May 19 14:10:28 2017 +0000
URL: https://gitweb.gentoo.org/proj/postgresql/eselect.git/commit/?id=f2de7834
Add support for FEATURES="noman"
In such case the user enabled FEATURES="noman" on Portage, there won’t
be a manpage directory to link to. The module now checks that the
directory exists before trying to use it.
postgresql.eselect | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/postgresql.eselect b/postgresql.eselect
index d7229e5..db669cc 100644
--- a/postgresql.eselect
+++ b/postgresql.eselect
@@ -256,7 +256,11 @@ do_set() {
local mandir mansec
for mandir in "${USR_PATH}"/share/postgresql-${slot}/man/man{1,3,7} ; do
mansec=$(basename "${mandir}")
- linker "${mandir}" "" "${USR_PATH}/share/man/${mansec}"
+ # Because the user could have FEATURES="noman", check the directory
+ # exists before using it. (https://bugs.gentoo.org/618294)
+ if [[ -d ${USR_PATH}/share/man/${mansec} ]] ; then
+ linker "${mandir}" "" "${USR_PATH}/share/man/${mansec}"
+ fi
done
# Default share path - use a relative link here by just specifying the
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [gentoo-commits] proj/postgresql/eselect:master commit in: /
@ 2017-05-19 14:20 Aaron Swenson
0 siblings, 0 replies; 28+ messages in thread
From: Aaron Swenson @ 2017-05-19 14:20 UTC (permalink / raw
To: gentoo-commits
commit: 48d3ec37b7cad46148b8b32d9294c505d2e4614a
Author: Aaron W. Swenson <titanofold <AT> gentoo <DOT> org>
AuthorDate: Fri May 19 14:18:05 2017 +0000
Commit: Aaron Swenson <titanofold <AT> gentoo <DOT> org>
CommitDate: Fri May 19 14:18:05 2017 +0000
URL: https://gitweb.gentoo.org/proj/postgresql/eselect.git/commit/?id=48d3ec37
Merge branch 'bug-618294'
postgresql.eselect | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
^ permalink raw reply [flat|nested] 28+ messages in thread
* [gentoo-commits] proj/postgresql/eselect:master commit in: /
@ 2017-05-19 14:24 Aaron Swenson
0 siblings, 0 replies; 28+ messages in thread
From: Aaron Swenson @ 2017-05-19 14:24 UTC (permalink / raw
To: gentoo-commits
commit: 1cd1ea127a9ef179845d8aacb94b00c6974802b3
Author: Aaron W. Swenson <titanofold <AT> gentoo <DOT> org>
AuthorDate: Fri May 19 14:21:42 2017 +0000
Commit: Aaron Swenson <titanofold <AT> gentoo <DOT> org>
CommitDate: Fri May 19 14:21:42 2017 +0000
URL: https://gitweb.gentoo.org/proj/postgresql/eselect.git/commit/?id=1cd1ea12
Bump Version
postgresql.eselect | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/postgresql.eselect b/postgresql.eselect
index db669cc..9203a97 100644
--- a/postgresql.eselect
+++ b/postgresql.eselect
@@ -6,7 +6,7 @@ inherit config multilib
DESCRIPTION="Manage active PostgreSQL client applications and libraries"
MAINTAINER="pgsql-bugs@gentoo.org"
-VERSION="2.0"
+VERSION="2.1"
# We do a lot of things in /usr and it's a bit of a pain to write this
# constantly.
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [gentoo-commits] proj/postgresql/eselect:master commit in: /
@ 2017-07-21 18:36 Aaron Swenson
0 siblings, 0 replies; 28+ messages in thread
From: Aaron Swenson @ 2017-07-21 18:36 UTC (permalink / raw
To: gentoo-commits
commit: 1ce72c8f890d9effe502d6d103bca10c6e4b56c4
Author: Aaron W. Swenson <titanofold <AT> gentoo <DOT> org>
AuthorDate: Fri Jul 21 18:31:29 2017 +0000
Commit: Aaron Swenson <titanofold <AT> gentoo <DOT> org>
CommitDate: Fri Jul 21 18:31:29 2017 +0000
URL: https://gitweb.gentoo.org/proj/postgresql/eselect.git/commit/?id=1ce72c8f
Canonicalise even if nonexistent
canoncalise() returns the absolute path a symbolic link points to,
except when the path no longer exists. Adding the -m option – which is
the same for both realpath and readlink – makes it ignore nonexistent
portions of the path.
Bug: https://bugs.gentoo.org/625368
postgresql.eselect | 25 ++++++++++++++++---------
1 file changed, 16 insertions(+), 9 deletions(-)
diff --git a/postgresql.eselect b/postgresql.eselect
index 9203a97..84d08af 100644
--- a/postgresql.eselect
+++ b/postgresql.eselect
@@ -30,7 +30,7 @@ active_slot() {
# ${USR_PATH}/share/postgresql is a symlink to the active
# slot. See if it's there, then find out where it links to.
if [[ -h "${USR_PATH}/share/postgresql" ]] ; then
- canonicalise "${USR_PATH}/share/postgresql" | \
+ canonicalise -m "${USR_PATH}/share/postgresql" | \
sed -re 's#.*([1-9][0-9.]+)$#\1#'
else
echo "(none)"
@@ -283,6 +283,17 @@ do_unset() {
return 0
fi
+ # Get the file path that the link is pointing to. If it has the string
+ # "postgresql-${slot}" somewhere in it, then it's a link that this module is
+ # handling.
+ is_slot_link() {
+ if [[ $(canonicalise -m "$1") == *postgresql-${slot}* ]] ; then
+ return 0 # yes
+ else
+ return 1 # no
+ fi
+ }
+
# Start with some known locations that are, or will contain, symlinks.
local paths=(
"${INCLUDE_TARGETS[@]}"
@@ -307,10 +318,9 @@ do_unset() {
local l path
for path in "${paths[@]}" ; do
- # If path is a link that belongs to the slot in question, it can be
- # removed without invoking find.
- if [[ -h "${path}" && \
- $(canonicalise "${path}") == *postgresql-${slot}* ]] ; then
+ # If $path is a link that belongs to the active slot, it can be removed
+ # without invoking find.
+ if [[ -h "${path}" ]] && is_slot_link "${path}" ; then
rm "${path}" || write_warning_msg "Couldn't remove: ${path}"
continue
fi
@@ -322,10 +332,7 @@ do_unset() {
[[ ${l} == ${USR_PATH}/bin/*${slot/.} ]] && continue
[[ ${l} == ${USR_PATH}/share/man/man?/*${slot/.}* ]] && continue
- # Get the file path that the link is pointing to. If it has the
- # string "postgresql-${slot}" somewhere in it, then it's a link that
- # needs to be removed.
- if [[ $(canonicalise "${l}") == *postgresql-${slot}* ]] ; then
+ if is_slot_link "${l}" ; then
rm "${l}" || write_warning_msg "Couldn't remove: ${l}"
fi
done
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [gentoo-commits] proj/postgresql/eselect:master commit in: /
@ 2017-07-21 18:49 Aaron Swenson
0 siblings, 0 replies; 28+ messages in thread
From: Aaron Swenson @ 2017-07-21 18:49 UTC (permalink / raw
To: gentoo-commits
commit: 9439064794d85b96f7f75e166ab9a3277f128ca6
Author: Aaron W. Swenson <titanofold <AT> gentoo <DOT> org>
AuthorDate: Fri Jul 21 18:48:46 2017 +0000
Commit: Aaron Swenson <titanofold <AT> gentoo <DOT> org>
CommitDate: Fri Jul 21 18:48:46 2017 +0000
URL: https://gitweb.gentoo.org/proj/postgresql/eselect.git/commit/?id=94390647
Remove $Id and Bump Version
postgresql.eselect | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/postgresql.eselect b/postgresql.eselect
index 84d08af..5c90b4b 100644
--- a/postgresql.eselect
+++ b/postgresql.eselect
@@ -1,12 +1,11 @@
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Id: $
inherit config multilib
DESCRIPTION="Manage active PostgreSQL client applications and libraries"
MAINTAINER="pgsql-bugs@gentoo.org"
-VERSION="2.1"
+VERSION="2.2"
# We do a lot of things in /usr and it's a bit of a pain to write this
# constantly.
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [gentoo-commits] proj/postgresql/eselect:master commit in: /
@ 2018-01-14 16:19 Aaron Swenson
0 siblings, 0 replies; 28+ messages in thread
From: Aaron Swenson @ 2018-01-14 16:19 UTC (permalink / raw
To: gentoo-commits
commit: f0f07f3166c116b5dcd56f15e482eefdfc84b9f5
Author: Aaron W. Swenson <aaron <AT> grandmasfridge <DOT> org>
AuthorDate: Sun Jan 14 15:47:05 2018 +0000
Commit: Aaron Swenson <titanofold <AT> gentoo <DOT> org>
CommitDate: Sun Jan 14 15:47:05 2018 +0000
URL: https://gitweb.gentoo.org/proj/postgresql/eselect.git/commit/?id=f0f07f31
Force symlinks
Any symlink we’re trying to make should only be handled by us. We may
come across a symlink we missed in some previous clean up, but really
should be set properly rather than failing because it exists.
postgresql.eselect | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/postgresql.eselect b/postgresql.eselect
index 51d7f50..aa89b49 100644
--- a/postgresql.eselect
+++ b/postgresql.eselect
@@ -97,7 +97,7 @@ linker() {
# Create relative links so that they work both here and inside the new
# root if $ROOT is not "/".
rel_source=$(relative_name "${link_source}" "${target_dir}")
- ln -s "${rel_source}" "${link_target}" || die -q "Unable to create link!"
+ ln -sf "${rel_source}" "${link_target}" || die -q "Unable to create link!"
done
}
@@ -225,7 +225,7 @@ do_set() {
# root if $ROOT is not "/"
rel_source=$(relative_name "${include_sources[$i]}" "$(dirname "${INCLUDE_TARGETS[$i]}")")
- ln -s "$rel_source" "${INCLUDE_TARGETS[$i]}" || \
+ ln -sf "$rel_source" "${INCLUDE_TARGETS[$i]}" || \
die -q "Unable to create link! $rel_source -> ${INCLUDE_TARGETS[$i]}"
done
@@ -235,7 +235,7 @@ do_set() {
if [[ -d "${USR_PATH}/${x}/postgresql-${slot}/${x}" ]] ; then
# 'linker' function doesn't work for linking directories.
# Default lib path - create a relative link
- ln -s "postgresql-${slot}/${x}" "${USR_PATH}/${x}/postgresql"
+ ln -sf "postgresql-${slot}/${x}" "${USR_PATH}/${x}/postgresql"
# Linker works for files
linker "${USR_PATH}/${x}/postgresql-${slot}/${x}/" \
@@ -264,7 +264,7 @@ do_set() {
# Default share path - use a relative link here by just specifying the
# base name
- ln -s "postgresql-${slot}" "${USR_PATH}/share/postgresql"
+ ln -sf "postgresql-${slot}" "${USR_PATH}/share/postgresql"
echo "success!"
}
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [gentoo-commits] proj/postgresql/eselect:master commit in: /
@ 2018-01-14 16:19 Aaron Swenson
0 siblings, 0 replies; 28+ messages in thread
From: Aaron Swenson @ 2018-01-14 16:19 UTC (permalink / raw
To: gentoo-commits
commit: c4bb082cab28210b16b44e001f213f9a5ad7d47b
Author: Aaron W. Swenson <aaron <AT> grandmasfridge <DOT> org>
AuthorDate: Sun Jan 14 15:32:31 2018 +0000
Commit: Aaron Swenson <titanofold <AT> gentoo <DOT> org>
CommitDate: Sun Jan 14 15:32:31 2018 +0000
URL: https://gitweb.gentoo.org/proj/postgresql/eselect.git/commit/?id=c4bb082c
Cleanup senseless symlinks
Look for broken symlinks in the /usr/include/postgresql-${SLOT}
directories. These were made by 2.1. So now we try to clean them up.
postgresql.eselect | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/postgresql.eselect b/postgresql.eselect
index 5c90b4b..51d7f50 100644
--- a/postgresql.eselect
+++ b/postgresql.eselect
@@ -382,6 +382,16 @@ do_update() {
echo "It should be safe for you to remove '${etc_path}'"
fi
fi
+
+ # 2.1 would make some bad symlinks where it shouldn't have. We
+ # attempt to clean them up here.
+ local badsym
+ for badsym in $(find "${USR_PATH}"/include/postgresql-* -type l \
+ -exec test ! -e {} \; -print)
+ do
+ rm "${badsym}"
+ done
+
## End Antiquity Clean Up
local active_slot=$(active_slot)
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [gentoo-commits] proj/postgresql/eselect:master commit in: /
@ 2018-01-14 16:19 Aaron Swenson
0 siblings, 0 replies; 28+ messages in thread
From: Aaron Swenson @ 2018-01-14 16:19 UTC (permalink / raw
To: gentoo-commits
commit: 620d893f7e52f810e40b470761e00f5454fdae36
Author: Aaron W. Swenson <aaron <AT> grandmasfridge <DOT> org>
AuthorDate: Sun Jan 14 16:19:12 2018 +0000
Commit: Aaron Swenson <titanofold <AT> gentoo <DOT> org>
CommitDate: Sun Jan 14 16:19:12 2018 +0000
URL: https://gitweb.gentoo.org/proj/postgresql/eselect.git/commit/?id=620d893f
More concise die messages
postgresql.eselect | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/postgresql.eselect b/postgresql.eselect
index aa89b49..d05f724 100644
--- a/postgresql.eselect
+++ b/postgresql.eselect
@@ -97,7 +97,8 @@ linker() {
# Create relative links so that they work both here and inside the new
# root if $ROOT is not "/".
rel_source=$(relative_name "${link_source}" "${target_dir}")
- ln -sf "${rel_source}" "${link_target}" || die -q "Unable to create link!"
+ ln -sf "${rel_source}" "${link_target}" || \
+ die -q "SYMLINK FAILED: ${rel_source} -> ${link_target}"
done
}
@@ -226,7 +227,7 @@ do_set() {
rel_source=$(relative_name "${include_sources[$i]}" "$(dirname "${INCLUDE_TARGETS[$i]}")")
ln -sf "$rel_source" "${INCLUDE_TARGETS[$i]}" || \
- die -q "Unable to create link! $rel_source -> ${INCLUDE_TARGETS[$i]}"
+ die -q "SYMLINK FAILED: $rel_source -> ${INCLUDE_TARGETS[$i]}"
done
# Link modules to /usr/lib{,32,64}/
@@ -235,7 +236,8 @@ do_set() {
if [[ -d "${USR_PATH}/${x}/postgresql-${slot}/${x}" ]] ; then
# 'linker' function doesn't work for linking directories.
# Default lib path - create a relative link
- ln -sf "postgresql-${slot}/${x}" "${USR_PATH}/${x}/postgresql"
+ ln -sf "postgresql-${slot}/${x}" "${USR_PATH}/${x}/postgresql" || \
+ die -q "SYMLINK FAILED: postgresql-${slot}/${x} -> ${USR_PATH}/${x}/postgresql"
# Linker works for files
linker "${USR_PATH}/${x}/postgresql-${slot}/${x}/" \
@@ -264,7 +266,8 @@ do_set() {
# Default share path - use a relative link here by just specifying the
# base name
- ln -sf "postgresql-${slot}" "${USR_PATH}/share/postgresql"
+ ln -sf "postgresql-${slot}" "${USR_PATH}/share/postgresql" || \
+ die -q "SYMLINK FAILED: postgresql-${slot} -> ${USR_PATH}/share/postgresql"
echo "success!"
}
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [gentoo-commits] proj/postgresql/eselect:master commit in: /
@ 2018-01-14 16:28 Aaron Swenson
0 siblings, 0 replies; 28+ messages in thread
From: Aaron Swenson @ 2018-01-14 16:28 UTC (permalink / raw
To: gentoo-commits
commit: 3e4f034603522c95427c26fc0e9b93002397c749
Author: Aaron W. Swenson <aaron <AT> grandmasfridge <DOT> org>
AuthorDate: Sun Jan 14 16:26:53 2018 +0000
Commit: Aaron Swenson <titanofold <AT> gentoo <DOT> org>
CommitDate: Sun Jan 14 16:26:53 2018 +0000
URL: https://gitweb.gentoo.org/proj/postgresql/eselect.git/commit/?id=3e4f0346
Just try to update symlink
ln now removes an existing symlink when it tries to create one. This
makes it unnecessary to first try to remove the symlink.
postgresql.eselect | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/postgresql.eselect b/postgresql.eselect
index d05f724..84a6e0d 100644
--- a/postgresql.eselect
+++ b/postgresql.eselect
@@ -80,19 +80,16 @@ linker() {
local pattern=$2
local target_dir=$3
local suffix=$4
- local link_source
+
local findings
+ local link_source
+ local link_target
local rel_source
findings=$(finder "${source_dir}" "${pattern}")
for link_source in ${findings} ; do
- local link_target="${target_dir%/}/$(basename ${link_source})${suffix}"
-
- # For good measure, remove target before creating the symlink
- [[ -h ${link_target} ]] && rm -f "${link_target}"
- [[ -e ${link_target} ]] && \
- die -q "The target '${link_target}' still exists and could not be removed!"
+ link_target="${target_dir%/}/$(basename ${link_source})${suffix}"
# Create relative links so that they work both here and inside the new
# root if $ROOT is not "/".
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [gentoo-commits] proj/postgresql/eselect:master commit in: /
@ 2018-01-14 16:38 Aaron Swenson
0 siblings, 0 replies; 28+ messages in thread
From: Aaron Swenson @ 2018-01-14 16:38 UTC (permalink / raw
To: gentoo-commits
commit: ac185cf15ec0c3276511786fffc871c64c81312c
Author: Aaron W. Swenson <aaron <AT> grandmasfridge <DOT> org>
AuthorDate: Sun Jan 14 16:37:23 2018 +0000
Commit: Aaron Swenson <titanofold <AT> gentoo <DOT> org>
CommitDate: Sun Jan 14 16:37:23 2018 +0000
URL: https://gitweb.gentoo.org/proj/postgresql/eselect.git/commit/?id=ac185cf1
Die if we can’t remove badsym
If badsym can’t be removed, it’ll gum up the works later when trying
to create links, especially since they don’t point anywhere.
postgresql.eselect | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/postgresql.eselect b/postgresql.eselect
index 84a6e0d..099cbda 100644
--- a/postgresql.eselect
+++ b/postgresql.eselect
@@ -389,7 +389,8 @@ do_update() {
for badsym in $(find "${USR_PATH}"/include/postgresql-* -type l \
-exec test ! -e {} \; -print)
do
- rm "${badsym}"
+ # If $badsym can't be removed, we're gonna have a bad time
+ rm "${badsym}" || die -q "Manual rm required: ${badsym}"
done
## End Antiquity Clean Up
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [gentoo-commits] proj/postgresql/eselect:master commit in: /
@ 2018-01-14 16:39 Aaron Swenson
0 siblings, 0 replies; 28+ messages in thread
From: Aaron Swenson @ 2018-01-14 16:39 UTC (permalink / raw
To: gentoo-commits
commit: 8a6a81e3624107f2536e7784bded7ea10a960018
Author: Aaron W. Swenson <aaron <AT> grandmasfridge <DOT> org>
AuthorDate: Sun Jan 14 16:38:56 2018 +0000
Commit: Aaron Swenson <titanofold <AT> gentoo <DOT> org>
CommitDate: Sun Jan 14 16:38:56 2018 +0000
URL: https://gitweb.gentoo.org/proj/postgresql/eselect.git/commit/?id=8a6a81e3
Bump version to 2.3
postgresql.eselect | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/postgresql.eselect b/postgresql.eselect
index 099cbda..18b411b 100644
--- a/postgresql.eselect
+++ b/postgresql.eselect
@@ -5,7 +5,7 @@ inherit config multilib
DESCRIPTION="Manage active PostgreSQL client applications and libraries"
MAINTAINER="pgsql-bugs@gentoo.org"
-VERSION="2.2"
+VERSION="2.3"
# We do a lot of things in /usr and it's a bit of a pain to write this
# constantly.
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [gentoo-commits] proj/postgresql/eselect:master commit in: /
@ 2018-01-14 16:43 Aaron Swenson
0 siblings, 0 replies; 28+ messages in thread
From: Aaron Swenson @ 2018-01-14 16:43 UTC (permalink / raw
To: gentoo-commits
commit: ba6b5e21ec7a85eb7521d0ae5c705ed791045104
Author: Aaron W. Swenson <aaron <AT> grandmasfridge <DOT> org>
AuthorDate: Sun Jan 14 16:43:18 2018 +0000
Commit: Aaron Swenson <titanofold <AT> gentoo <DOT> org>
CommitDate: Sun Jan 14 16:43:18 2018 +0000
URL: https://gitweb.gentoo.org/proj/postgresql/eselect.git/commit/?id=ba6b5e21
Rename is_slot_link to is_active_slot_link
postgresql.eselect | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/postgresql.eselect b/postgresql.eselect
index 18b411b..f648956 100644
--- a/postgresql.eselect
+++ b/postgresql.eselect
@@ -285,7 +285,7 @@ do_unset() {
# Get the file path that the link is pointing to. If it has the string
# "postgresql-${slot}" somewhere in it, then it's a link that this module is
# handling.
- is_slot_link() {
+ is_active_slot_link() {
if [[ $(canonicalise -m "$1") == *postgresql-${slot}* ]] ; then
return 0 # yes
else
@@ -319,7 +319,7 @@ do_unset() {
for path in "${paths[@]}" ; do
# If $path is a link that belongs to the active slot, it can be removed
# without invoking find.
- if [[ -h "${path}" ]] && is_slot_link "${path}" ; then
+ if [[ -h "${path}" ]] && is_active_slot_link "${path}" ; then
rm "${path}" || write_warning_msg "Couldn't remove: ${path}"
continue
fi
@@ -331,7 +331,7 @@ do_unset() {
[[ ${l} == ${USR_PATH}/bin/*${slot/.} ]] && continue
[[ ${l} == ${USR_PATH}/share/man/man?/*${slot/.}* ]] && continue
- if is_slot_link "${l}" ; then
+ if is_active_slot_link "${l}" ; then
rm "${l}" || write_warning_msg "Couldn't remove: ${l}"
fi
done
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [gentoo-commits] proj/postgresql/eselect:master commit in: /
@ 2018-10-21 11:00 Aaron Swenson
0 siblings, 0 replies; 28+ messages in thread
From: Aaron Swenson @ 2018-10-21 11:00 UTC (permalink / raw
To: gentoo-commits
commit: d6f5ae7a05ef4f6d17676b4475ab8fd43aa5979b
Author: Aaron W. Swenson <aaron <AT> grandmasfridge <DOT> org>
AuthorDate: Mon Aug 13 10:15:14 2018 +0000
Commit: Aaron Swenson <titanofold <AT> gentoo <DOT> org>
CommitDate: Mon Aug 13 10:15:14 2018 +0000
URL: https://gitweb.gentoo.org/proj/postgresql/eselect.git/commit/?id=d6f5ae7a
Bump to 2.4
postgresql.eselect | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/postgresql.eselect b/postgresql.eselect
index f648956..3614202 100644
--- a/postgresql.eselect
+++ b/postgresql.eselect
@@ -5,7 +5,7 @@ inherit config multilib
DESCRIPTION="Manage active PostgreSQL client applications and libraries"
MAINTAINER="pgsql-bugs@gentoo.org"
-VERSION="2.3"
+VERSION="2.4"
# We do a lot of things in /usr and it's a bit of a pain to write this
# constantly.
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [gentoo-commits] proj/postgresql/eselect:master commit in: /
@ 2018-10-21 11:00 Aaron Swenson
0 siblings, 0 replies; 28+ messages in thread
From: Aaron Swenson @ 2018-10-21 11:00 UTC (permalink / raw
To: gentoo-commits
commit: 1cf8648293a946af9989c1a6094708160bbe38da
Author: Aaron W. Swenson <aaron <AT> grandmasfridge <DOT> org>
AuthorDate: Sun Oct 21 10:57:46 2018 +0000
Commit: Aaron Swenson <titanofold <AT> gentoo <DOT> org>
CommitDate: Sun Oct 21 10:57:46 2018 +0000
URL: https://gitweb.gentoo.org/proj/postgresql/eselect.git/commit/?id=1cf86482
Do not dereference links
In some conditions, ln will follow symlinks it isn’t supposed to. Add
the -n switch to keep that from happening.
Closes: https://bugs.gentoo.org/662810
postgresql.eselect | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/postgresql.eselect b/postgresql.eselect
index 3614202..4283ee9 100644
--- a/postgresql.eselect
+++ b/postgresql.eselect
@@ -94,7 +94,7 @@ linker() {
# Create relative links so that they work both here and inside the new
# root if $ROOT is not "/".
rel_source=$(relative_name "${link_source}" "${target_dir}")
- ln -sf "${rel_source}" "${link_target}" || \
+ ln -sfn "${rel_source}" "${link_target}" || \
die -q "SYMLINK FAILED: ${rel_source} -> ${link_target}"
done
}
@@ -223,7 +223,7 @@ do_set() {
# root if $ROOT is not "/"
rel_source=$(relative_name "${include_sources[$i]}" "$(dirname "${INCLUDE_TARGETS[$i]}")")
- ln -sf "$rel_source" "${INCLUDE_TARGETS[$i]}" || \
+ ln -sfn "$rel_source" "${INCLUDE_TARGETS[$i]}" || \
die -q "SYMLINK FAILED: $rel_source -> ${INCLUDE_TARGETS[$i]}"
done
@@ -233,7 +233,7 @@ do_set() {
if [[ -d "${USR_PATH}/${x}/postgresql-${slot}/${x}" ]] ; then
# 'linker' function doesn't work for linking directories.
# Default lib path - create a relative link
- ln -sf "postgresql-${slot}/${x}" "${USR_PATH}/${x}/postgresql" || \
+ ln -sfn "postgresql-${slot}/${x}" "${USR_PATH}/${x}/postgresql" || \
die -q "SYMLINK FAILED: postgresql-${slot}/${x} -> ${USR_PATH}/${x}/postgresql"
# Linker works for files
@@ -263,7 +263,7 @@ do_set() {
# Default share path - use a relative link here by just specifying the
# base name
- ln -sf "postgresql-${slot}" "${USR_PATH}/share/postgresql" || \
+ ln -sfn "postgresql-${slot}" "${USR_PATH}/share/postgresql" || \
die -q "SYMLINK FAILED: postgresql-${slot} -> ${USR_PATH}/share/postgresql"
echo "success!"
^ permalink raw reply related [flat|nested] 28+ messages in thread
end of thread, other threads:[~2018-10-21 11:00 UTC | newest]
Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-14 16:28 [gentoo-commits] proj/postgresql/eselect:master commit in: / Aaron Swenson
-- strict thread matches above, loose matches on Subject: below --
2018-10-21 11:00 Aaron Swenson
2018-10-21 11:00 Aaron Swenson
2018-01-14 16:43 Aaron Swenson
2018-01-14 16:39 Aaron Swenson
2018-01-14 16:38 Aaron Swenson
2018-01-14 16:19 Aaron Swenson
2018-01-14 16:19 Aaron Swenson
2018-01-14 16:19 Aaron Swenson
2017-07-21 18:49 Aaron Swenson
2017-07-21 18:36 Aaron Swenson
2017-05-19 14:24 Aaron Swenson
2017-05-19 14:20 Aaron Swenson
2017-05-19 14:20 Aaron Swenson
2017-04-18 19:43 Aaron Swenson
2017-04-18 19:43 Aaron Swenson
2017-04-18 19:43 Aaron Swenson
2017-04-18 19:43 Aaron Swenson
2017-04-18 19:43 Aaron Swenson
2017-04-18 19:43 Aaron Swenson
2017-04-18 19:43 Aaron Swenson
2017-04-18 19:43 Aaron Swenson
2017-04-18 19:43 Aaron Swenson
2017-04-18 19:43 Aaron Swenson
2017-04-18 19:43 Aaron Swenson
2017-04-18 19:43 Aaron Swenson
2017-04-18 19:43 [gentoo-commits] proj/postgresql/eselect:stateless " Aaron Swenson
2017-04-18 19:43 ` [gentoo-commits] proj/postgresql/eselect:master " Aaron Swenson
2017-02-06 13:19 [gentoo-commits] proj/postgresql/eselect:stateless " Aaron Swenson
2017-04-18 19:43 ` [gentoo-commits] proj/postgresql/eselect:master " Aaron Swenson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox