tags 360690 + patch fixed
thanks

Hello,

Attached is the diff for  my webcalendar 1.0.2-2.1 NMU. Thanks to Julien
Danjou, Raphaƫl Hertzog and Gustavo Franco for their help.

Regards,
Arnaud Fontaine

diff -urN webcalendar-1.0.2.old/debian/changelog webcalendar-1.0.2/debian/changelog
--- webcalendar-1.0.2.old/debian/changelog	2006-04-20 17:34:12.000000000 +0200
+++ webcalendar-1.0.2/debian/changelog	2006-04-20 22:08:45.000000000 +0200
@@ -1,3 +1,13 @@
+webcalendar (1.0.2-2.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Fix debian/webcalendar.postinst and debian/webcalendar.config.
+    Rename settings.conf to settings.php. Remove useless
+    debian/tools. Closes: #360690.
+  * Fix docs link (debian/webcalendar.links).
+
+ -- Arnaud Fontaine <[EMAIL PROTECTED]>  Thu, 20 Apr 2006 15:40:12 +0200
+
 webcalendar (1.0.2-2) unstable; urgency=low
 
 
diff -urN webcalendar-1.0.2.old/debian/install webcalendar-1.0.2/debian/install
--- webcalendar-1.0.2.old/debian/install	2006-04-20 17:34:12.000000000 +0200
+++ webcalendar-1.0.2/debian/install	2006-04-20 21:27:38.000000000 +0200
@@ -2,8 +2,7 @@
 tables-postgres.sql usr/share/dbconfig-common/data/webcalendar/install/pgsql
 debian/sql/upgrade-mysql/1.0.2-1 usr/share/dbconfig-common/data/webcalendar/upgrade/mysql
 debian/sql/upgrade-pgsql/1.0.2-1 usr/share/dbconfig-common/data/webcalendar/upgrade/pgsql
-debian/settings.conf usr/share/webcalendar/tools
-debian/tools/dbconfig_oldconf.sh usr/share/webcalendar/tools
+debian/settings.php usr/share/webcalendar/tools
 apache.conf etc/webcalendar
 includes/print_styles.css etc/webcalendar
 includes/site_extras.php etc/webcalendar
diff -urN webcalendar-1.0.2.old/debian/patches/00list webcalendar-1.0.2/debian/patches/00list
--- webcalendar-1.0.2.old/debian/patches/00list	2006-04-20 17:34:12.000000000 +0200
+++ webcalendar-1.0.2/debian/patches/00list	2006-04-20 22:01:53.000000000 +0200
@@ -1 +1,2 @@
 01_config_patch
+01_pgsql_patch
diff -urN webcalendar-1.0.2.old/debian/patches/01_config_patch.dpatch webcalendar-1.0.2/debian/patches/01_config_patch.dpatch
--- webcalendar-1.0.2.old/debian/patches/01_config_patch.dpatch	2006-04-20 17:34:12.000000000 +0200
+++ webcalendar-1.0.2/debian/patches/01_config_patch.dpatch	2006-04-20 21:59:36.000000000 +0200
@@ -62,7 +62,7 @@
 -      "Please copy settings.php.orig to settings.php and modify for your " .
 -      "site.\n" );
 -  }
-+$WC_CONFIG_FILE = "/etc/webcalendar/settings.conf";
++$WC_CONFIG_FILE = "/etc/webcalendar/settings.php";
 +$WC_ALT_FILE = $_ENV['WEBCALENDAR_CONFIG_FILE'];
 +if (!empty($WC_ALT_FILE) && file_exists($WC_ALT_FILE) &&
 +        is_readable($WC_ALT_FILE)) {
diff -urN webcalendar-1.0.2.old/debian/patches/01_pgsql_patch.dpatch webcalendar-1.0.2/debian/patches/01_pgsql_patch.dpatch
--- webcalendar-1.0.2.old/debian/patches/01_pgsql_patch.dpatch	1970-01-01 01:00:00.000000000 +0100
+++ webcalendar-1.0.2/debian/patches/01_pgsql_patch.dpatch	2006-04-20 21:53:01.000000000 +0200
@@ -0,0 +1,139 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 01_config_patch.dpatch by  <[EMAIL PROTECTED]>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
[EMAIL PROTECTED]@
+diff -urN webcalendar-1.0.2.old/docs/WebCalendar-SysAdmin.html webcalendar-1.0.2/docs/WebCalendar-SysAdmin.html
+--- webcalendar-1.0.2.old/docs/WebCalendar-SysAdmin.html	2006-04-20 21:45:57.000000000 +0200
++++ webcalendar-1.0.2/docs/WebCalendar-SysAdmin.html	2006-04-20 21:43:48.000000000 +0200
+@@ -400,7 +400,7 @@
+   <tr><td>
+    db_type</td>
+   <td>
+-   One of "mysql", "oracle", "postgresql", "odbc",
++   One of "mysql", "oracle", "pgsql", "odbc",
+    &quot;mssql&quot;,
+    or "ibase"
+   </td>
+diff -urN webcalendar-1.0.2.old/includes/php-dbi.php webcalendar-1.0.2/includes/php-dbi.php
+--- webcalendar-1.0.2.old/includes/php-dbi.php	2006-04-20 21:45:57.000000000 +0200
++++ webcalendar-1.0.2/includes/php-dbi.php	2006-04-20 21:43:14.000000000 +0200
+@@ -139,7 +139,7 @@
+       $c = OCIPLogon ( $login, $password, $database );
+     $GLOBALS["oracle_connection"] = $c;
+     return $c;
+-  } else if ( strcmp ( $GLOBALS["db_type"], "postgresql" ) == 0 ) {
++  } else if ( strcmp ( $GLOBALS["db_type"], "pgsql" ) == 0 ) {
+     if ( strlen ( $password ) ) {
+       if ( strlen ( $host ) ) {
+         $dbargs = "host=$host dbname=$database user=$login password=$password";
+@@ -158,7 +158,7 @@
+     } else {
+       $c = pg_connect ( $dbargs );
+     }
+-    $GLOBALS["postgresql_connection"] = $c;
++    $GLOBALS["pgsql_connection"] = $c;
+     if ( ! $c ) {
+         echo "Error connecting to database\n";
+         exit;
+@@ -207,8 +207,8 @@
+     return mssql_close ( $conn );
+   } else if ( strcmp ( $GLOBALS["db_type"], "oracle" ) == 0 ) {
+     return OCILogOff ( $conn );
+-  } else if ( strcmp ( $GLOBALS["db_type"], "postgresql" ) == 0 ) {
+-    return pg_close ( $GLOBALS["postgresql_connection"] );
++  } else if ( strcmp ( $GLOBALS["db_type"], "pgsql" ) == 0 ) {
++    return pg_close ( $GLOBALS["pgsql_connection"] );
+   } else if ( strcmp ( $GLOBALS["db_type"], "odbc" ) == 0 ) {
+     return odbc_close ( $GLOBALS["odbc_connection"] );
+   } else if ( strcmp ( $GLOBALS["db_type"], "ibase" ) == 0 ) {
+@@ -274,14 +274,14 @@
+       OCIParse ( $GLOBALS["oracle_connection"], $sql );
+     return OCIExecute ( $GLOBALS["oracle_statement"],
+       OCI_COMMIT_ON_SUCCESS );
+-  } else if ( strcmp ( $GLOBALS["db_type"], "postgresql" ) == 0 ) {
+-    $GLOBALS["postgresql_row[\"$res\"]"] = 0;
+-    $res =  pg_exec ( $GLOBALS["postgresql_connection"], $sql );
++  } else if ( strcmp ( $GLOBALS["db_type"], "pgsql" ) == 0 ) {
++    $GLOBALS["pgsql_row[\"$res\"]"] = 0;
++    $res =  pg_exec ( $GLOBALS["pgsql_connection"], $sql );
+     if ( ! $res )
+       dbi_fatal_error ( "Error executing query." .
+         $phpdbiVerbose ? ( dbi_error() . "\n\n<br />\n" . $sql ) : "" .
+         "", $fatalOnError, $showError );
+-    $GLOBALS["postgresql_numrows[\"$res\"]"] = pg_numrows ( $res );
++    $GLOBALS["pgsql_numrows[\"$res\"]"] = pg_numrows ( $res );
+     return $res;
+   } else if ( strcmp ( $GLOBALS["db_type"], "odbc" ) == 0 ) {
+     return odbc_exec ( $GLOBALS["odbc_connection"], $sql );
+@@ -333,10 +333,10 @@
+       OCI_NUM + OCI_RETURN_NULLS  ) )
+       return $row;
+     return 0;
+-  } else if ( strcmp ( $GLOBALS["db_type"], "postgresql" ) == 0 ) {
+-    if ( $GLOBALS["postgresql_numrows[\"$res\"]"]  > $GLOBALS["postgresql_row[\"$res\"]"] ) {
+-        $r =  pg_fetch_array ( $res, $GLOBALS["postgresql_row[\"$res\"]"] );
+-        $GLOBALS["postgresql_row[\"$res\"]"]++;
++  } else if ( strcmp ( $GLOBALS["db_type"], "pgsql" ) == 0 ) {
++    if ( $GLOBALS["pgsql_numrows[\"$res\"]"]  > $GLOBALS["pgsql_row[\"$res\"]"] ) {
++        $r =  pg_fetch_array ( $res, $GLOBALS["pgsql_row[\"$res\"]"] );
++        $GLOBALS["pgsql_row[\"$res\"]"]++;
+         if ( ! $r ) {
+             echo "Unable to fetch row\n";
+             return '';
+@@ -382,7 +382,7 @@
+     } else {
+       return -1;
+     }
+-  } else if ( strcmp ( $GLOBALS["db_type"], "postgresql" ) == 0 ) {
++  } else if ( strcmp ( $GLOBALS["db_type"], "pgsql" ) == 0 ) {
+     return pg_affected_rows ( $res );
+   } else if ( strcmp ( $GLOBALS["db_type"], "odbc" ) == 0 ) {
+     return odbc_num_rows ( $res );
+@@ -414,7 +414,7 @@
+       OCIFreeStatement ( $GLOBALS["oracle_statement"] );
+       $GLOBALS["oracle_statement"] = -1;
+     }
+-  } else if ( strcmp ( $GLOBALS["db_type"], "postgresql" ) == 0 ) {
++  } else if ( strcmp ( $GLOBALS["db_type"], "pgsql" ) == 0 ) {
+     return pg_freeresult ( $res );
+   } else if ( strcmp ( $GLOBALS["db_type"], "odbc" ) == 0 ) {
+     return odbc_free_result ( $res );
+@@ -442,8 +442,8 @@
+     $ret = mssql_get_last_message ();
+   } else if ( strcmp ( $GLOBALS["db_type"], "oracle" ) == 0 ) {
+     $ret = OCIError ( $GLOBALS["oracle_connection"] );
+-  } else if ( strcmp ( $GLOBALS["db_type"], "postgresql" ) == 0 ) {
+-    $ret = pg_errormessage ( $GLOBALS["postgresql_connection"] );
++  } else if ( strcmp ( $GLOBALS["db_type"], "pgsql" ) == 0 ) {
++    $ret = pg_errormessage ( $GLOBALS["pgsql_connection"] );
+   } else if ( strcmp ( $GLOBALS["db_type"], "odbc" ) == 0 ) {
+     // no way to get error from ODBC API
+     $ret = "Unknown ODBC error";
+diff -urN webcalendar-1.0.2.old/install/index.php webcalendar-1.0.2/install/index.php
+--- webcalendar-1.0.2.old/install/index.php	2006-04-20 21:45:57.000000000 +0200
++++ webcalendar-1.0.2/install/index.php	2006-04-20 21:42:33.000000000 +0200
+@@ -465,7 +465,7 @@
+   if ( function_exists ( "OCIPLogon" ) )
+     $dbs[] = "oracle";
+   if ( function_exists ( "pg_pconnect" ) )
+-    $dbs[] = "postgresql";
++    $dbs[] = "pgsql";
+   if ( function_exists ( "odbc_pconnect" ) )
+     $dbs[] = "odbc";
+   if ( function_exists ( "ibase_pconnect" ) )
+@@ -586,9 +586,9 @@
+       ( $settings['db_type'] == 'oracle' ? " selected=\"selected\"" : "" ) .
+       "> Oracle (OCI) </option>\n";
+ 
+-  if ( ! empty ( $supported['postgresql'] ) )
+-    echo "<option value=\"postgresql\" " .
+-      ( $settings['db_type'] == 'postgresql' ? " selected=\"selected\"" : "" ) .
++  if ( ! empty ( $supported['pgsql'] ) )
++    echo "<option value=\"pgsql\" " .
++      ( $settings['db_type'] == 'pgsql' ? " selected=\"selected\"" : "" ) .
+       "> PostgreSQL </option>\n";
+ 
+   if ( ! empty ( $supported['odbc'] ) )
diff -urN webcalendar-1.0.2.old/debian/settings.conf webcalendar-1.0.2/debian/settings.conf
--- webcalendar-1.0.2.old/debian/settings.conf	2006-04-20 17:34:12.000000000 +0200
+++ webcalendar-1.0.2/debian/settings.conf	1970-01-01 01:00:00.000000000 +0100
@@ -1,162 +0,0 @@
-
-############################################################################
-#                 Webcalendar config file for debian                       #
-#                                                                          #
-# See /usr/share/doc/webcalendar/README.Debian for more information        #
-#                                                                          #
-############################################################################
-
-
-############################################################################
-# database settings                                                        #
-############################################################################
-db_type = DebConf::DB_TYPE
-db_host = DebConf::DB_HOST
-db_login = DebConf::DB_LOGIN
-db_password = DebConf::DB_PASSWORD
-db_database = DebConf::DB_DATABASE
-db_persistent = DebConf::DB_PERSISTENT
-
-
-############################################################################
-# general configuration options                                            #
-############################################################################
-
-# is the calendar read only?
-readonly = false
-
-# is this a personal/single user calendar or not
-single_user = DebConf::SINGLE_USER
-
-# if single_user is true, what username should we use?
-single_user_login = DebConf::SINGLE_USER_LOGIN
-
-# do we use http authentication or allow webcalendar to handle auth?
-use_http_auth = DebConf::USE_HTTP_AUTH
-
-# which authentication mechanism will we be using?
-# auth_mechanism can be standard (webcalendar database), ldap, nis or postnuke
-# be sure the configuration for your chosen mechanism will work below
-# if you choose anything besides standard, you'll need to configure that
-# mechanism below
-auth_mechanism = standard
-
-
-############################################################################
-# general user auth options                                                #
-############################################################################
-# if you use ldap auth mechanism these settings have no effect
-# if you use nis or postnuke auth mechanism these should all be false as 
-# nis and postnuke should be maintained external to webcalendar
-# if you use standard auth mechanism set these to the desired value
-user_can_update_password = true
-admin_can_add_user = true
-admin_can_delete_user = true
-
-
-############################################################################
-# ldap auth options                                                        #
-############################################################################
-
-ldap_server = localhost
-ldap_port = 389
-
-# use TLS for the connection (not the same as ldaps://)
-ldap_start_tls = false
-
-# openldap needs LDAP_OPT_PROTOCOL_VERSION set to 3
-set_ldap_version = true
-ldap_version = 3
-
-# base search dn
-ldap_base_dn = ou=People,dc=company,dc=com
-
-# attribute used to find user (eg cn login is "Jane Smith", uid login might
-# be "jsmith")
-ldap_login_attr = uid
-
-# Account used to bind to the server ad search for information.  This must
-# have the correct rights to perform search.  If left empty the search will
-# be done anonymously.  It is NOT recommended to store the root ldap
-# account info here
-ldap_admin_dn = 
-ldap_admin_pwd = 
-
-# group name to find users with admin rights
-ldap_admin_group_name = cn=webcal_admin,ou=group,dc=company,dc=com
-
-# what type of group do we want (posixgroup, groupofnames,
-# groupofuniquenames)
-ldap_admin_group_type = posixgroup
-
-# the LDAP attribute used to store member of a group
-ldap_admin_group_attr = memberuid
-
-# ldap filter to find a user list
-ldap_user_filter = (objectclass=person)
-
-# attributes to fetch from ldap and corresponding user variables in the
-# application. change to match your ldap schema
-ldap_user_attr.login     = uid
-ldap_user_attr.lastname  = sn
-ldap_user_attr.firstname = givenname
-ldap_user_attr.fullname  = cn
-ldap_user_attr.email     = mail
-
-############################################################################
-# nis auth options                                                         #
-############################################################################
-# the domain for user email
-user_external_email = 
-
-
-############################################################################
-# postnuke auth options                                                    #
-############################################################################
-
-# postnuke session id cookie
-pn_sid = POSTNUKESID
-
-# name of table containing users
-pn_user_table = nuke_users
-
-# name of table containing sessions
-pn_session_table = nuke_session_info
-
-# name of table containing group memberships
-pn_group_table = nuke_group_membership
-
-# name of table containing settings
-pn_settings_table = nuke_module_vars
-
-# set the group id of the postnuke group you want to be webcal admins
-# default is the postnuke 'Admins' group
-pn_admin_gid = 2
-
-# what is the full url to the login page for postnuke?
-app_login_page = http://www.mysite.com/postnuke/html/user.php?op=loginscreen&module=NS-User
-
-# is there a parameter we can pass to tell the application to redirect the
-# user back to the calendar after login?
-app_redir_param = url
-
-# what is the full url to the logout page?
-app_logout_page = http://www.mysite.com/postnuke/html/user.php?module=NS-User&op=logout
-
-# are the application's tables in the same database as webcalendar's?
-app_same_db = false
-
-#################################################
-# these are only needed if app_same_db is false #
-#################################################
-# name of the database containing the postnuke tables
-app_db = postnuke
-
-# host that postnuke's db is on
-app_host = localhost
-
-# login & password to access the postnuke database
-app_login = postnukeuser
-app_pass  = postnukepass
-
-
diff -urN webcalendar-1.0.2.old/debian/settings.php webcalendar-1.0.2/debian/settings.php
--- webcalendar-1.0.2.old/debian/settings.php	1970-01-01 01:00:00.000000000 +0100
+++ webcalendar-1.0.2/debian/settings.php	2006-04-20 17:34:36.000000000 +0200
@@ -0,0 +1,162 @@
+
+############################################################################
+#                 Webcalendar config file for debian                       #
+#                                                                          #
+# See /usr/share/doc/webcalendar/README.Debian for more information        #
+#                                                                          #
+############################################################################
+
+
+############################################################################
+# database settings                                                        #
+############################################################################
+db_type = DebConf::DB_TYPE
+db_host = DebConf::DB_HOST
+db_login = DebConf::DB_LOGIN
+db_password = DebConf::DB_PASSWORD
+db_database = DebConf::DB_DATABASE
+db_persistent = DebConf::DB_PERSISTENT
+
+
+############################################################################
+# general configuration options                                            #
+############################################################################
+
+# is the calendar read only?
+readonly = false
+
+# is this a personal/single user calendar or not
+single_user = DebConf::SINGLE_USER
+
+# if single_user is true, what username should we use?
+single_user_login = DebConf::SINGLE_USER_LOGIN
+
+# do we use http authentication or allow webcalendar to handle auth?
+use_http_auth = DebConf::USE_HTTP_AUTH
+
+# which authentication mechanism will we be using?
+# auth_mechanism can be standard (webcalendar database), ldap, nis or postnuke
+# be sure the configuration for your chosen mechanism will work below
+# if you choose anything besides standard, you'll need to configure that
+# mechanism below
+auth_mechanism = standard
+
+
+############################################################################
+# general user auth options                                                #
+############################################################################
+# if you use ldap auth mechanism these settings have no effect
+# if you use nis or postnuke auth mechanism these should all be false as 
+# nis and postnuke should be maintained external to webcalendar
+# if you use standard auth mechanism set these to the desired value
+user_can_update_password = true
+admin_can_add_user = true
+admin_can_delete_user = true
+
+
+############################################################################
+# ldap auth options                                                        #
+############################################################################
+
+ldap_server = localhost
+ldap_port = 389
+
+# use TLS for the connection (not the same as ldaps://)
+ldap_start_tls = false
+
+# openldap needs LDAP_OPT_PROTOCOL_VERSION set to 3
+set_ldap_version = true
+ldap_version = 3
+
+# base search dn
+ldap_base_dn = ou=People,dc=company,dc=com
+
+# attribute used to find user (eg cn login is "Jane Smith", uid login might
+# be "jsmith")
+ldap_login_attr = uid
+
+# Account used to bind to the server ad search for information.  This must
+# have the correct rights to perform search.  If left empty the search will
+# be done anonymously.  It is NOT recommended to store the root ldap
+# account info here
+ldap_admin_dn = 
+ldap_admin_pwd = 
+
+# group name to find users with admin rights
+ldap_admin_group_name = cn=webcal_admin,ou=group,dc=company,dc=com
+
+# what type of group do we want (posixgroup, groupofnames,
+# groupofuniquenames)
+ldap_admin_group_type = posixgroup
+
+# the LDAP attribute used to store member of a group
+ldap_admin_group_attr = memberuid
+
+# ldap filter to find a user list
+ldap_user_filter = (objectclass=person)
+
+# attributes to fetch from ldap and corresponding user variables in the
+# application. change to match your ldap schema
+ldap_user_attr.login     = uid
+ldap_user_attr.lastname  = sn
+ldap_user_attr.firstname = givenname
+ldap_user_attr.fullname  = cn
+ldap_user_attr.email     = mail
+
+############################################################################
+# nis auth options                                                         #
+############################################################################
+# the domain for user email
+user_external_email = 
+
+
+############################################################################
+# postnuke auth options                                                    #
+############################################################################
+
+# postnuke session id cookie
+pn_sid = POSTNUKESID
+
+# name of table containing users
+pn_user_table = nuke_users
+
+# name of table containing sessions
+pn_session_table = nuke_session_info
+
+# name of table containing group memberships
+pn_group_table = nuke_group_membership
+
+# name of table containing settings
+pn_settings_table = nuke_module_vars
+
+# set the group id of the postnuke group you want to be webcal admins
+# default is the postnuke 'Admins' group
+pn_admin_gid = 2
+
+# what is the full url to the login page for postnuke?
+app_login_page = http://www.mysite.com/postnuke/html/user.php?op=loginscreen&module=NS-User
+
+# is there a parameter we can pass to tell the application to redirect the
+# user back to the calendar after login?
+app_redir_param = url
+
+# what is the full url to the logout page?
+app_logout_page = http://www.mysite.com/postnuke/html/user.php?module=NS-User&op=logout
+
+# are the application's tables in the same database as webcalendar's?
+app_same_db = false
+
+#################################################
+# these are only needed if app_same_db is false #
+#################################################
+# name of the database containing the postnuke tables
+app_db = postnuke
+
+# host that postnuke's db is on
+app_host = localhost
+
+# login & password to access the postnuke database
+app_login = postnukeuser
+app_pass  = postnukepass
+
+
diff -urN webcalendar-1.0.2.old/debian/tools/dbconfig_oldconf.sh webcalendar-1.0.2/debian/tools/dbconfig_oldconf.sh
--- webcalendar-1.0.2.old/debian/tools/dbconfig_oldconf.sh	2006-04-20 17:34:12.000000000 +0200
+++ webcalendar-1.0.2/debian/tools/dbconfig_oldconf.sh	1970-01-01 01:00:00.000000000 +0100
@@ -1,23 +0,0 @@
-#!/bin/sh
-
-# helper script to import old (<1.0.2-1) database settings for
-# dbconfig-common
-
-SETTINGS='/etc/webcalendar/settings.php'
-
-db_type=`grep db_type $SETTINGS | awk '{print $2}'`
-db_host=`grep db_host $SETTINGS | awk '{print $2}'`
-db_database=`grep db_database $SETTINGS | awk '{print $2}'`
-db_login=`grep db_login $SETTINGS | awk '{print $2}'`
-db_password=`grep db_password $SETTINGS | awk '{print $2}'`
-
-if [ "x"$db_type = 'xpostgresql' ] ; then
-    db_type='pgsql';
-fi
-
-echo "dbc_dbuser=$db_login"
-echo "dbc_dbpass=$db_password"
-echo "dbc_dbname=$db_database"
-echo "dbc_dbserver=$db_host"
-echo "dbc_dbtype=$db_type"
-
diff -urN webcalendar-1.0.2.old/debian/webcalendar.config webcalendar-1.0.2/debian/webcalendar.config
--- webcalendar-1.0.2.old/debian/webcalendar.config	2006-04-20 17:34:12.000000000 +0200
+++ webcalendar-1.0.2/debian/webcalendar.config	2006-04-20 21:29:30.000000000 +0200
@@ -1,18 +1,15 @@
-#!/bin/bash
+#!/bin/sh
 
 set -e
 
-if [ ! -f /usr/share/dbconfig-common/dpkg/config ]; then
-    exit 0;
-fi
+. /usr/share/debconf/confmodule
 
-dbc_load_include="exec:/usr/share/webcalendar/tools/dbconfig_oldconf.sh"
-dbc_first_version="1.0.2-1"
+dbc_load_include="php:/etc/webcalendar/settings.php"
 dbc_dbtypes="mysql, pgsql"
-
-. /usr/share/debconf/confmodule
 . /usr/share/dbconfig-common/dpkg/config
 
+dbc_first_version="1.0.2-1"
+
 db_input high webcalendar/status/debconf_managed || true
 db_go || true
 
diff -urN webcalendar-1.0.2.old/debian/webcalendar.links webcalendar-1.0.2/debian/webcalendar.links
--- webcalendar-1.0.2.old/debian/webcalendar.links	2006-04-20 17:34:12.000000000 +0200
+++ webcalendar-1.0.2/debian/webcalendar.links	2006-04-20 17:34:36.000000000 +0200
@@ -1,4 +1,4 @@
-usr/share/webcalendar/docs usr/share/doc/webcalendar/www/docs
+usr/share/webcalendar/www/docs usr/share/doc/webcalendar/www/docs
 etc/webcalendar/print_styles.css usr/share/webcalendar/www/includes/print_styles.css 
 etc/webcalendar/site_extras.php usr/share/webcalendar/www/includes/site_extras.php 
 etc/webcalendar/styles.php usr/share/webcalendar/www/includes/styles.php 
diff -urN webcalendar-1.0.2.old/debian/webcalendar.postinst webcalendar-1.0.2/debian/webcalendar.postinst
--- webcalendar-1.0.2.old/debian/webcalendar.postinst	2006-04-20 17:34:12.000000000 +0200
+++ webcalendar-1.0.2/debian/webcalendar.postinst	2006-04-20 21:29:55.000000000 +0200
@@ -6,11 +6,17 @@
 
 set -e
 
-WEBCAL_CONF_FILE=/etc/webcalendar/settings.conf
+WEBCAL_CONF_FILE=/etc/webcalendar/settings.php
 
 dbc_first_version="1.0.2-1"
 dbc_dbtypes="mysql, pgsql"
 . /usr/share/debconf/confmodule
+
+db_get webcalendar/status/debconf_managed
+if [ "$RET" = false ]; then
+    exit 0;
+fi
+
 . /usr/share/dbconfig-common/dpkg/postinst
 
 dbc_go webcalendar $@
@@ -18,7 +24,6 @@
 configure() {
     TMP_FILE=$1
 
-
     . /etc/dbconfig-common/webcalendar.conf
     # the above line provides these (and other) environment variables
     #dbc_dbtype
@@ -43,11 +48,6 @@
     db_get webcalendar/conf/single_user_login || true
     SINGLE_USER_LOGIN=$RET
 
-    # fix the db name if they're using postgresql
-    if [ "x"$dbc_dbtype = 'xpgsql' ] ; then
-        dbc_dbtype='postgresql'
-    fi
-
     # unregister all old templates
     db_get webcalendar/conf/db_type || true
     OLD_QUESTIONS=$RET
@@ -66,7 +66,7 @@
         db_unregister webcalendar/note/sql_install || true
     fi
 
-    cat /usr/share/webcalendar/tools/settings.conf |\
+    cat /usr/share/webcalendar/tools/settings.php |\
         sed -e "s/DebConf::DB_TYPE/$dbc_dbtype/g" |\
         sed -e "s/DebConf::DB_LOGIN/$dbc_dbuser/g" |\
         sed -e "s/DebConf::DB_PASSWORD/$dbc_dbpass/g" |\
diff -urN webcalendar-1.0.2.old/debian/webcalendar.postrm webcalendar-1.0.2/debian/webcalendar.postrm
--- webcalendar-1.0.2.old/debian/webcalendar.postrm	2006-04-20 17:34:12.000000000 +0200
+++ webcalendar-1.0.2/debian/webcalendar.postrm	2006-04-20 21:30:22.000000000 +0200
@@ -43,8 +43,8 @@
 case "$1" in
         purge)
             unlinkapache
-            ucf --purge /etc/webcalendar/settings.conf
-            rm -f /etc/webcalendar/settings.conf
+            ucf --purge /etc/webcalendar/settings.php
+            rm -f /etc/webcalendar/settings.php
             db_purge 
         ;;
         remove|abort-install|disappear)

Reply via email to