]> review.fuel-infra Code Review - openstack-build/horizon-build.git/commitdiff
Replace directory with a link with the help of dpkg-maintscript-helper. Thank you...
authorIvan Udovichenko <iudovichenko@mirantis.com>
Wed, 30 Mar 2016 22:43:26 +0000 (01:43 +0300)
committerIvan Udovichenko <iudovichenko@mirantis.com>
Wed, 30 Mar 2016 23:36:50 +0000 (02:36 +0300)
Rewritten-From: 714d74238bd1f0fd961fe71a940e4dde4a92c429

trusty/debian/changelog
trusty/debian/openstack-dashboard-apache.postinst
trusty/debian/openstack-dashboard-apache.postrm
trusty/debian/openstack-dashboard-apache.preinst [new file with mode: 0644]
trusty/debian/openstack-dashboard.postinst
trusty/debian/openstack-dashboard.postrm
trusty/debian/openstack-dashboard.preinst [new file with mode: 0644]

index 70c5c9e358fb08fff7a992211f401fe64033015d..8908436697d604b870356a6037d2fbe27437be8a 100644 (file)
@@ -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:
index 691e0077b3e9ecbabc6c4023834a46e2fc17c7c2..561a2fb89fa6b1cc087324162bc6bf4aae1e5275 100644 (file)
@@ -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
index e3bebbf248a717a8e84b109afe96a8c4421e8e04..8fbb792aaed7f6463e91a4192bd085ef4a8345ff 100644 (file)
@@ -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 (file)
index 0000000..f253fa7
--- /dev/null
@@ -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#
index 3bb4e8a143dd43e9c71bfeb09afe29799a42290b..db9f6409faa5e9785aa4ca443ba6629614cc6ae8 100644 (file)
@@ -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
index d24be7748036876c270a8bbd5bc6bd1e6aa97416..41afedc47daf1b8b2c42d7c46993b001c8264642 100644 (file)
@@ -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 (file)
index 0000000..f253fa7
--- /dev/null
@@ -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#