Lines 43-55
Link Here
|
43 |
xml2? ( dev-libs/libxml2 dev-libs/libxslt ) |
43 |
xml2? ( dev-libs/libxml2 dev-libs/libxslt ) |
44 |
kerberos? ( virtual/krb5 )" |
44 |
kerberos? ( virtual/krb5 )" |
45 |
|
45 |
|
46 |
PG_DIR="/var/lib/postgresql" |
|
|
47 |
|
46 |
|
48 |
pkg_setup() { |
47 |
pkg_setup() { |
|
|
48 |
PG_DIR=`([ -f /etc/conf.d/postgresql ] && sed -n 's/^PGDATA=\(.\)/\1/p' < /etc/conf.d/postgresql ) || echo "/var/lib/postgresql"` |
49 |
if [ -z "${PG_DIR}" ] ; then |
50 |
ewarn "Cannot figure out PGDATA, using defaults" |
51 |
PG_DIR="/var/lib/postgresql" |
52 |
fi |
53 |
|
54 |
einfo "Using ${PG_DIR} as data dir" |
55 |
|
49 |
if [ -f ${PG_DIR}/data/PG_VERSION ] ; then |
56 |
if [ -f ${PG_DIR}/data/PG_VERSION ] ; then |
50 |
PG_MAJOR=`cat ${PG_DIR}/data/PG_VERSION | cut -f1 -d.` |
57 |
PG_MAJOR=`cat ${PG_DIR}/data/PG_VERSION | cut -f1 -d.` |
51 |
PG_MINOR=`cat ${PG_DIR}/data/PG_VERSION | cut -f2 -d.` |
58 |
PG_MINOR=`cat ${PG_DIR}/data/PG_VERSION | cut -f2 -d.` |
52 |
if [ ${PG_MAJOR} -lt 8 ] || [ ${PG_MAJOR} -eq 8 -a ${PG_MINOR} -lt 0 ] ; then |
59 |
if [ ${PG_MAJOR} -lt 8 ] || [ ${PG_MAJOR} -eq 8 -a ${PG_MINOR} -lt 1 ] ; then |
53 |
eerror "Postgres ${PV} cannot upgrade your existing databases, you must" |
60 |
eerror "Postgres ${PV} cannot upgrade your existing databases, you must" |
54 |
eerror "use pg_dump to export your existing databases to a file, and then" |
61 |
eerror "use pg_dump to export your existing databases to a file, and then" |
55 |
eerror "pg_restore to import them when you have upgraded completely." |
62 |
eerror "pg_restore to import them when you have upgraded completely." |
Lines 171-176
Link Here
|
171 |
} |
178 |
} |
172 |
|
179 |
|
173 |
pkg_config() { |
180 |
pkg_config() { |
|
|
181 |
PG_DIR=`([ -f /etc/conf.d/postgresql ] && sed -n 's/^PGDATA=\(.\)/\1/p' </etc/conf.d/postgresql) || echo "/var/lib/postgresql"` |
182 |
if [ -z "${PG_DIR}" ] ; then |
183 |
ewarn "Cannot figure out PGDATA, using defaults" |
184 |
PG_DIR="/var/lib/postgresql" |
185 |
fi |
186 |
|
187 |
|
174 |
einfo "Creating the data directory ..." |
188 |
einfo "Creating the data directory ..." |
175 |
mkdir -p ${PG_DIR}/data |
189 |
mkdir -p ${PG_DIR}/data |
176 |
chown -Rf postgres:postgres ${PG_DIR} |
190 |
chown -Rf postgres:postgres ${PG_DIR} |