commit:     b642f661af8b1c7f35d6f6b36a28af173fc7c51f
Author:     Aaron W. Swenson <titanofold <AT> gentoo <DOT> org>
AuthorDate: Wed Jul  7 00:38:38 2021 +0000
Commit:     Aaron W. Swenson <titanofold <AT> gentoo <DOT> org>
CommitDate: Wed Jul  7 00:38:38 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b642f661

dev-db/postgresql: Fix environment reset in pkg_config

Without resetting the environment the config phase results in the following
non-fatal error message being produced:

  could not change directory to 
"/var/tmp/portage/dev-db/postgresql-13.1/homedir": Permission denied

Package-Manager: Portage-3.0.9, Repoman-3.0.2
Signed-off-by: Martin Kletzander <nert.pinx <AT> gmail.com>
Closes: https://bugs.gentoo.org/796344
Closes: https://github.com/gentoo/gentoo/pull/18332
Signed-off-by: Aaron W. Swenson <titanofold <AT> gentoo.org>

 dev-db/postgresql/postgresql-10.17.ebuild    | 2 +-
 dev-db/postgresql/postgresql-11.12.ebuild    | 2 +-
 dev-db/postgresql/postgresql-12.7.ebuild     | 2 +-
 dev-db/postgresql/postgresql-13.3.ebuild     | 2 +-
 dev-db/postgresql/postgresql-14_beta2.ebuild | 2 +-
 dev-db/postgresql/postgresql-9.6.22.ebuild   | 2 +-
 dev-db/postgresql/postgresql-9999.ebuild     | 2 +-
 7 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/dev-db/postgresql/postgresql-10.17.ebuild 
b/dev-db/postgresql/postgresql-10.17.ebuild
index 866e2d6f698..7723abe2353 100644
--- a/dev-db/postgresql/postgresql-10.17.ebuild
+++ b/dev-db/postgresql/postgresql-10.17.ebuild
@@ -391,7 +391,7 @@ pkg_config() {
        einfo "Initializing the database ..."
 
        if [[ ${EUID} == 0 ]] ; then
-               su postgres -c 
"${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" 
${PG_INITDB_OPTS}"
+               su - postgres -c 
"${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" 
${PG_INITDB_OPTS}"
        else
                "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U 
postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
        fi

diff --git a/dev-db/postgresql/postgresql-11.12.ebuild 
b/dev-db/postgresql/postgresql-11.12.ebuild
index 5a20556a0fe..07aed06687c 100644
--- a/dev-db/postgresql/postgresql-11.12.ebuild
+++ b/dev-db/postgresql/postgresql-11.12.ebuild
@@ -388,7 +388,7 @@ pkg_config() {
        einfo "Initializing the database ..."
 
        if [[ ${EUID} == 0 ]] ; then
-               su postgres -c 
"${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" 
${PG_INITDB_OPTS}"
+               su - postgres -c 
"${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" 
${PG_INITDB_OPTS}"
        else
                "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U 
postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
        fi

diff --git a/dev-db/postgresql/postgresql-12.7.ebuild 
b/dev-db/postgresql/postgresql-12.7.ebuild
index c6cea755c81..82e066d4d05 100644
--- a/dev-db/postgresql/postgresql-12.7.ebuild
+++ b/dev-db/postgresql/postgresql-12.7.ebuild
@@ -388,7 +388,7 @@ pkg_config() {
        einfo "Initializing the database ..."
 
        if [[ ${EUID} == 0 ]] ; then
-               su postgres -c 
"${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" 
${PG_INITDB_OPTS}"
+               su - postgres -c 
"${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" 
${PG_INITDB_OPTS}"
        else
                "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U 
postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
        fi

diff --git a/dev-db/postgresql/postgresql-13.3.ebuild 
b/dev-db/postgresql/postgresql-13.3.ebuild
index 9b8485c9bc0..d71750a1cb7 100644
--- a/dev-db/postgresql/postgresql-13.3.ebuild
+++ b/dev-db/postgresql/postgresql-13.3.ebuild
@@ -388,7 +388,7 @@ pkg_config() {
        einfo "Initializing the database ..."
 
        if [[ ${EUID} == 0 ]] ; then
-               su postgres -c 
"${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" 
${PG_INITDB_OPTS}"
+               su - postgres -c 
"${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" 
${PG_INITDB_OPTS}"
        else
                "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U 
postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
        fi

diff --git a/dev-db/postgresql/postgresql-14_beta2.ebuild 
b/dev-db/postgresql/postgresql-14_beta2.ebuild
index 0ef0e4f1672..a9630c760e8 100644
--- a/dev-db/postgresql/postgresql-14_beta2.ebuild
+++ b/dev-db/postgresql/postgresql-14_beta2.ebuild
@@ -390,7 +390,7 @@ pkg_config() {
        einfo "Initializing the database ..."
 
        if [[ ${EUID} == 0 ]] ; then
-               su postgres -c 
"${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" 
${PG_INITDB_OPTS}"
+               su - postgres -c 
"${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" 
${PG_INITDB_OPTS}"
        else
                "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U 
postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
        fi

diff --git a/dev-db/postgresql/postgresql-9.6.22.ebuild 
b/dev-db/postgresql/postgresql-9.6.22.ebuild
index 81db6bcb359..6ef13fcda3a 100644
--- a/dev-db/postgresql/postgresql-9.6.22.ebuild
+++ b/dev-db/postgresql/postgresql-9.6.22.ebuild
@@ -411,7 +411,7 @@ pkg_config() {
        einfo "Initializing the database ..."
 
        if [[ ${EUID} == 0 ]] ; then
-               su postgres -c 
"${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" 
${PG_INITDB_OPTS}"
+               su - postgres -c 
"${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" 
${PG_INITDB_OPTS}"
        else
                "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U 
postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
        fi

diff --git a/dev-db/postgresql/postgresql-9999.ebuild 
b/dev-db/postgresql/postgresql-9999.ebuild
index e83be695c51..106cb9fb88f 100644
--- a/dev-db/postgresql/postgresql-9999.ebuild
+++ b/dev-db/postgresql/postgresql-9999.ebuild
@@ -402,7 +402,7 @@ pkg_config() {
        einfo "Initializing the database ..."
 
        if [[ ${EUID} == 0 ]] ; then
-               su postgres -c 
"${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" 
${PG_INITDB_OPTS}"
+               su - postgres -c 
"${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" 
${PG_INITDB_OPTS}"
        else
                "${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U 
postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
        fi

Reply via email to