Bug#603427: probable fix for rc bug #603427

2010-12-09 Thread Alexander Reichle-Schmehl
Hi!

* Jan Wagner w...@cyconet.org [101121 12:58]:

 i was going through your hints and did modify the package to not introduce a 
 new pre-depend and not using debconf to migrate the configuration and did 
 some 
 other improvements ... here comes the diff against the package in squeeze and 
 a summarization:

As jcristeau mentioned, you didn't had the time reviewing this patch, I
gave it a shot yesterday evening and today morning and reviewed the
proposed patch.

While surely not being small, it addresses the core issue of the
problem, and is as elegant as possible.  I guess, if I would have needed
to address this issue, I would have done it similar.

I also tested various upgrad szenarios to verify, that the patch solves
the issue.  And didnt found any problems; all problems I could think of
during upgrades seem to be addressed.


Hope that helps,
  Alexander



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#603427: probable fix for rc bug #603427

2010-12-09 Thread Jan Wagner
retitle 603427 unblock: ipplan/4.92a-2
thanks

On Thursday 09 December 2010 11:10:09 Alexander Reichle-Schmehl wrote:
 While surely not being small, it addresses the core issue of the
 problem, and is as elegant as possible.  I guess, if I would have needed
 to address this issue, I would have done it similar.
 
 I also tested various upgrad szenarios to verify, that the patch solves
 the issue.  And didnt found any problems; all problems I could think of
 during upgrades seem to be addressed.

I uploaded the package some minutes ago, please unblock it.

  * Implement proper configuration handling (Closes: #603427)
- Add ucf to Depends
- Write database settings from old config file into /etc/ipplan/db.php
- Register /etc/ipplan/db.php via ucf in postinst
- Deregister /etc/ipplan/db.php via ucf and remove variants in postrm on
  purge
- Migrate /etc/ipplan/config.php to /etc/ipplan/local_conf.php, if user
  has modified the file
- Adjust README.Debian related to our new way to configure ipplan
  * Add 11_user_config.dpatch to patch shipped config to also read our config
files
  * Add 05_fix_config_syntax.dpatch to fix broken default config
  * Only call postinst and config if we install the package or on
dpkg-reconfigure
  * Copy template of local_conf.php to /etc/ipplan/ via postinst if there 
isn't
one yet
  * Remove /etc/ipplan/local_conf.php on purge

 -- Jan Wagner w...@cyconet.org  Thu, 09 Dec 2010 11:56:13 +0100

Thanks in advance.

unblock: ipplan/4.92a-2

-- 
Never write mail to w...@spamfalle.info, you have been warned!
-BEGIN GEEK CODE BLOCK-
Version: 3.12
GIT d-- s+: a C+++ UL P+ L+++ E--- W+++ N+++ o++ K++ w--- O M V- PS PE Y++
PGP++ t-- 5 X R tv- b+ DI D+ G++ e++ h r+++ y 
--END GEEK CODE BLOCK--


signature.asc
Description: This is a digitally signed message part.


Bug#603427: probable fix for rc bug #603427

2010-11-23 Thread Jan Wagner
Dear Release Team,

On Sunday, 21. November 2010, Jan Wagner wrote:
 On Saturday, 20. November 2010, Jan Wagner wrote:
  i did work on a fix for rc bug  #603427[1], but before uploading i would
  like to get some feedback from you, if that would be sufficient, as it
  isn't a small fix.
 
 i was going through your hints and did modify the package to not introduce
 a new pre-depend and not using debconf to migrate the configuration and
 did some other improvements ... here comes the diff against the package in
 squeeze and a summarization:

if you think that is a sufficient fix for you, I would like to upload the 
changes to unstable to close the outstanding rc bug.

Many thank, Jan.
-- 
Never write mail to w...@spamfalle.info, you have been warned!
-BEGIN GEEK CODE BLOCK-
Version: 3.12
GIT d-- s+: a C+++ UL P+ L+++ E--- W+++ N+++ o++ K++ w--- O M V- PS PE Y++
PGP++ t-- 5 X R tv- b+ DI D+ G++ e++ h r+++ y 
--END GEEK CODE BLOCK--


signature.asc
Description: This is a digitally signed message part.


Bug#603427: probable fix for rc bug #603427

2010-11-21 Thread Jan Wagner
hi again,

On Saturday, 20. November 2010, Jan Wagner wrote:
 i did work on a fix for rc bug  #603427[1], but before uploading i would
 like to get some feedback from you, if that would be sufficient, as it
 isn't a small fix.

i was going through your hints and did modify the package to not introduce a 
new pre-depend and not using debconf to migrate the configuration and did some 
other improvements ... here comes the diff against the package in squeeze and 
a summarization:

changelog:

ipplan (4.92a-2) unstable; urgency=low

  * Implement proper configuration handling (Closes: #603427)
- Add ucf to Depends
- Write database settings from old config file into /etc/ipplan/db.php
- Register /etc/ipplan/db.php via ucf in postinst
- Deregister /etc/ipplan/db.php via ucf and remove variants in postrm on
  purge
- Migrate /etc/ipplan/config.php to /etc/ipplan/local_conf.php, if user
  has modified the file
- Adjust README.Debian related to our new way to configure ipplan
  * Add 11_user_config.dpatch to patch shipped config to also read our config
files
  * Add 05_fix_config_syntax.dpatch to fix broken default config
  * Only call postinst and config if we install the package or on
dpkg-reconfigure
  * Copy template of local_conf.php to /etc/ipplan/ via postinst if there 
isn't
one yet
  * Remove /etc/ipplan/local_conf.php on purge

 -- Jan Wagner w...@cyconet.org  Tue, 16 Nov 2010 21:00:25 +0100

diffstat:

 README.Debian   |   15 ++---
 changelog   |   22 +++
 config  |   18 +++---
 control |2 
 dirs|2 
 local_conf.php  |4 +
 patches/00list  |2 
 patches/05_fix_config_syntax.dpatch |   18 ++
 patches/11_user_config.dpatch   |   16 +
 postinst|   76 ++-
 postrm  |   35 +---
 preinst |  100 

 rules   |   18 +++---
 13 files changed, 268 insertions(+), 60 deletions(-)

Many thanks, Jan.
-- 
Never write mail to w...@spamfalle.info, you have been warned!
-BEGIN GEEK CODE BLOCK-
Version: 3.12
GIT d-- s+: a C+++ UL P+ L+++ E--- W+++ N+++ o++ K++ w--- O M V- PS PE Y++
PGP++ t-- 5 X R tv- b+ DI D+ G++ e++ h r+++ y 
--END GEEK CODE BLOCK--
Index: debian/control
===
--- debian/control	(revision 2130)
+++ debian/control	(revision 2275)
@@ -10,7 +10,7 @@
 
 Package: ipplan
 Architecture: all
-Depends: ${misc:Depends}, apache2 | httpd, php5 | php5-cgi | libapache2-mod-php5 | libapache-mod-php5 | php4 | php4-cgi | libapache2-mod-php4 | libapache-mod-php4, debconf (= 0.2.26) | debconf-2.0, mysql-client | postgresql-client, wwwconfig-common, php5-mysql | php4-mysql | php5-pgsql | php4-pgsql, libphp-adodb, libphp-phplayersmenu, libphp-phpmailer
+Depends: ${misc:Depends}, apache2 | httpd, php5 | php5-cgi | libapache2-mod-php5 | libapache-mod-php5 | php4 | php4-cgi | libapache2-mod-php4 | libapache-mod-php4, debconf (= 0.2.26) | debconf-2.0, mysql-client | postgresql-client, wwwconfig-common, php5-mysql | php4-mysql | php5-pgsql | php4-pgsql, libphp-adodb, libphp-phplayersmenu, libphp-phpmailer, ucf (= 2.0020)
 Recommends: mysql-server, postgresql, php5-snmp | php4-snmp
 Suggests: nmap
 Description: web-based IP address manager and tracker
Index: debian/postinst
===
--- debian/postinst	(revision 2130)
+++ debian/postinst	(revision 2275)
@@ -2,11 +2,14 @@
 
 set -e
 
+MCONFDIR=/usr/share/ipplan/mconf/
+
+# only if we install the package and on dpkg-reconfigure
+if [ ${DEBCONF_RECONFIGURE} = 1 ]  || [ $1 = configure ]  [ -z $2 ]; then
+
 . /usr/share/debconf/confmodule
 db_version 2.0 || [ $? -lt 30 ]
 
-if [ $1 = configure ]; then
-
 db_get ipplan/webserver_type
 webservers=$RET
 restart=
@@ -64,42 +67,42 @@
 	. /usr/share/wwwconfig-common/mysql-createdb.sh
 	# create user
 	. /usr/share/wwwconfig-common/mysql-createuser.sh
-fi
 
-db_stop
+	# write database options into config
+	echo ?php  $MCONFDIR/db.php
+	echo // Please don't edit this file, use local_conf.php to overwrite  $MCONFDIR/db.php
+	echo // You can change this settings with 'dpkg-reconfigure -plow ipplan'.  $MCONFDIR/db.php
+	echo defined(\DBF_TYPE\)|| define(\DBF_TYPE\, 'mysql');  $MCONFDIR/db.php
+	echo defined(\DBF_HOST\)|| define(\DBF_HOST\, '$dbserver');  $MCONFDIR/db.php
+	echo defined(\DBF_USER\)|| define(\DBF_USER\, '$dbuser');  $MCONFDIR/db.php
+	echo defined(\DBF_NAME\)|| define(\DBF_NAME\, '$dbname');  $MCONFDIR/db.php
+	echo defined(\DBF_PASSWORD\)|| define(\DBF_PASSWORD\, '$dbpass');  $MCONFDIR/db.php
+	echo ?  $MCONFDIR/db.php
 
-# write database options 

Bug#603427: probable fix for rc bug #603427

2010-11-20 Thread Jan Wagner
hi there,

i did work on a fix for rc bug  #603427[1], but before uploading i would like 
to get some feedback from you, if that would be sufficient, as it isn't a 
small fix.

changelog:

ipplan (4.92a-2) unstable; urgency=low

  * Implement proper configuration handling (Closes: #603427)
- Add ucf to Pre-Depends
- Move 'debconf (= 0.2.26) | debconf-2.0' to Pre-Depends
- Write database settings collected via debconf into /etc/ipplan/db.php
- Register /etc/ipplan/db.php via ucf in postinst
- Deregister /etc/ipplan/db.php via ucf and remove variants in postrm on
  purge
- Migrate /etc/ipplan/config.php to /etc/ipplan/local_conf.php, if user
  has modified the file
- Adjust README.Debian related to our new way to configure ipplan
  * Add 11_user_config.dpatch to patch shipped config to also read our config
files
  * Add 05_fix_config_syntax.dpatch to fix broken default config
  * Only call postinst and config if we install the package or on
dpkg-reconfigure

 -- Jan Wagner w...@cyconet.org  Tue, 16 Nov 2010 21:00:25 +0100

diffstat:

 README.Debian   |   15 +++---
 changelog   |   20 
 config  |   18 ---
 control |3 -
 dirs|2 
 local_conf.php  |4 +
 patches/00list  |2 
 patches/05_fix_config_syntax.dpatch |   18 +++
 patches/11_user_config.dpatch   |   16 ++
 postinst|   68 ++---
 postrm  |   17 +++
 preinst |   84 

 rules   |   17 +++
 13 files changed, 233 insertions(+), 51 deletions(-)

many thanks, jan.
[1] http://bugs.debian.org/603427
-- 
Never write mail to w...@spamfalle.info, you have been warned!
-BEGIN GEEK CODE BLOCK-
Version: 3.12
GIT d-- s+: a C+++ UL P+ L+++ E--- W+++ N+++ o++ K++ w--- O M V- PS PE Y++
PGP++ t-- 5 X R tv- b+ DI D+ G++ e++ h r+++ y 
--END GEEK CODE BLOCK--
Index: control
===
--- control	(revision 2130)
+++ control	(revision 2268)
@@ -10,7 +10,8 @@
 
 Package: ipplan
 Architecture: all
-Depends: ${misc:Depends}, apache2 | httpd, php5 | php5-cgi | libapache2-mod-php5 | libapache-mod-php5 | php4 | php4-cgi | libapache2-mod-php4 | libapache-mod-php4, debconf (= 0.2.26) | debconf-2.0, mysql-client | postgresql-client, wwwconfig-common, php5-mysql | php4-mysql | php5-pgsql | php4-pgsql, libphp-adodb, libphp-phplayersmenu, libphp-phpmailer
+Pre-Depends: ucf (= 2.0020), debconf (= 0.2.26) | debconf-2.0
+Depends: ${misc:Depends}, apache2 | httpd, php5 | php5-cgi | libapache2-mod-php5 | libapache-mod-php5 | php4 | php4-cgi | libapache2-mod-php4 | libapache-mod-php4, mysql-client | postgresql-client, wwwconfig-common, php5-mysql | php4-mysql | php5-pgsql | php4-pgsql, libphp-adodb, libphp-phplayersmenu, libphp-phpmailer
 Recommends: mysql-server, postgresql, php5-snmp | php4-snmp
 Suggests: nmap
 Description: web-based IP address manager and tracker
Index: postinst
===
--- postinst	(revision 2130)
+++ postinst	(revision 2268)
@@ -2,11 +2,14 @@
 
 set -e
 
+MCONFDIR=/usr/share/ipplan/mconf/
+
+# only if we install the package and on dpkg-reconfigure
+if [ ${DEBCONF_RECONFIGURE} = 1 ]  || [ $1 = configure ]  [ -z $2 ]; then
+
 . /usr/share/debconf/confmodule
 db_version 2.0 || [ $? -lt 30 ]
 
-if [ $1 = configure ]; then
-
 db_get ipplan/webserver_type
 webservers=$RET
 restart=
@@ -64,36 +67,31 @@
 	. /usr/share/wwwconfig-common/mysql-createdb.sh
 	# create user
 	. /usr/share/wwwconfig-common/mysql-createuser.sh
-fi
 
-db_stop
+	# write database options into config
+	echo ?php  $MCONFDIR/db.php
+	echo // Please don't edit this file, use local_conf.php to overwrite  $MCONFDIR/db.php
+	echo // You can change this settings with 'dpkg-reconfigure -plow ipplan'.  $MCONFDIR/db.php
+	echo defined(\DBF_TYPE\)|| define(\DBF_TYPE\, 'mysql');  $MCONFDIR/db.php
+	echo defined(\DBF_HOST\)|| define(\DBF_HOST\, '$dbserver');  $MCONFDIR/db.php
+	echo defined(\DBF_USER\)|| define(\DBF_USER\, '$dbuser');  $MCONFDIR/db.php
+	echo defined(\DBF_NAME\)|| define(\DBF_NAME\, '$dbname');  $MCONFDIR/db.php
+	echo defined(\DBF_PASSWORD\)|| define(\DBF_PASSWORD\, '$dbpass');  $MCONFDIR/db.php
+	echo ?  $MCONFDIR/db.php
 
-# write database options into config
-if [ -e /etc/ipplan/config.php ]; then
-	sed -i -e \
-	
-	s/\(\.*\DBF_TYPE\[^'\]*['\]\)[^'\]*\(['\].*\)/\1mysql\2/;
-	s/\(\.*\DBF_HOST\[^'\]*['\]\)[^'\]*\(['\].*\)/\1$dbserver\2/;
-	s/\(\.*\DBF_USER\[^'\]*['\]\)[^'\]*\(['\].*\)/\1$dbuser\2/;
-	s/\(\.*\DBF_NAME\[^'\]*['\]\)[^'\]*\(['\].*\)/\1$dbname\2/;
-