Skip to content

Commit

Permalink
dev-db/postgres: Fix environment reset in pkg_config
Browse files Browse the repository at this point in the history
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

Signed-off-by: Martin Kletzander <nert.pinx@gmail.com>
  • Loading branch information
nertpinx committed Nov 20, 2020
1 parent c9e48ae commit 355e1c7
Show file tree
Hide file tree
Showing 13 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion dev-db/postgresql/postgresql-10.14.ebuild
Expand Up @@ -389,7 +389,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
Expand Down
2 changes: 1 addition & 1 deletion dev-db/postgresql/postgresql-10.15.ebuild
Expand Up @@ -392,7 +392,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
Expand Down
2 changes: 1 addition & 1 deletion dev-db/postgresql/postgresql-11.10.ebuild
Expand Up @@ -394,7 +394,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
Expand Down
2 changes: 1 addition & 1 deletion dev-db/postgresql/postgresql-11.9.ebuild
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion dev-db/postgresql/postgresql-12.4.ebuild
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion dev-db/postgresql/postgresql-12.5.ebuild
Expand Up @@ -394,7 +394,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
Expand Down
2 changes: 1 addition & 1 deletion dev-db/postgresql/postgresql-13.0.ebuild
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion dev-db/postgresql/postgresql-13.1.ebuild
Expand Up @@ -394,7 +394,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
Expand Down
2 changes: 1 addition & 1 deletion dev-db/postgresql/postgresql-9.5.23.ebuild
Expand Up @@ -414,7 +414,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
Expand Down
2 changes: 1 addition & 1 deletion dev-db/postgresql/postgresql-9.5.24.ebuild
Expand Up @@ -414,7 +414,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
Expand Down
2 changes: 1 addition & 1 deletion dev-db/postgresql/postgresql-9.6.19.ebuild
Expand Up @@ -414,7 +414,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
Expand Down
2 changes: 1 addition & 1 deletion dev-db/postgresql/postgresql-9.6.20.ebuild
Expand Up @@ -414,7 +414,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
Expand Down
2 changes: 1 addition & 1 deletion dev-db/postgresql/postgresql-9999.ebuild
Expand Up @@ -403,7 +403,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
Expand Down

0 comments on commit 355e1c7

Please sign in to comment.