summaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-support
diff options
context:
space:
mode:
authorMark Asselstine <mark.asselstine@windriver.com>2014-04-22 21:22:25 -0400
committerBruce Ashfield <bruce.ashfield@windriver.com>2014-04-23 23:36:03 -0400
commit0ae7fe2223c6aca2e6ab0a71946ef59a2de2472c (patch)
tree8d9e89b79f4c2d4765ef9ebeeed454210686227e /meta-openstack/recipes-support
parent21fd86369df53482e53e8440e3d5f520d305736a (diff)
downloadmeta-cloud-services-0ae7fe2223c6aca2e6ab0a71946ef59a2de2472c.tar.gz
cleanup: leave source config files pristine
Editing the files in ${WORKDIR} using sed or similar tools as part of do_install means they can only be edited once. Supplying a modified CONTROLLER_IP in local.conf and building the image again will not result in the CONTROLLER_IP being properly updated since the substitution placeholders will no longer exist. We therefore simply swap the other of things, installing the configuration files first, then editing them to swap the placeholders. This means we can run the do_install again and again and get the results we expect. Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'meta-openstack/recipes-support')
-rw-r--r--meta-openstack/recipes-support/postgresql/postgresql_9.2.4.bbappend22
1 files changed, 11 insertions, 11 deletions
diff --git a/meta-openstack/recipes-support/postgresql/postgresql_9.2.4.bbappend b/meta-openstack/recipes-support/postgresql/postgresql_9.2.4.bbappend
index 80bfe1e..66a12fa 100644
--- a/meta-openstack/recipes-support/postgresql/postgresql_9.2.4.bbappend
+++ b/meta-openstack/recipes-support/postgresql/postgresql_9.2.4.bbappend
@@ -10,23 +10,23 @@ inherit useradd update-rc.d identity hosts
10DB_DATADIR ?= "/var/lib/postgres/data" 10DB_DATADIR ?= "/var/lib/postgres/data"
11 11
12do_install_append() { 12do_install_append() {
13 sed -e "s:%DB_DATADIR%:${DB_DATADIR}:g" -i ${WORKDIR}/postgresql 13 INIT_D_DEST_DIR=${D}${sysconfdir}/init.d
14 sed -e "s:%DB_DATADIR%:${DB_DATADIR}:g" -i ${WORKDIR}/postgresql-init
15 14
16 install -d ${D}${sysconfdir}/init.d/ 15 install -d ${D}${sysconfdir}/init.d/
17 install -m 0755 ${WORKDIR}/postgresql ${D}${sysconfdir}/init.d/postgresql 16 install -m 0755 ${WORKDIR}/postgresql ${INIT_D_DEST_DIR}/postgresql
17 install -m 0755 ${WORKDIR}/postgresql-init ${INIT_D_DEST_DIR}/postgresql-init
18 18
19 sed -e "s:%DB_USER%:${DB_USER}:g" -i ${WORKDIR}/postgresql-init 19 sed -e "s:%DB_DATADIR%:${DB_DATADIR}:g" -i ${INIT_D_DEST_DIR}/postgresql
20 sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" -i ${WORKDIR}/postgresql-init 20 sed -e "s:%DB_DATADIR%:${DB_DATADIR}:g" -i ${INIT_D_DEST_DIR}/postgresql-init
21 21
22 sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${WORKDIR}/postgresql-init 22 sed -e "s:%DB_USER%:${DB_USER}:g" -i ${INIT_D_DEST_DIR}/postgresql-init
23 sed -e "s:%CONTROLLER_HOST%:${CONTROLLER_HOST}:g" -i ${WORKDIR}/postgresql-init 23 sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" -i ${INIT_D_DEST_DIR}/postgresql-init
24 24
25 sed -e "s:%COMPUTE_IP%:${COMPUTE_IP}:g" -i ${WORKDIR}/postgresql-init 25 sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${INIT_D_DEST_DIR}/postgresql-init
26 sed -e "s:%COMPUTE_HOST%:${COMPUTE_HOST}:g" -i ${WORKDIR}/postgresql-init 26 sed -e "s:%CONTROLLER_HOST%:${CONTROLLER_HOST}:g" -i ${INIT_D_DEST_DIR}/postgresql-init
27
28 install -m 0755 ${WORKDIR}/postgresql-init ${D}${sysconfdir}/init.d/postgresql-init
29 27
28 sed -e "s:%COMPUTE_IP%:${COMPUTE_IP}:g" -i ${INIT_D_DEST_DIR}/postgresql-init
29 sed -e "s:%COMPUTE_HOST%:${COMPUTE_HOST}:g" -i ${INIT_D_DEST_DIR}/postgresql-init
30} 30}
31 31
32RDEPENDS_${PN} += "postgresql-timezone eglibc-utils update-rc.d" 32RDEPENDS_${PN} += "postgresql-timezone eglibc-utils update-rc.d"