]> git.pld-linux.org Git - projects/template-specs.git/commitdiff
- and triggers evolve... more complicated
authorElan Ruusamäe <glen@pld-linux.org>
Wed, 7 Dec 2005 22:03:18 +0000 (22:03 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    webapp.spec -> 1.33

webapp.spec

index fdd374cce947b98766cbcdb707f883efef19c9e9..07b622da36a44b8ddc25b8cd213b4329b48e6851 100644 (file)
@@ -84,6 +84,7 @@ done
 # nuke very-old config location (this mostly for Ra)
 if [ -f /etc/httpd/httpd.conf ]; then
        sed -i -e "/^Include.*%{name}.conf/d" /etc/httpd/httpd.conf
+       /usr/sbin/webapp register httpd %{_webapp}
        httpd_reload=1
 fi
 
@@ -91,6 +92,7 @@ fi
 if [ -f /etc/httpd/%{name}.conf.rpmsave ]; then
        cp -f %{_sysconfdir}/httpd.conf{,.rpmnew}
        mv -f /etc/httpd/%{name}.conf.rpmsave %{_sysconfdir}/httpd.conf
+       /usr/sbin/webapp register httpd %{_webapp}
        httpd_reload=1
 fi
 
@@ -122,30 +124,28 @@ if [ -f /etc/apache-%{name}.conf.rpmsave ]; then
        rm -f /etc/apache-%{name}.conf.rpmsave
 fi
 
-# place new config location, as trigger puts config only on first install, do it here.
-# apache1
-if [ -d /etc/apache/webapps.d ]; then
-       /usr/sbin/webapp register apache %{_webapp}
-       apache_reload=1
-fi
-# apache2
-if [ -d /etc/httpd/webapps.d ]; then
-       /usr/sbin/webapp register httpd %{_webapp}
-       httpd_reload=1
-fi
-# or if we're migrating from %apache_install macros we can depend on symlinks in conf.d/http.conf dirs
-# place new config location, as trigger puts config only on first install, do it here.
-# apache1
-if [ -L /etc/apache/conf.d/99_%{name}.conf ]; then
-       rm -f /etc/apache/conf.d/99_%{name}.conf
-       /usr/sbin/webapp register apache %{_webapp}
-       apache_reload=1
-fi
-# apache2
-if [ -L /etc/httpd/httpd.conf/99_%{name}.conf ]; then
-       rm -f /etc/httpd/httpd.conf/99_%{name}.conf
-       /usr/sbin/webapp register httpd %{_webapp}
-       httpd_reload=1
+# migrating from earlier apache-config?
+if [ -L /etc/apache/conf.d/99_%{name}.conf ] || [ -L /etc/httpd/httpd.conf/99_%{name}.conf ]; then
+       if [ -L /etc/apache/conf.d/99_%{name}.conf ]; then
+               rm -f /etc/apache/conf.d/99_%{name}.conf
+               /usr/sbin/webapp register apache %{_webapp}
+               apache_reload=1
+       fi
+       if [ -L /etc/httpd/httpd.conf/99_%{name}.conf ]; then
+               rm -f /etc/httpd/httpd.conf/99_%{name}.conf
+               /usr/sbin/webapp register httpd %{_webapp}
+               httpd_reload=1
+       fi
+else
+       # no earlier registration. assume migration from Ra
+       if [ -d /etc/apache/webapps.d ]; then
+               /usr/sbin/webapp register apache %{_webapp}
+               apache_reload=1
+       fi
+       if [ -d /etc/httpd/webapps.d ]; then
+               /usr/sbin/webapp register httpd %{_webapp}
+               httpd_reload=1
+       fi
 fi
 
 if [ "$httpd_reload" ]; then
This page took 0.03883 seconds and 4 git commands to generate.