/[smeserver]/rpms/e-smith-horde/sme7/e-smith-horde-1.13.0-16.horde_upgrade.patch
ViewVC logotype

Contents of /rpms/e-smith-horde/sme7/e-smith-horde-1.13.0-16.horde_upgrade.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download)
Thu Jun 26 04:25:02 2008 UTC (16 years, 5 months ago) by slords
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +0 -0 lines
FILE REMOVED
* Tue Jun 24 2008 John H. Bennett III <bennettj@johnbennettservices.com> 3.2-2
- Upgrade patch for Horde 3.2.1

1 diff -Nur -x '*.orig' -x '*.rej' e-smith-horde-1.13.0/createlinks mezzanine_patched_e-smith-horde-1.13.0/createlinks
2 --- e-smith-horde-1.13.0/createlinks 2006-12-23 17:47:27.000000000 -0600
3 +++ mezzanine_patched_e-smith-horde-1.13.0/createlinks 2006-12-23 17:34:11.000000000 -0600
4 @@ -49,6 +49,7 @@
5 40horde_mysql_create_indexes
6 50horde-2.2_to_3.0
7 55horde-3.0_to_3.1
8 + 56horde-3.1_alter_table
9 77mysql_update_privs
10 ))
11 {
12 @@ -71,6 +72,7 @@
13 40horde_mysql_create_indexes
14 50horde-2.2_to_3.0
15 55horde-3.0_to_3.1
16 + 56horde-3.1_alter_table
17 77mysql_update_privs
18 ))
19 {
20 diff -Nur -x '*.orig' -x '*.rej' e-smith-horde-1.13.0/root/etc/e-smith/events/actions/horde_alter_table mezzanine_patched_e-smith-horde-1.13.0/root/etc/e-smith/events/actions/horde_alter_table
21 --- e-smith-horde-1.13.0/root/etc/e-smith/events/actions/horde_alter_table 1969-12-31 18:00:00.000000000 -0600
22 +++ mezzanine_patched_e-smith-horde-1.13.0/root/etc/e-smith/events/actions/horde_alter_table 2006-12-23 17:41:31.000000000 -0600
23 @@ -0,0 +1,76 @@
24 +#!/usr/bin/perl -w
25 +#----------------------------------------------------------------------
26 +# copyright (C) 2002-2005 Mitel Networks Corporation
27 +#
28 +# This program is free software; you can redistribute it and/or modify
29 +# it under the terms of the GNU General Public License as published by
30 +# the Free Software Foundation; either version 2 of the License, or
31 +# (at your option) any later version.
32 +#
33 +# This program is distributed in the hope that it will be useful,
34 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
35 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
36 +# GNU General Public License for more details.
37 +#
38 +# You should have received a copy of the GNU General Public License
39 +# along with this program; if not, write to the Free Software
40 +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
41 +#
42 +# Technical support for this program is available from Mitel Networks
43 +# Please visit our web site www.mitel.com/sme/ for details.
44 +#----------------------------------------------------------------------
45 +
46 +use strict;
47 +use DBI;
48 +use esmith::ConfigDB;
49 +use esmith::util;
50 +
51 +# Exit early if there is nothing to do
52 +die("horde db must exist") unless ( -d "/var/lib/mysql/horde/");
53 +die("horde_user db must exist") unless ( -f "/var/lib/mysql/horde/horde_users.frm");
54 +
55 +
56 +# This is a translation of the script 'mysql_upgrade_1.1_to_1.2.sql
57 +# that is safe to run multiple times, and which can be run on a 1.2
58 +# installation without barfing.
59 +# Modified 12-23-06 by John H. Bennett III to accommodate the table alteration required
60 +# for upgrades from horde 2.x or 3.0 to 3.1
61 +
62 +my $conf = esmith::ConfigDB->open_ro
63 + or die "Can't open configuration database: $!\n";
64 +our $username = 'root';
65 +our $password = esmith::util::LdapPassword();
66 +our $HORDE_DATABASE = 'horde';
67 +our $dbi_options = {RaiseError => 1, ChopBlanks => 1, AutoCommit => 1};
68 +
69 +my $db_hordehandle = DBI->connect
70 + ("DBI:mysql:$HORDE_DATABASE",
71 + $username, $password, $dbi_options )
72 + || die ("Connection error: $DBI::errstr");
73 +
74 +
75 +# We now need to create some columns, but we need to first check
76 +# whether they exist already
77 +my $sth = $db_hordehandle->prepare("show columns from horde_users");
78 +$sth->execute;
79 +my $horde_users = $sth->fetchall_hashref('Field');
80 +
81 +unless (defined $horde_users->{user_soft_expiration_date})
82 +{
83 + # We need to be careful about this one as it will fail if the
84 + # column exists, so we check the error.
85 + my $statement = 'ALTER TABLE horde_users ADD COLUMN user_soft_expiration_date INT';
86 + $statement = $db_hordehandle->prepare($statement) or
87 + die "prepare: $$statement: $DBI::errstr";
88 + $statement->execute or die "execute: $$statement: $DBI::errstr";
89 +}
90 +
91 +unless (defined $horde_users->{user_hard_expiration_date})
92 +{
93 + # We need to be careful about this one too
94 + my $statement = 'ALTER TABLE horde_users ADD COLUMN user_hard_expiration_date INT';
95 + $statement = $db_hordehandle->prepare($statement) or
96 + die "prepare: $$statement: $DBI::errstr";
97 + $statement->execute or die "execute: $$statement: $DBI::errstr";
98 +}
99 +
100 diff -Nur -x '*.orig' -x '*.rej' e-smith-horde-1.13.0/root/etc/e-smith/templates/etc/e-smith/sql/init/55horde-3.0_to_3.1 mezzanine_patched_e-smith-horde-1.13.0/root/etc/e-smith/templates/etc/e-smith/sql/init/55horde-3.0_to_3.1
101 --- e-smith-horde-1.13.0/root/etc/e-smith/templates/etc/e-smith/sql/init/55horde-3.0_to_3.1 2006-12-23 17:47:27.000000000 -0600
102 +++ mezzanine_patched_e-smith-horde-1.13.0/root/etc/e-smith/templates/etc/e-smith/sql/init/55horde-3.0_to_3.1 2006-12-23 17:35:33.000000000 -0600
103 @@ -1,4 +1,4 @@
104 #! /bin/sh
105
106 test -f /var/lib/mysql/horde/horde_histories.frm && exit 0
107 -exec mysql horde < /home/httpd/html/horde/scripts/upgrades/3.0_to_3.1.mysql.sql
108 +exec mysql horde < /home/httpd/html/horde/scripts/db/mysql_horde3.0_to_3.1.sql
109 diff -Nur -x '*.orig' -x '*.rej' e-smith-horde-1.13.0/root/etc/e-smith/templates/etc/e-smith/sql/init/56horde-3.1_alter_table mezzanine_patched_e-smith-horde-1.13.0/root/etc/e-smith/templates/etc/e-smith/sql/init/56horde-3.1_alter_table
110 --- e-smith-horde-1.13.0/root/etc/e-smith/templates/etc/e-smith/sql/init/56horde-3.1_alter_table 1969-12-31 18:00:00.000000000 -0600
111 +++ mezzanine_patched_e-smith-horde-1.13.0/root/etc/e-smith/templates/etc/e-smith/sql/init/56horde-3.1_alter_table 2006-12-23 17:34:53.000000000 -0600
112 @@ -0,0 +1,2 @@
113 +#! /bin/sh
114 +exec /etc/e-smith/events/actions/horde_alter_table
115 diff -Nur -x '*.orig' -x '*.rej' e-smith-horde-1.13.0/root/etc/e-smith/templates.metadata/etc/e-smith/sql/init/56horde-3.1_alter_table mezzanine_patched_e-smith-horde-1.13.0/root/etc/e-smith/templates.metadata/etc/e-smith/sql/init/56horde-3.1_alter_table
116 --- e-smith-horde-1.13.0/root/etc/e-smith/templates.metadata/etc/e-smith/sql/init/56horde-3.1_alter_table 1969-12-31 18:00:00.000000000 -0600
117 +++ mezzanine_patched_e-smith-horde-1.13.0/root/etc/e-smith/templates.metadata/etc/e-smith/sql/init/56horde-3.1_alter_table 2006-12-23 17:37:52.000000000 -0600
118 @@ -0,0 +1 @@
119 +PERMS=0544
120 diff -Nur -x '*.orig' -x '*.rej' e-smith-horde-1.13.0/root/home/httpd/html/horde/scripts/db/mysql_horde3.0_to_3.1.sql mezzanine_patched_e-smith-horde-1.13.0/root/home/httpd/html/horde/scripts/db/mysql_horde3.0_to_3.1.sql
121 --- e-smith-horde-1.13.0/root/home/httpd/html/horde/scripts/db/mysql_horde3.0_to_3.1.sql 1969-12-31 18:00:00.000000000 -0600
122 +++ mezzanine_patched_e-smith-horde-1.13.0/root/home/httpd/html/horde/scripts/db/mysql_horde3.0_to_3.1.sql 2006-12-23 17:45:24.000000000 -0600
123 @@ -0,0 +1,17 @@
124 +CREATE TABLE IF NOT EXISTS horde_histories (
125 + history_id BIGINT NOT NULL,
126 + object_uid VARCHAR(255) NOT NULL,
127 + history_action VARCHAR(32) NOT NULL,
128 + history_ts BIGINT NOT NULL,
129 + history_desc TEXT,
130 + history_who VARCHAR(255),
131 + history_extra TEXT,
132 +--
133 + PRIMARY KEY (history_id)
134 +);
135 +
136 +CREATE INDEX history_action_idx ON horde_histories (history_action);
137 +CREATE INDEX history_ts_idx ON horde_histories (history_ts);
138 +CREATE INDEX history_uid_idx ON horde_histories (object_uid);
139 +
140 +GRANT SELECT, INSERT, UPDATE, DELETE ON horde_histories TO horde@localhost;

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed