[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: no login to lwat: Smarty error...



Holger Levsen skrev:
> 
> Thanks! Does that also fix the problems, we have seen on the mailinglist, 
> which happened for upgrades or is there then manual work still needed?
> 
> 
> regards,
> 	Holger

I've now tested the diff, unfortunately it had a few errors. I've
prepared a new diff which is actually tested.
(I tested it by breaking the smarty vars in config.php, updating
/usr/share/lwat/config.md5sum and then installing the patched package).

This should fix the problem as long as the user hasn't manually edited
config.php.
Index: debian/dummy-config.php
===================================================================
--- debian/dummy-config.php	(revisjon 802)
+++ debian/dummy-config.php	(revisjon 803)
@@ -2,7 +2,7 @@
 # This file is generated by the postinst script of lwat
 # If you change anything in this file but wants dpkg to install 
 # the new config.php on its own, please do a:
-#   md5sum /etc/lwat/config.php > /var/cache/lwat/config.md5sum
+#   md5sum /etc/lwat/config.php > /usr/share/lwat/config.md5sum
 # If you won't do that, the postinst script will create a config.php.dpkg-dist 
 # with the original settings.
 
Index: debian/config
===================================================================
--- debian/config	(revisjon 802)
+++ debian/config	(revisjon 803)
@@ -7,10 +7,10 @@
 db_input high lwat/domain || true
 db_go
 
-db_input medium shared/ldapns/ldap-server || true
+db_input high shared/ldapns/ldap-server || true
 db_go
 
-db_input medium shared/ldapns/base-dn || true
+db_input high shared/ldapns/base-dn || true
 db_go
 
 db_input medium lwat/homedirlocation || true
Index: debian/postinst
===================================================================
--- debian/postinst	(revisjon 803)
+++ debian/postinst	(revisjon 804)
@@ -91,7 +91,17 @@
 db_get lwat/allowPwSet
 if [ ! -z "$RET" ]; then
        sed -e "s/^\([[:space:]]*\)\$allowPwSet[[:space:]]*=[[:space:]]*ALLOWPWSET/\1\$allowPwSet = $RET ;/" -i $config
-fi 
+fi
+#Fix in order to correct settings by previous version of lwat which are now completly incompatible.
+db_get lwat/incompatiblesettings
+if [ ! -z "$RET" ] && [ "$RET" = "true" ]; then
+       sed -e "s/^\([[:space:]]*\)\$smarty_templ[[:space:]]*=.*/\1\$smarty_templ= \"\/usr\/share\/lwat\/templates\" ;/" -i /etc/lwat/config.php
+       sed -e "s/^\([[:space:]]*\)\$smarty_compile[[:space:]]*=.*/\1\$smarty_compile= \"\/var\/spool\/lwat\" ;/" -i /etc/lwat/config.php
+       if [ -f "/etc/lwat/config.php.dpkg-dist" ]; then
+                sed -e "s/^\([[:space:]]*\)\$smarty_templ[[:space:]]*=.*/\1\$smarty_templ= \"\/usr\/share\/lwat\/templates\" ;/" -i /etc/lwat/config.php.dpkg-dist
+                sed -e "s/^\([[:space:]]*\)\$smarty_compile[[:space:]]*=.*/\1\$smarty_compile= \"\/var\/spool\/lwat\" ;/" -i /etc/lwat/config.php.dpkg-dist
+       fi
+fi
 
 if [ "$config" = "/etc/lwat/config.php" ]; then
         md5sum /etc/lwat/config.php > /usr/share/lwat/config.md5sum;
Index: debian/config
===================================================================
--- debian/config	(revisjon 803)
+++ debian/config	(revisjon 804)
@@ -49,3 +49,5 @@
 db_input high lwat/templates || true
 db_go
 
+db_input high lwat/incompatiblesettings || true
+db_go
Index: debian/templates
===================================================================
--- debian/templates	(revisjon 803)
+++ debian/templates	(revisjon 804)
@@ -121,3 +121,11 @@
  Lwat uses templates for creating user accounts, to make sure that
  home directories are placed in the right locations, users
  are member of the correct groups, etc.
+
+Template: lwat/incompatiblesettings
+Type: boolean
+Default: true
+_Description: Rewrite smarty template and compile dir?
+ lwat 0.17 is incompatible with some values set in older configuration files. 
+ So for a correct usage of lwat you'll have to fix these settings. The package will
+ fix this for you if you enter yes here.

Reply to: