diff options
author | Tiziano Müller <dev-zero@gentoo.org> | 2008-04-07 15:36:00 +0000 |
---|---|---|
committer | Tiziano Müller <dev-zero@gentoo.org> | 2008-04-07 15:36:00 +0000 |
commit | d8ded9c806beca9dcd0862b0e30b51328125704a (patch) | |
tree | 038eb1ee75d54d847c839aa6add241d816c3fb65 /dev-db/postgresql-server/postgresql-server-8.3.1.ebuild | |
parent | dev-db/postgresql-server: Removed old digest files. Refactored pkg_config: It... (diff) | |
download | experimental-d8ded9c806beca9dcd0862b0e30b51328125704a.tar.gz experimental-d8ded9c806beca9dcd0862b0e30b51328125704a.tar.bz2 experimental-d8ded9c806beca9dcd0862b0e30b51328125704a.zip |
dev-db/postgresql-server: Removed pkg_setup check whether there's an older database cluster installed because it's pointless now that we have slotting available. Added some more einfo/ewarns to inform the user how to change the database cluster location.
svn path=/experimental/; revision=356
Diffstat (limited to 'dev-db/postgresql-server/postgresql-server-8.3.1.ebuild')
-rw-r--r-- | dev-db/postgresql-server/postgresql-server-8.3.1.ebuild | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/dev-db/postgresql-server/postgresql-server-8.3.1.ebuild b/dev-db/postgresql-server/postgresql-server-8.3.1.ebuild index a322605..5682246 100644 --- a/dev-db/postgresql-server/postgresql-server-8.3.1.ebuild +++ b/dev-db/postgresql-server/postgresql-server-8.3.1.ebuild @@ -39,22 +39,9 @@ DEPEND="${RDEPEND} xml? ( dev-util/pkgconfig )" PDEPEND="doc? ( dev-db/postgresql-docs:${SLOT} )" -[[ -r /etc/conf.d/postgresql-${SLOT} ]] && source /etc/conf.d/postgresql-${SLOT} -[[ -z "${PGDATA}" ]] && PGDATA="/var/lib/postgresql/${SLOT}/data" - S="${WORKDIR}/postgresql-${PV}" pkg_setup() { - if [[ -f "${PGDATA}/PG_VERSION" ]] ; then - if [[ $(cat "${PGDATA}/PG_VERSION") != $(get_version_component_range 1-2) ]] ; then - eerror "PostgreSQL ${PV} cannot upgrade your existing databases, you must" - eerror "use pg_dump to export your existing databases to a file, and then" - eerror "pg_restore to import them when you have upgraded completely." - eerror "You must remove your entire database directory to continue." - eerror "(database directory = ${PGDATA})." - die "Remove your database directory to continue" - fi - fi enewgroup postgres 70 enewuser postgres 70 /bin/bash /var/lib postgres } @@ -163,23 +150,31 @@ pkg_postrm() { } pkg_config() { - if [[ -f "${PGDATA}/PG_VERSION" ]] ; then - eerror "PostgreSQL ${PV} cannot upgrade your existing databases." - eerror "You must remove your entire database directory to continue." - eerror "(database directory = ${PGDATA})." - die "Remove your database directory to continue" - fi + [[ -z "${PGDATA}" ]] && PGDATA="/var/lib/postgresql/${SLOT}/data" einfo "You can pass options to initdb by setting the PG_INITDB_OPTS variable." einfo "More information can be found here:" - einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" - - einfo "PG_INITDB_OPTS is currently set to \"${PG_INITDB_OPTS}\"" + einfo " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html" + einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html" + einfo "Simply add the options you would have added to initdb to the PG_INITDB_OPTS variable." + einfo + einfo "You can change the directory where the database cluster is being created by setting" + einfo "the PGDATA variable." + einfo + einfo "PG_INITDB_OPTS is currently set to:" + einfo " \"${PG_INITDB_OPTS}\"" + einfo "and the database cluster will be created in:" + einfo " \"${PGDATA}\"" einfo "Are you ready to continue? (Y/n)" read answer [ -z $answer ] && answer=Y [ "$answer" == "Y" ] || [ "$answer" == "y" ] || die "aborted" + if [[ -f "${PGDATA}/PG_VERSION" ]] ; then + eerror "The given directory \"${PGDATA}\" already contains a database cluster." + die "cluster already exists" + fi + [ -z "${PG_MAX_CONNECTIONS}" ] && PG_MAX_CONNECTIONS="128" einfo "Checking system parameters..." @@ -189,7 +184,7 @@ pkg_config() { fi if [ -z ${SKIP_SYSTEM_TESTS} ] ; then - einfo "Assuming that you want at least ${PG_MAX_CONNECTIONS} connections" + einfo "Checking whether your system supports at least ${PG_MAX_CONNECTIONS} connections..." local SEMMSL=$(sysctl -n kernel.sem | cut -f1) local SEMMNS=$(sysctl -n kernel.sem | cut -f2) @@ -205,9 +200,9 @@ pkg_config() { if [ $(eval echo \$$p) -lt $(eval echo \$${p}_MIN) ] ; then eerror "The value for ${p} $(eval echo \$$p) is below the recommended value $(eval echo \$${p}_MIN)" eerror "You have now several options:" - eerror " - Change the mentioned system parameter." + eerror " - Change the mentioned system parameter" eerror " - Lower the number of max.connections by setting PG_MAX_CONNECTIONS to a value lower than ${PG_MAX_CONNECTIONS}" - eerror " - Set SKIP_SYSTEM_TESTS in case you want to ignore this test" + eerror " - Set SKIP_SYSTEM_TESTS in case you want to ignore this test completely" eerror "More information can be found here:" eerror " http://www.postgresql.org/docs/${SLOT}/static/kernel-resources.html" die "system test failed" @@ -230,6 +225,11 @@ pkg_config() { einfo einfo "You can use the '${ROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL instead of 'pg_ctl'." einfo + + if [ "${PGDATA}" != "/var/lib/postgresql/${SLOT}/data" ] ; then + ewarn "You didn't install the database cluster in the standard location, please make sure that you set" + ewarn "PGDATA=\"${PGDATA}\" in the appropriate conf.d file (probably /etc/conf.d/postgresql-${SLOT})" + fi } src_test() { |