aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron W. Swenson <titanofold@gentoo.org>2011-03-29 15:34:18 -0400
committerAaron W. Swenson <titanofold@gentoo.org>2011-03-29 15:34:18 -0400
commitbe71bd07a5df16be4dba219376d4fedcda876cbe (patch)
tree10323667aa400f36ef01cf99e820ca90ba966a65 /postgresql.eselect
parentSwitched from 'ls' to 'find'. Addressed issues from (diff)
downloadeselect-be71bd07a5df16be4dba219376d4fedcda876cbe.tar.gz
eselect-be71bd07a5df16be4dba219376d4fedcda876cbe.tar.bz2
eselect-be71bd07a5df16be4dba219376d4fedcda876cbe.zip
Bit harder to trick get_slots().
Diffstat (limited to 'postgresql.eselect')
-rw-r--r--postgresql.eselect4
1 files changed, 3 insertions, 1 deletions
diff --git a/postgresql.eselect b/postgresql.eselect
index 211dbc5..7b7501b 100644
--- a/postgresql.eselect
+++ b/postgresql.eselect
@@ -81,7 +81,9 @@ unlinker() {
### Get Slots Function ###
# Find all available slots in the preferred lib_dir() and return them.
get_slots() {
- echo $(ls -dv ${B_PATH}/$(lib_dir)/postgresql-* 2> /dev/null | sed -re 's#^.+-##')
+ echo $(find "${B_PATH}/$(lib_dir)" -maxdepth 1 -type d \
+ -regex '.*postgresql-[0-9]+\.[0-9]+' -printf '%f\n' | \
+ sed -re 's#^.+-##' | sort -n)
}
### List Action ###