Your message dated Mon, 06 Apr 2009 22:02:24 +0000
with message-id <[email protected]>
and subject line Bug#520421: fixed in mytop 1.6-6
has caused the Debian Bug report #520421,
regarding mytop: add support for ~/.my.cnf file
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
520421: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=520421
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: mytop
Version: 1.6-5
Severity: wishlist
Tags: patch

Hi,

I have attached a patch that adds support for reading the mytop config from the
standard MySQL ~/.my.cnf file. In 2007, I sent the patch to Jeremy, who replied
that he would include it in the next mytop release. When upgrading to Lenny, I 
noticed that this next release never happened.

I would be nice if the patch could be included with Debian's mytop package.

Cheers, Til
=== debian/changelog
==================================================================
--- debian/changelog    (revision 4)
+++ debian/changelog    (local)
@@ -1,3 +1,10 @@
+mytop (1.6-5.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * add handling of ~/.my.cnf
+
+ -- Tilman Koschnick <[email protected]>  Thu, 19 Mar 2009 16:54:36 +0100
+
 mytop (1.6-5) unstable; urgency=low
 
   * A newline should be replaced by a space, not just deleted (Closes: #502179)
=== debian/control
==================================================================
--- debian/control      (revision 4)
+++ debian/control      (local)
@@ -4,12 +4,12 @@
 Maintainer: Philipp Matthias Hahn <[email protected]>
 Standards-Version: 3.8.0
 Build-Depends: quilt
-Build-Depends-Indep: perl (>= 5.6.0-16), libdbi-perl (>= 1.13), 
libdbd-mysql-perl (>= 1.0), libterm-readkey-perl (>=2.10)
+Build-Depends-Indep: perl (>= 5.6.0-16), libdbi-perl (>= 1.13), 
libdbd-mysql-perl (>= 1.0), libterm-readkey-perl (>=2.10), 
libconfig-inifiles-perl
 Homepage: http://jeremy.zawodny.com/mysql/mytop/
 
 Package: mytop
 Architecture: all
-Depends: perl (>= 5.6.0-16), libdbi-perl (>= 1.13), libdbd-mysql-perl (>= 
1.0), libterm-readkey-perl (>=2.10)
+Depends: perl (>= 5.6.0-16), libdbi-perl (>= 1.13), libdbd-mysql-perl (>= 
1.0), libterm-readkey-perl (>=2.10), libconfig-inifiles-perl
 Suggests: libtime-hires-perl
 Description: top like query monitor for MySQL
  Mytop is a console-based tool for monitoring queries and the performance
=== debian/patches/series
==================================================================
--- debian/patches/series       (revision 4)
+++ debian/patches/series       (local)
@@ -6,3 +6,4 @@
 475140.flicker.diff
 477822.escape.diff
 q_is_quit.diff
+my.cnf.diff
=== debian/patches/my.cnf.diff
==================================================================
--- debian/patches/my.cnf.diff  (revision 4)
+++ debian/patches/my.cnf.diff  (local)
@@ -0,0 +1,106 @@
+--- mytop-1.6.orig/mytop
++++ mytop-1.6/mytop
+@@ -17,6 +17,7 @@
+ use 5.005;
+ use strict;
+ use DBI;
++use Config::IniFiles;
+ use Getopt::Long;
+ use Socket;
+ 
+@@ -77,6 +78,7 @@
+     batchmode     => 0,
+     color         => 1,
+     db            => '',
++    database      => '',
+     delay         => 5,
+     filter_user   => qr/.?/,
+     filter_db     => qr/.?/,
+@@ -89,6 +91,7 @@
+     mode          => 'top',
+     prompt        => 0,
+     pass          => '',
++    password      => '',
+     port          => 3306,
+     resolve       => 1,
+     socket        => '',
+@@ -117,6 +120,26 @@
+ my $RM_RESET   = 0;
+ my $RM_NOBLKRD = 3; ## using 4 traps Ctrl-C :-(
+ 
++## Try ~/.my.cnf first
++
++my $mycnf = "$ENV{HOME}/.my.cnf";
++
++if (-e $mycnf)
++{
++      my $cfgini = new Config::IniFiles( -file => $mycnf );
++      my @sections = ('client', 'mytop');
++
++      foreach my $section (@sections) {
++              foreach my $param ($cfgini->Parameters ($section))
++              {
++                      $config{$param} = $cfgini->val($section, $param) if 
exists $config{$param};
++              }
++      }
++      ## map database/password onto db/pass (long version gets precedence in 
.my.cnf)
++      $config{'db'} = $config{'database'} if $config{'database'};
++      $config{'pass'} = $config{'password'} if $config{'password'};
++}
++
+ ## Read the user's config file, if it exists.
+ 
+ my $config = "$ENV{HOME}/.mytop";
+@@ -139,6 +162,9 @@
+         }
+         close CFG;
+     }
++      ## map database/password onto db/pass (short version gets precedence 
for historical reasons)
++      $config{'db'} = $config{'database'} unless $config{'db'};
++      $config{'pass'} = $config{'password'} unless $config{'pass'};
+ }
+ 
+ ## Command-line args.
+@@ -257,8 +283,8 @@
+   * port you specified "$config{port}" (default is 3306)
+   * socket you specified "$config{socket}" (default is "")
+ 
+-The options my be specified on the command-line or in a ~/.mytop
+-config file. See the manual (perldoc mytop) for details.
++The options my be specified on the command-line or in a ~/.mytop or
++~/.my.cnf config file. See the manual (perldoc mytop) for details.
+ 
+ Here's the exact error from DBI. It might help you debug:
+ 
+@@ -1564,6 +1590,7 @@
+ following:
+ 
+   * Perl 5.005 or newer
++  * Config::IniFiles;
+   * Getopt::Long
+   * DBI and DBD::mysql
+   * Term::ReadKey from CPAN
+@@ -1844,6 +1871,13 @@
+ You may have white space on either side of the C<=> in lines of the
+ config file.
+ 
++If present, mytop will also read mysql's default config file C<~/.my.cnf>.
++Values from both the [client] and [mytop] section are read, in this order.
++The long options I<database> and I<password> are preferred over the short
++versions I<db> and I<pass> to match mysql's syntax.
++These settings take lowest precedence and will be overwritten by either
++values in C<~/.mytop> or command-line options.
++
+ =head2 Shortcut Keys
+ 
+ The following keys perform various actions while B<mytop> is
+@@ -1970,9 +2004,6 @@
+ may appear odd. I have no good idea as to how best to deal with that
+ yet. Suggestions are welcome.
+ 
+-It'd be nice if you could just add B<mytop> configuration directives
+-in your C<my.cnf> file instead of having a separate config file.
+-
+ You should be able to specify the columns you'd like to see in the
+ display and the order in which they appear. If you only have one
+ username that connects to your database, it's probably not worth

--- End Message ---
--- Begin Message ---
Source: mytop
Source-Version: 1.6-6

We believe that the bug you reported is fixed in the latest version of
mytop, which is due to be installed in the Debian FTP archive:

mytop_1.6-6.diff.gz
  to pool/main/m/mytop/mytop_1.6-6.diff.gz
mytop_1.6-6.dsc
  to pool/main/m/mytop/mytop_1.6-6.dsc
mytop_1.6-6_all.deb
  to pool/main/m/mytop/mytop_1.6-6_all.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Philipp Matthias Hahn <[email protected]> (supplier of updated mytop package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Mon, 06 Apr 2009 23:28:58 +0200
Source: mytop
Binary: mytop
Architecture: source all
Version: 1.6-6
Distribution: unstable
Urgency: low
Maintainer: Philipp Matthias Hahn <[email protected]>
Changed-By: Philipp Matthias Hahn <[email protected]>
Description: 
 mytop      - top like query monitor for MySQL
Closes: 504501 509464 517097 520421
Changes: 
 mytop (1.6-6) unstable; urgency=low
 .
   * Add patch from Tilman Koschnick handling ~/.my.cnf (Closes: #520421)
   * Widen ID (Closes: #517097)
   * Document --sort (Closes: #509464)
   * Fix line wrapping (Closes: #504501)
   * debian/control
     - Bump Standards-Version: 3.8.1
     - Depends: +libconfig-inifiles-perl
Checksums-Sha1: 
 23a282f3b2199a6915560357a67d8346c61d8903 1105 mytop_1.6-6.dsc
 4e1aa9768d07874d3e9eb5b45fcc63a65d101d74 11844 mytop_1.6-6.diff.gz
 cfd8790fb5648bc6ea9411e98b4df4afa106f0b1 34826 mytop_1.6-6_all.deb
Checksums-Sha256: 
 cf4af01cbf665952c03c2dfd3d2c1eaecc915088a7250aab80bf428708258764 1105 
mytop_1.6-6.dsc
 d13d73904ab3ace72eab21aee22ff502119c7ac986405412e5b3cbfd717d451f 11844 
mytop_1.6-6.diff.gz
 53987740ed251ce8dcf01ea745c3e6ab3defa08d7d08745f9ceba547490a31e4 34826 
mytop_1.6-6_all.deb
Files: 
 76a56ce48953833941c7a03a85f9d62e 1105 utils optional mytop_1.6-6.dsc
 14ec280c9d7bdbb2c216e61d3039baf0 11844 utils optional mytop_1.6-6.diff.gz
 dfa4cb1ff0f64421dec6aeef369927d4 34826 utils optional mytop_1.6-6_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEUEARECAAYFAknaeNgACgkQYPlgoZpUDjl8sACcDJQjJSPE7lx/Im/ZrSeVYnjY
cDMAmNUjOM2ZXYXlLV3++UMo7fq+bns=
=k/nx
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to