public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Aaron Swenson" <titanofold@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/pgsql-patches:eselect commit in: /
Date: Fri,  1 Apr 2011 11:43:18 +0000 (UTC)	[thread overview]
Message-ID: <bf609c9da1041c05189728470477a4b602213241.titanofold@gentoo> (raw)

commit:     bf609c9da1041c05189728470477a4b602213241
Author:     Aaron W. Swenson <titanofold <AT> gentoo <DOT> org>
AuthorDate: Fri Apr  1 11:41:36 2011 +0000
Commit:     Aaron Swenson <titanofold <AT> gentoo <DOT> org>
CommitDate: Fri Apr  1 11:41:36 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pgsql-patches.git;a=commit;h=bf609c9d

Path quoting complete, and remove the path quoting inside [[ ]].
[[ ]] used instead of [ ] everywhere.

---
 postgresql.eselect |   44 +++++++++++++++++++++++---------------------
 1 files changed, 23 insertions(+), 21 deletions(-)

diff --git a/postgresql.eselect b/postgresql.eselect
index 36fedb8..84e1167 100644
--- a/postgresql.eselect
+++ b/postgresql.eselect
@@ -15,7 +15,7 @@ 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
+	if [[ -r ${E_PATH}/active && -n ${E_PATH}/active ]] ; then
 		echo $( <"${E_PATH}"/active )
 	else
 		echo "(none)"
@@ -25,10 +25,10 @@ active_slot() {
 lib_dir() {
 	local lib_list=$(list_libdirs)
 	if [[ ${lib_list} =~ .*lib64.* && \
-		"$(ls -d ${B_PATH}/lib64/postgresql-*/lib)" != "" ]] ; then
+		$(ls -d ${B_PATH}/lib64/postgresql-*/lib) != "" ]] ; then
 		echo "lib64"
 	elif [[ ${lib_list} =~ .*lib32.* && \
-		"$(ls -d ${B_PATH}/lib32/postgresql-*/lib)" != "" ]] ; then
+		$(ls -d ${B_PATH}/lib32/postgresql-*/lib) != "" ]] ; then
 		echo "lib32"
 	else
 		echo "lib"
@@ -52,8 +52,8 @@ linker() {
 		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}" ]] && \
+		[[ -h ${link_target} ]] && rm -f "${link_target}"
+		[[ -e ${link_target} ]] && \
 			die -q "The target '${link_target}' still exists and could not be removed!"
 
 		ln -s "${link_source}" "${link_target}" || die -q "Unable to create link!"
@@ -66,11 +66,11 @@ linker() {
 #   - 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
+	if [[ -r ${active_link_file} ]] ; then
 		local active_links=($(<"${active_link_file}"))
 		for (( i=0; $i < ${#active_links[@]}; i++ )) ; do
-			[ -h "${active_links[$i]}" ] && rm -f "${active_links[$i]}"
-			[ -e "${active_links[$i]}" ] && \
+			[[ -h ${active_links[$i]} ]] && rm -f "${active_links[$i]}"
+			[[ -e ${active_links[$i]} ]] && \
 				die -q "The target '${active_links[$i]}' still exists and could not be removed!"
 		done
 
@@ -102,7 +102,7 @@ do_list() {
 			local postgres_ebuilds=""
 			local src
 			for src in "${E_PATH}"/slots/${slot}/{server,service,base,docs} ; do
-				[ -r "${src}" ] && source "${src}"
+				[[ -r ${src} ]] && source "${src}"
 			done
 
 			case "${slot}" in
@@ -113,7 +113,7 @@ do_list() {
 			esac
 		done
 
-		[ -z "${postgres_ebuilds}" ] && write_warning_msg "No slots available."
+		[[ -z "${postgres_ebuilds}" ]] && write_warning_msg "No slots available."
 	fi
 }
 
@@ -143,7 +143,7 @@ describe_set() {
 
 do_set() {
 	local SLOT=$1
-	if [ ! -d "${B_PATH}"/$(lib_dir)/postgresql-${SLOT} ] ; then
+	if [[ ! -d ${B_PATH}/$(lib_dir)/postgresql-${SLOT} ]] ; then
 		die -q "Not a valid slot."
 	fi
 
@@ -174,10 +174,10 @@ do_set() {
 	local i
 	for (( i=0; $i < ${#sources[@]}; i++ )) ; do
 		# Remove target before creating the symlink
-		[[ -h "${targets[$i]}" ]] && rm -f "${targets[$i]}"
+		[[ -h ${targets[$i]} ]] && rm -f "${targets[$i]}"
 
 		# Check if link_target still exists
-		[[ -e "${targets[$i]}" ]] && \
+		[[ -e ${targets[$i]} ]] && \
 			die -q "The target '${targets[$i]}' exists and could not be removed!"
 
 		ln -s "${sources[$i]}" "${targets[$i]}" || die -q "Unable to create link!"
@@ -187,7 +187,7 @@ do_set() {
 	# Link modules to /usr/lib{,lib32,lib64}/
 	local x
 	for x in $(list_libdirs) ; do
-		if [[ -d "${B_PATH}/${x}/postgresql-${SLOT}/${x}" ]] ; then
+		if [[ -d ${B_PATH}/${x}/postgresql-${SLOT}/${x} ]] ; then
 			# 'linker' function doesn't work for linking directories.
 			# Default lib path
 			ln -s "${B_PATH}/${x}/postgresql-${SLOT}/${x}" "${B_PATH}/${x}/postgresql"
@@ -218,7 +218,7 @@ describe_unset() {
 
 do_unset() {
 	local SLOT=$1
-	if [[ "${SLOT}" = "$(active_slot)" ]] ; then
+	if [[ ${SLOT} = $(active_slot) ]] ; then
 		echo -n "Unsetting ${SLOT} as the default installation..."
 		unlinker "${E_PATH}/active.links"
 		rm -f "${E_PATH}/active"
@@ -235,7 +235,7 @@ describe_reset() {
 
 do_reset() {
 	local SLOT=$(active_slot)
-	[[ "${SLOT}" = "(none)" ]] && die -q "No active slot to reset."
+	[[ ${SLOT} = "(none)" ]] && die -q "No active slot to reset."
 	do_unset ${SLOT}
 	do_set ${SLOT}
 }
@@ -248,10 +248,12 @@ describe_update() {
 do_update() {
 	local slot=$(active_slot)
 	# Check for files managed by postgresql.eselect before 1.0
-	[[ -h "${E_PATH}active" ]] && \
-		slot="$(basename $(canonicalise ${E_PATH/active))"
+	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"
+	[[ -h ${E_PATH}/service ]] && rm -f "${E_PATH}/service"
 
 	local slots=($(get_slots))
 	local index=${#slots[@]}
@@ -296,7 +298,7 @@ do_update() {
 	local ldpath
 	local x
 	for x in $(list_libdirs) ; do
-		[[ -h "${B_PATH}"/${x}/postgresql ]] && \
+		[[ -h ${B_PATH}/${x}/postgresql ]] && \
 			ldpath+="${B_PATH}/${x}/postgresql:"
 	done
 	ldpath="${ldpath%:}"
@@ -305,7 +307,7 @@ do_update() {
 		local curslot="${slots[$index]}"
 		echo -n "Refreshing symbolic links for ${curslot} applications (like "
 		echo -n "/usr/bin/psql${curslot//.})..."
-		for x in ${LIB_LIST} ; do
+		for x in $(list_libdirs) ; do
 			local lib_path="${B_PATH}/${x}/postgresql-${curslot}/${x}/"
 			[[ -d ${lib_path} ]] && ldpath+=":${lib_path}"
 		done



             reply	other threads:[~2011-04-01 11:43 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-01 11:43 Aaron Swenson [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-11-21 11:38 [gentoo-commits] proj/pgsql-patches:eselect commit in: / Aaron Swenson
2013-11-21 11:19 Aaron Swenson
2013-07-27 21:42 Aaron Swenson
2013-07-27 21:34 Aaron Swenson
2013-07-13 14:06 Aaron Swenson
2013-06-13 10:33 Aaron Swenson
2013-02-08 12:35 Aaron Swenson
2013-02-03 13:35 Aaron Swenson
2012-02-22 11:43 Aaron Swenson
2011-04-26 21:46 Aaron Swenson
2011-04-26 21:46 Aaron Swenson
2011-04-24 13:18 Aaron Swenson
2011-04-22 10:45 Aaron Swenson
2011-04-22 10:27 Aaron Swenson
2011-04-22 10:08 Aaron Swenson
2011-04-21 23:30 Aaron Swenson
2011-04-21 23:27 Aaron Swenson
2011-04-19  0:45 Aaron Swenson
2011-04-14 11:52 Aaron Swenson
2011-04-02 11:24 Aaron Swenson
2011-04-01 11:51 Aaron Swenson
2011-04-01 11:49 Aaron Swenson
2011-04-01 11:14 Aaron Swenson
2011-03-29 19:34 Aaron Swenson
2011-03-29 19:34 Aaron Swenson
2011-03-27 13:28 Aaron Swenson
2011-03-26  2:13 Aaron Swenson
2011-03-24 22:41 Aaron Swenson
2011-03-22  3:07 Aaron Swenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bf609c9da1041c05189728470477a4b602213241.titanofold@gentoo \
    --to=titanofold@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox