Your message dated Sun, 16 Jun 2013 13:38:51 +0800
with message-id <[email protected]>
and subject line Wont fix something that isn't broken
has caused the Debian Bug report #673265,
regarding automysqlbackup: Tidier sample database retrieval commands
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.)


-- 
673265: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=673265
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: automysqlbackup
Version: 2.6+debian-2
Severity: minor

The default configuration example of

    DBNAMES=`mysql --defaults-file=/etc/mysql/debian.cnf --execute="SHOW
DATABASES" | awk '{print $1}' | grep -v ^Database$ | grep -v ^mysql$ | tr
\\\r\\\n ,\ `

can be done tidier in a single text processing fork as e.g.

    DBNAMES=$(mysql --defaults-file=/etc/mysql/debian.cnf --execute="SHOW
DATABASES" | awk 'BEGIN{ORS=" "}!/^(Database|mysql)$/')

which also leaves line ending peculiarities to a more agnostic awk handling.

grep-like matching is built in to awk. Since the mysql output is not fancy
formatted when redirected, the `^$` pattern matches correctly (and the earlier
`awk '{print $1}'` fork actually does nothing at all from what I can tell).

`print` is default action, so just setting output record separator to blank
space is equivalent to the `tr` command.

This is still POSIX compatible (testable with `-c`).

Somewhat similarly, the other example

    DBNAMES=`find /var/lib/mysql -mindepth 1 -maxdepth 1 -type d | cut -d'/'
-f5 | grep -v ^mysql\$ | tr \\\r\\\n ,\ `

can be done as e.g.

    DBNAMES=$(ls -d /var/lib/mysql/*/ | awk -F/ 'BEGIN{ORS="
"}$5!="mysql"{print $5}')

or in a single command assuming GNU find (with the `-printf` option)

    DBNAMES=$(find /var/lib/mysql -mindepth 1 -maxdepth 1 -type d -not -name
'mysql' -printf '%f ')

The `\\\r` -> `,` translation actually also does nothing on my system in either
case.

Ridiculously low-priority of course, but since I'm procrastinating... :-)



-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 3.2.0-2-686-pae (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=sv_SE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages automysqlbackup depends on:
ii  mysql-client                     5.5.23-2
ii  mysql-client-5.5 [mysql-client]  5.5.23-2

Versions of packages automysqlbackup recommends:
ii  mutt  1.5.21-5+b1

automysqlbackup suggests no packages.

-- Configuration Files:
/etc/default/automysqlbackup changed [not included]

-- no debconf information



--- End Message ---
--- Begin Message ---
Hi,

I have no intention to rewrite something that worked, even though your
version may "look" nicer.

Thomas

--- End Message ---

Reply via email to