Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 214438 | Differences between
and this patch

Collapse All | Expand All

(-)file_not_specified_in_diff (-12 / +15 lines)
Line  Link Here
0
-- postgresql-8.2.6.ebuild     2008-01-13 01:44:21.000000000 +0000
0
++ postgresql-8.2.6.ebuild     2008-03-24 15:52:23.000000000 +0000
Lines 31-47 Link Here
31
               nls? ( sys-devel/gettext )
31
               nls? ( sys-devel/gettext )
32
               xml? ( dev-util/pkgconfig )"
32
               xml? ( dev-util/pkgconfig )"
33
33
34
PG_DIR="/var/lib/postgresql"
34
[[ -a "${ROOT}/etc/conf.d/postgresql" ]] && source "${ROOT}/etc/conf.d/postgresql"
35
[[ -z PGDATA ]] && PGDATA="/var/lib/postgresql"
36
[[ -z PGUSER ]] && PGUSER="postgres"
37
[[ -z PGGROUP ]] && PGGROUP="postgres"
35
[[ -z "${PG_MAX_CONNECTIONS}" ]] && PG_MAX_CONNECTIONS="512"
38
[[ -z "${PG_MAX_CONNECTIONS}" ]] && PG_MAX_CONNECTIONS="512"
36
39
37
pkg_setup() {
40
pkg_setup() {
38
       if [[ -f "${PG_DIR}/data/PG_VERSION" ]] ; then
41
       if [[ -f "${PGDATA}/data/PG_VERSION" ]] ; then
39
               if [[ $(cat "${PG_DIR}/data/PG_VERSION") != $(get_version_component_range 1-2) ]] ; then
42
               if [[ $(cat "${PGDATA}/data/PG_VERSION") != $(get_version_component_range 1-2) ]] ; then
40
                       eerror "PostgreSQL ${PV} cannot upgrade your existing databases, you must"
43
                       eerror "PostgreSQL ${PV} cannot upgrade your existing databases, you must"
41
                       eerror "use pg_dump to export your existing databases to a file, and then"
44
                       eerror "use pg_dump to export your existing databases to a file, and then"
42
                       eerror "pg_restore to import them when you have upgraded completely."
45
                       eerror "pg_restore to import them when you have upgraded completely."
43
                       eerror "You must remove your entire database directory to continue."
46
                       eerror "You must remove your entire database directory to continue."
44
                       eerror "(database directory = ${PG_DIR})."
47
                       eerror "(database directory = ${PGDATA})."
45
                       die "Remove your database directory to continue"
48
                       die "Remove your database directory to continue"
46
               fi
49
               fi
47
       fi
50
       fi
Lines 166-180 Link Here
166
169
167
pkg_config() {
170
pkg_config() {
168
       einfo "Creating the data directory ..."
171
       einfo "Creating the data directory ..."
169
       mkdir -p "${PG_DIR}/data"
172
       mkdir -p "${PGDATA}/data"
170
       chown -Rf postgres:postgres "${PG_DIR}"
173
       chown -Rf ${PGUSER}:${PGGROUP} "${PGDATA}"
171
       chmod 0700 "${PG_DIR}/data"
174
       chmod 0700 "${PGDATA}/data"
172
175
173
       einfo "Initializing the database ..."
176
       einfo "Initializing the database ..."
174
       if [[ -f "${PG_DIR}/data/PG_VERSION" ]] ; then
177
       if [[ -f "${PGDATA}/data/PG_VERSION" ]] ; then
175
               eerror "PostgreSQL ${PV} cannot upgrade your existing databases."
178
               eerror "PostgreSQL ${PV} cannot upgrade your existing databases."
176
               eerror "You must remove your entire database directory to continue."
179
               eerror "You must remove your entire database directory to continue."
177
               eerror "(database directory = ${PG_DIR})."
180
               eerror "(database directory = ${PGDATA})."
178
               die "Remove your database directory to continue"
181
               die "Remove your database directory to continue"
179
       else
182
       else
180
               if use kernel_linux ; then
183
               if use kernel_linux ; then
Lines 191-197 Link Here
191
                               echo ${SEM} ${SEMMNI_MIN} > /proc/sys/kernel/sem
194
                               echo ${SEM} ${SEMMNI_MIN} > /proc/sys/kernel/sem
192
                       fi
195
                       fi
193
196
194
                       su postgres -c "/usr/bin/initdb --pgdata ${PG_DIR}/data"
197
                       su ${PGUSER} -c "/usr/bin/initdb --pgdata ${PGDATA}/data"
195
198
196
                       if [ ! `sysctl -n kernel.sem | cut -f4` -eq ${SEMMNI} ] ; then
199
                       if [ ! `sysctl -n kernel.sem | cut -f4` -eq ${SEMMNI} ] ; then
197
                               echo ${SEM} ${SEMMNI} > /proc/sys/kernel/sem
200
                               echo ${SEM} ${SEMMNI} > /proc/sys/kernel/sem
Lines 211-217 Link Here
211
                               eerror
214
                               eerror
212
                       fi
215
                       fi
213
               else
216
               else
214
                       su postgres -c "/usr/bin/initdb --pgdata ${PG_DIR}/data"
217
                       su ${PGUSER} -c "/usr/bin/initdb --pgdata ${PGDATA}/data"
215
               fi
218
               fi
216
219
217
               einfo
220
               einfo

Return to bug 214438