From: Ivan Udovichenko Date: Wed, 30 Mar 2016 22:43:26 +0000 (+0300) Subject: Replace directory with a link with the help of dpkg-maintscript-helper. Thank you... X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=ad9207be1654ecc8fabc96b6383d13d73799bf08;p=openstack-build%2Fhorizon-build.git Replace directory with a link with the help of dpkg-maintscript-helper. Thank you, zigo Rewritten-From: 714d74238bd1f0fd961fe71a940e4dde4a92c429 --- diff --git a/trusty/debian/changelog b/trusty/debian/changelog index 70c5c9e..8908436 100644 --- a/trusty/debian/changelog +++ b/trusty/debian/changelog @@ -8,14 +8,16 @@ horizon (2:9.0.0~rc1-2) UNRELEASED; urgency=medium * d/control: Add python-xstatic-magic-search dependency. Move memcached and openstack-dashboard-apache to Suggests field. * d/openstack-dashboard-apache.postinst: - - Remove /usr/share/openstack-dashboard/static directory and create a link - to /var/lib/openstack-dashboard/static directory to make it compatible with - Ubuntu OpenStack Puppet manifests. - Delete the .secret_ket_store file if exists. - Make www-data the owner of /var/lib/openstack-dashboard/secret-key and /var/lib/openstack-dashboard/static directories. - Set new alias to Horizon static files. - Call collectstatic with --clear and --noinput options. + * d/openstack-dashboard.{preinst,postinst,postrm}, + openstack-dashboard-apache.{preinst,postinst,postrm}: + - Remove /usr/share/openstack-dashboard/static directory and create a link + to /var/lib/openstack-dashboard/static directory to make it compatible with + Ubuntu OpenStack Puppet manifests. * d/rules: Do not copy/create additional files/links with/to static files. * d/openstack-dashboard.links: Remove all links except a link to /usr/bin/lessc binary. * d/debian/apache-sites-available/*.conf: diff --git a/trusty/debian/openstack-dashboard-apache.postinst b/trusty/debian/openstack-dashboard-apache.postinst index 691e007..561a2fb 100644 --- a/trusty/debian/openstack-dashboard-apache.postinst +++ b/trusty/debian/openstack-dashboard-apache.postinst @@ -2,6 +2,10 @@ set -e + +dpkg-maintscript-helper dir_to_symlink \ + /usr/share/openstack-dashboard/static /var/lib/openstack-dashboard/static -- "$@" + if [ "$1" = "configure" ] ; then . /usr/share/debconf/confmodule if ! [ -f /etc/default/openstack-dashboard-apache ] ; then @@ -42,10 +46,6 @@ HORIZON_USE_SSL=yes" >/etc/default/openstack-dashboard-apache a2dissite openstack-dashboard-alias-only.conf a2ensite openstack-dashboard.conf fi - if [ -d '/usr/share/openstack-dashboard/static' ] ; then - rm -rf /usr/share/openstack-dashboard/static - fi - ln -s /var/lib/openstack-dashboard/static /usr/share/openstack-dashboard/static /usr/share/openstack-dashboard/manage.py collectstatic --clear --noinput /usr/share/openstack-dashboard/manage.py compress --force if [ -f '/var/lib/openstack-dashboard/secret-key/.secret_key_store' ]; then @@ -72,10 +72,6 @@ HORIZON_USE_SSL=yes" >/etc/default/openstack-dashboard-apache a2dissite openstack-dashboard-ssl-redirect.conf a2dissite openstack-dashboard-ssl.conf a2dissite openstack-dashboard-alias-only.conf - if [ -d '/usr/share/openstack-dashboard/static' ] ; then - rm -rf /usr/share/openstack-dashboard/static - fi - ln -s /var/lib/openstack-dashboard/static /usr/share/openstack-dashboard/static /usr/share/openstack-dashboard/manage.py collectstatic --clear --noinput /usr/share/openstack-dashboard/manage.py compress --force if [ -f /var/lib/openstack-dashboard/secret-key/.secret_key_store ]; then diff --git a/trusty/debian/openstack-dashboard-apache.postrm b/trusty/debian/openstack-dashboard-apache.postrm index e3bebbf..8fbb792 100644 --- a/trusty/debian/openstack-dashboard-apache.postrm +++ b/trusty/debian/openstack-dashboard-apache.postrm @@ -2,6 +2,9 @@ set -e +dpkg-maintscript-helper dir_to_symlink \ + /usr/share/openstack-dashboard/static /var/lib/openstack-dashboard/static -- "$@" + if [ "${1}" = "purge" ] ; then if [ -f /etc/default/openstack-dashboard-apache ] ; then rm -rf /etc/default/openstack-dashboard-apache diff --git a/trusty/debian/openstack-dashboard-apache.preinst b/trusty/debian/openstack-dashboard-apache.preinst new file mode 100644 index 0000000..f253fa7 --- /dev/null +++ b/trusty/debian/openstack-dashboard-apache.preinst @@ -0,0 +1,8 @@ +#!/bin/sh + +set -e + +dpkg-maintscript-helper dir_to_symlink \ + /usr/share/openstack-dashboard/static /var/lib/openstack-dashboard/static -- "$@" + +#DEBHELPER# diff --git a/trusty/debian/openstack-dashboard.postinst b/trusty/debian/openstack-dashboard.postinst index 3bb4e8a..db9f640 100644 --- a/trusty/debian/openstack-dashboard.postinst +++ b/trusty/debian/openstack-dashboard.postinst @@ -2,6 +2,9 @@ set -e +dpkg-maintscript-helper dir_to_symlink \ + /usr/share/openstack-dashboard/static /var/lib/openstack-dashboard/static -- "$@" + if [ "$1" = "configure" ] ; then adduser --system \ --home /var/lib/horizon \ @@ -17,11 +20,6 @@ if [ "$1" = "configure" ] ; then cp /usr/share/openstack-dashboard/local_settings.py /etc/openstack-dashboard/local_settings.py fi - if [ -d '/usr/share/openstack-dashboard/static' ] ; then - rm -rf /usr/share/openstack-dashboard/static - fi - ln -s /var/lib/openstack-dashboard/static /usr/share/openstack-dashboard/static - # Compress the JS and CSS with python-compressor and python-lesscpy /usr/share/openstack-dashboard/manage.py collectstatic --clear --noinput /usr/share/openstack-dashboard/manage.py compress --force diff --git a/trusty/debian/openstack-dashboard.postrm b/trusty/debian/openstack-dashboard.postrm index d24be77..41afedc 100644 --- a/trusty/debian/openstack-dashboard.postrm +++ b/trusty/debian/openstack-dashboard.postrm @@ -2,6 +2,9 @@ set -e +dpkg-maintscript-helper dir_to_symlink \ + /usr/share/openstack-dashboard/static /var/lib/openstack-dashboard/static -- "$@" + if [ "${1}" = "purge" ] ; then rm -f /etc/openstack-dashboard/local_settings.py rmdir --ignore-fail-on-non-empty /etc/openstack-dashboard || true diff --git a/trusty/debian/openstack-dashboard.preinst b/trusty/debian/openstack-dashboard.preinst new file mode 100644 index 0000000..f253fa7 --- /dev/null +++ b/trusty/debian/openstack-dashboard.preinst @@ -0,0 +1,8 @@ +#!/bin/sh + +set -e + +dpkg-maintscript-helper dir_to_symlink \ + /usr/share/openstack-dashboard/static /var/lib/openstack-dashboard/static -- "$@" + +#DEBHELPER#