Package: sympa
Version: 4.1.5-7
Followup-For: Bug #336157

Patch inline and attached.

diff -r -u sympa-4.1.5/debian/changelog sympa-4.1.5.new/debian/changelog
--- sympa-4.1.5/debian/changelog        2006-01-12 12:44:53.000000000 +0100
+++ sympa-4.1.5.new/debian/changelog    2006-01-12 12:40:31.000000000 +0100
@@ -1,3 +1,13 @@
+sympa (4.1.5-7.1) unstable; urgency=low
+
+  * Non-maintainer upload. (Closes: #336157)
+  * mysql_read_default_file uses group client, force it to use group mysql.
+  * Don't "exit 1" when install-${DBTYPE}-db ends successfully.
+  * Use the same tools we will use to create database to know if we can 
+    connect mysql without password.
+
+ -- Jean Charles  Delepine <[EMAIL PROTECTED]>  Thu, 12 Jan 2006 12:35:44 +0100
+
 sympa (4.1.5-7) unstable; urgency=low
 
   * database user can now specified with Debconf (Closes: #336156, thanks
diff -r -u sympa-4.1.5/debian/db/install-mysql-db.pl 
sympa-4.1.5.new/debian/db/install-mysql-db.pl
--- sympa-4.1.5/debian/db/install-mysql-db.pl   2006-01-12 12:44:53.000000000 
+0100
+++ sympa-4.1.5.new/debian/db/install-mysql-db.pl       2006-01-12 
12:31:06.000000000 +0100
@@ -81,9 +81,17 @@
 if ($userpass ne "") {
     $command .= " IDENTIFIED BY '$userpass'";
 }
-$dbh->do($command);
+eval {$dbh->do($command)};
+
+if ($@) {
+       die "$0: failed to create $database user: [EMAIL PROTECTED]";
+       exit 1;
+}
+
 $dbh->disconnect();
 
+exit 0;
+
 sub usage {
     die "Usage: install-mysql-db.pl -d <database> [-a <adminpass>] [-u 
<userpass>] [-h <hostname>] [-p <port>] [-w <user>]\n";
 }
diff -r -u sympa-4.1.5/debian/postinst sympa-4.1.5.new/debian/postinst
--- sympa-4.1.5/debian/postinst 2006-01-12 12:44:53.000000000 +0100
+++ sympa-4.1.5.new/debian/postinst     2006-01-12 12:21:39.000000000 +0100
@@ -284,7 +284,7 @@
                db_type="mysql"
                        if [ "$RET" = "false" ]; then
                                # Check if we can gain access to MySQL without 
password
-                               if mysql mysql </dev/null; then
+                               if perl -e 'use DBI; $dsn = 
"DBI:mysql:mysql;mysql_read_default_file=/root/.my.cnf:mysql_read_default_group=mysql";
 $dbh = DBI->connect($dsn);'</dev/null; then
                                        pass_required=0
                                fi
                        fi
diff -r -u sympa-4.1.5/debian/prepare_db sympa-4.1.5.new/debian/prepare_db
--- sympa-4.1.5/debian/prepare_db       2006-01-12 12:44:53.000000000 +0100
+++ sympa-4.1.5.new/debian/prepare_db   2006-01-12 12:33:46.000000000 +0100
@@ -53,7 +53,7 @@
 EOT
                OPTS="-a $adminpassfile"
        elif [ "$db_type" = "MySQL" ]; then
-               OPTS="-o mysql_read_default_file=/root/.my.cnf"
+               OPTS="-o 
mysql_read_default_file=/root/.my.cnf:mysql_read_default_group=mysql"
        fi
 
        db_get sympa/db_passwd
@@ -89,14 +89,10 @@
                        if [ "$RET" = "Ident-based" ]; then
                                OPTS="-i $OPTS"
                        fi
-                       if /usr/share/sympa/db/install-pg-db $OPTS -d 
"$db_name" -h "$db_hostname" -u "$userpassfile"; then
-                               exit 1
-                       fi
+                       /usr/share/sympa/db/install-pg-db $OPTS -d "$db_name" 
-h "$db_hostname" -u "$userpassfile"
                    ;;
                "MySQL")
-                       if /usr/share/sympa/db/install-mysql-db $OPTS -d 
"$db_name" -h "$db_hostname" -u "$userpassfile"; then
-                               exit 1
-                       fi
+                       /usr/share/sympa/db/install-mysql-db $OPTS -d 
"$db_name" -h "$db_hostname" -u "$userpassfile"
                    ;;
        esac
 fi
-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (100, 'testing'), (10, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.11-1-686-smp
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages sympa depends on:
ii  adduser                     3.63         Add and remove users and groups
ii  debconf [debconf-2.0]       1.4.30.13    Debian configuration management sy
ii  libarchive-zip-perl         1.14-1       Module for manipulation of ZIP arc
ii  libc6                       2.3.2.ds1-22 GNU C Library: Shared libraries an
ii  libcgi-fast-perl            5.8.4-8      CGI::Fast Perl module
ii  libcrypt-ciphersaber-perl   0.61-4       Perl module implementing CipherSab
ii  libdbd-mysql-perl           2.9006-1     A Perl5 database interface to the 
ii  libdbi-perl                 1.46-6       Perl5 database interface by Tim Bu
ii  libfcgi-perl                0.67-1       FastCGI Perl module
ii  libio-stringy-perl          2.110-1      Perl5 modules for IO from scalars 
ii  libmailtools-perl           1.62-1       Manipulate email in perl programs
ii  libmd5-perl                 2.03-1       backwards-compatible wrapper for D
ii  libmime-perl                5.417-1      Perl5 modules for MIME-compliant m
ii  libmsgcat-perl              1.03-3       Locale::Msgcat perl module
ii  libnet-ldap-perl            0.3202-3     A Client interface to LDAP servers
ii  mhonarc                     2.6.10-1     Mail to HTML converter
ii  perl [libmime-base64-perl]  5.8.4-8      Larry Wall's Practical Extraction 
ii  perl-suid                   5.8.4-8      Runs setuid Perl scripts
ii  postfix [mail-transport-age 2.1.5-9      A high-performance mail transport 
ii  sysklogd [system-log-daemon 1.4.1-17     System Logging Daemon

-- debconf information excluded
diff -r -u sympa-4.1.5/debian/changelog sympa-4.1.5.new/debian/changelog
--- sympa-4.1.5/debian/changelog        2006-01-12 12:44:53.000000000 +0100
+++ sympa-4.1.5.new/debian/changelog    2006-01-12 12:40:31.000000000 +0100
@@ -1,3 +1,13 @@
+sympa (4.1.5-7.1) unstable; urgency=low
+
+  * Non-maintainer upload. (Closes: #336157)
+  * mysql_read_default_file uses group client, force it to use group mysql.
+  * Don't "exit 1" when install-${DBTYPE}-db ends successfully.
+  * Use the same tools we will use to create database to know if we can 
+    connect mysql without password.
+
+ -- Jean Charles  Delepine <[EMAIL PROTECTED]>  Thu, 12 Jan 2006 12:35:44 +0100
+
 sympa (4.1.5-7) unstable; urgency=low
 
   * database user can now specified with Debconf (Closes: #336156, thanks
diff -r -u sympa-4.1.5/debian/db/install-mysql-db.pl 
sympa-4.1.5.new/debian/db/install-mysql-db.pl
--- sympa-4.1.5/debian/db/install-mysql-db.pl   2006-01-12 12:44:53.000000000 
+0100
+++ sympa-4.1.5.new/debian/db/install-mysql-db.pl       2006-01-12 
12:31:06.000000000 +0100
@@ -81,9 +81,17 @@
 if ($userpass ne "") {
     $command .= " IDENTIFIED BY '$userpass'";
 }
-$dbh->do($command);
+eval {$dbh->do($command)};
+
+if ($@) {
+       die "$0: failed to create $database user: [EMAIL PROTECTED]";
+       exit 1;
+}
+
 $dbh->disconnect();
 
+exit 0;
+
 sub usage {
     die "Usage: install-mysql-db.pl -d <database> [-a <adminpass>] [-u 
<userpass>] [-h <hostname>] [-p <port>] [-w <user>]\n";
 }
diff -r -u sympa-4.1.5/debian/postinst sympa-4.1.5.new/debian/postinst
--- sympa-4.1.5/debian/postinst 2006-01-12 12:44:53.000000000 +0100
+++ sympa-4.1.5.new/debian/postinst     2006-01-12 12:21:39.000000000 +0100
@@ -284,7 +284,7 @@
                db_type="mysql"
                        if [ "$RET" = "false" ]; then
                                # Check if we can gain access to MySQL without 
password
-                               if mysql mysql </dev/null; then
+                               if perl -e 'use DBI; $dsn = 
"DBI:mysql:mysql;mysql_read_default_file=/root/.my.cnf:mysql_read_default_group=mysql";
 $dbh = DBI->connect($dsn);'</dev/null; then
                                        pass_required=0
                                fi
                        fi
diff -r -u sympa-4.1.5/debian/prepare_db sympa-4.1.5.new/debian/prepare_db
--- sympa-4.1.5/debian/prepare_db       2006-01-12 12:44:53.000000000 +0100
+++ sympa-4.1.5.new/debian/prepare_db   2006-01-12 12:33:46.000000000 +0100
@@ -53,7 +53,7 @@
 EOT
                OPTS="-a $adminpassfile"
        elif [ "$db_type" = "MySQL" ]; then
-               OPTS="-o mysql_read_default_file=/root/.my.cnf"
+               OPTS="-o 
mysql_read_default_file=/root/.my.cnf:mysql_read_default_group=mysql"
        fi
 
        db_get sympa/db_passwd
@@ -89,14 +89,10 @@
                        if [ "$RET" = "Ident-based" ]; then
                                OPTS="-i $OPTS"
                        fi
-                       if /usr/share/sympa/db/install-pg-db $OPTS -d 
"$db_name" -h "$db_hostname" -u "$userpassfile"; then
-                               exit 1
-                       fi
+                       /usr/share/sympa/db/install-pg-db $OPTS -d "$db_name" 
-h "$db_hostname" -u "$userpassfile"
                    ;;
                "MySQL")
-                       if /usr/share/sympa/db/install-mysql-db $OPTS -d 
"$db_name" -h "$db_hostname" -u "$userpassfile"; then
-                               exit 1
-                       fi
+                       /usr/share/sympa/db/install-mysql-db $OPTS -d 
"$db_name" -h "$db_hostname" -u "$userpassfile"
                    ;;
        esac
 fi

Reply via email to