diff options
author | Otto Kekäläinen <otto@mariadb.org> | 2018-08-04 23:43:07 -0500 |
---|---|---|
committer | Otto Kekäläinen <otto@mariadb.org> | 2018-08-04 23:43:07 -0500 |
commit | 788314ddf86cd7835fdd6fc76657e379253f544e (patch) | |
tree | b34931079bf351f6c2e4c91f0f2608c660a3aac3 /debian/mariadb-server-10.4.py | |
parent | 0f9efd54ceb0e2b42841f5eb15d30072d210bac2 (diff) | |
download | mariadb-git-788314ddf86cd7835fdd6fc76657e379253f544e.tar.gz |
Deb: Rename all 10.3 files into 10.4 as this is a 10.4 branch now
Diffstat (limited to 'debian/mariadb-server-10.4.py')
-rw-r--r-- | debian/mariadb-server-10.4.py | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/debian/mariadb-server-10.4.py b/debian/mariadb-server-10.4.py new file mode 100644 index 00000000000..99d3f0fd913 --- /dev/null +++ b/debian/mariadb-server-10.4.py @@ -0,0 +1,52 @@ +'''apport package hook for mariadb-10.3 + +(c) 2009 Canonical Ltd. +Author: Mathias Gug <mathias.gug@canonical.com> +''' + +import os, os.path + +from apport.hookutils import * + +def _add_my_conf_files(report, filename): + key = 'MySQLConf' + path_to_key(filename) + report[key] = "" + for line in read_file(filename).split('\n'): + try: + if 'password' in line.split('=')[0]: + line = "%s = @@APPORTREPLACED@@" % (line.split('=')[0]) + report[key] += line + '\n' + except IndexError: + continue + +def add_info(report): + attach_conffiles(report, 'mariadb-server-10.3', conffiles=None) + key = 'Logs' + path_to_key('/var/log/daemon.log') + report[key] = "" + for line in read_file('/var/log/daemon.log').split('\n'): + try: + if 'mysqld' in line.split()[4]: + report[key] += line + '\n' + except IndexError: + continue + key = 'Logs' + path_to_key('/var/log/kern.log') + report[key] = "" + for line in read_file('/var/log/kern.log').split('\n'): + try: + if '/usr/sbin/mysqld' in string.join(line.split()[4:]): + report[key] += line + '\n' + except IndexError: + continue + _add_my_conf_files(report, '/etc/mysql/my.cnf') + for f in os.listdir('/etc/mysql/conf.d'): + _add_my_conf_files(report, os.path.join('/etc/mysql/conf.d', f)) + try: + report['MySQLVarLibDirListing'] = unicode(os.listdir('/var/lib/mysql')) + except OSError: + report['MySQLVarLibDirListing'] = unicode(False) + +if __name__ == '__main__': + report = {} + add_info(report) + for key in report: + print '%s: %s' % (key, report[key].split('\n', 1)[0]) |