Skip to content

Commit 5f3775a

Browse files
authored
Merge pull request #724 from jmrenouard/master
Last updates
2 parents b44447e + d0ec7ea commit 5f3775a

8 files changed

Lines changed: 105 additions & 34 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ test_db/**
1616
result*
1717
result_*
1818
sql/*.sql
19-
sql/*.csv
19+
sql/*.csv
20+
cve.csv

FEATURES.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@ Features list for option: --feature (dev only)
22
---
33

44

5-
* calculations
6-
* compare_tuner_version
7-
* cpu_cores
85
* cve_recommendations
9-
* grep_file_contents
106
* log_file_recommendations
117
* make_recommendations
128
* mariadb_aria
@@ -17,7 +13,6 @@ Features list for option: --feature (dev only)
1713
* mariadb_threadpool
1814
* mariadb_tokudb
1915
* mariadb_xtradb
20-
* merge_hash
2116
* mysql_databases
2217
* mysql_indexes
2318
* mysql_innodb
@@ -29,14 +24,8 @@ Features list for option: --feature (dev only)
2924
* mysql_table_structures
3025
* mysql_tables
3126
* mysql_triggers
32-
* mysql_version_eq
33-
* mysql_version_ge
34-
* mysql_version_le
3527
* mysql_views
36-
* os_setup
37-
* pretty_uptime
3828
* security_recommendations
3929
* system_recommendations
40-
* update_tuner_version
4130
* validate_mysql_version
4231
* validate_tuner_version

Makefile

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
VERSION=$(shell grep '\- Version ' mysqltuner.pl | awk '{ print $$NF}')
2+
UPDATE_SUB_VERSION=$(shell echo $(VERSION) | awk -F. '{ print $$1"."$$2"."$$3+1 }')
3+
UPDATE_MINOR_VERSION=$(shell echo $(VERSION) | awk -F. '{ print $$1"."$$2+1".0" }')
4+
UPDATE_MAJOR_VERSION=$(shell echo $(VERSION) | awk -F. '{ print $$1+1".0.0" }')
5+
6+
all: generate_cve generate_features generate_usage tidy increment_sub_version
7+
8+
help:
9+
@echo "Usage: make <target>"
10+
@echo " help: Show this help"
11+
@echo " generate_usage: Generate USAGE.md"
12+
@echo " generate_cve: Generate vulnerabilities.csv"
13+
@echo " generate_features: Generate FEATURES.md"
14+
@echo " tidy: Tidy mysqltuner.pl"
15+
@echo " installdep_debian: Install dependencies on Debian"
16+
@echo " increment_sub_version: Increment sub version"
17+
@echo " increment_minor_version: Increment minor version"
18+
@echo " increment_major_version: Increment major version"
19+
@echo " push: Push to GitHub"
20+
21+
22+
installdep_debian:
23+
apt install -y cpanminus libpod-markdown-perl libwww-mechanize-gzip-perl perltidy dos2unix
24+
cpanm File::Util
25+
26+
tidy:
27+
dos2unix ./mysqltuner.pl
28+
perltidy -b ./mysqltuner.pl
29+
git add ./mysqltuner.pl
30+
git commit -m "Indenting mysqltuner at $(shell date --iso=seconds)"
31+
32+
generate_usage:
33+
pod2markdown mysqltuner.pl >USAGE.md
34+
git add ./USAGE.md
35+
git commit -m "Generate USAGE.md at $(shell date --iso=seconds)"
36+
37+
generate_cve:
38+
perl ./build/updateCVElist.pl
39+
git add ./vulnerabilities.csv
40+
git commit -m "Generate CVE list at $(shell date --iso=seconds)"
41+
42+
generate_features:
43+
perl ./build/genFeatures.sh
44+
git add ./FEATURES.md
45+
git commit -m "Generate FEATURES.md at $(shell date --iso=seconds)"
46+
47+
increment_sub_version:
48+
@echo "Incrementing sub version from $(VERSION) to $(UPDATE_SUB_VERSION)"
49+
sed -i "s/$(VERSION)/$(UPDATE_SUB_VERSION)/" mysqltuner.pl *.md
50+
git add ./*.md ./mysqltuner.pl
51+
git commit -m "Generate $(UPDATE_SUB_VERSION) sub version at $(shell date --iso=seconds)"
52+
53+
increment_minor_version:
54+
@echo "Incrementing minor version from $(VERSION) to $(UPDATE_MINOR_VERSION)"
55+
sed -i "s/$(VERSION)/$(UPDATE_MINOR_VERSION)/" mysqltuner.pl *.md
56+
git add ./*.md ./mysqltuner.pl
57+
git commit -m "Generate $(UPDATE_SUB_VERSION) minor version at $(shell date --iso=seconds)"
58+
59+
increment_major_version:
60+
@echo "Incrementing major version from $(VERSION) to $(UPDATE_MAJOR_VERSION)"
61+
sed -i "s/$(VERSION)/$(UPDATE_MAJOR_VERSION)/" mysqltuner.pl *.md
62+
git add ./*.md ./mysqltuner.pl
63+
git commit -m "Generate $(UPDATE_SUB_VERSION) major version at $(shell date --iso=seconds)"
64+
65+
push:
66+
git push

USAGE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# NAME
22

3-
MySQLTuner 2.2.7 - MySQL High Performance Tuning Script
3+
MySQLTuner 2.2.9 - MySQL High Performance Tuning Script
44

55
# IMPORTANT USAGE GUIDELINES
66

build/genFeatures.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
(
55
export LANG=C
66
echo -e "Features list for option: --feature (dev only)\n---\n\n"
7-
grep -E '^sub ' ../mysqltuner.pl | \
7+
grep -E '^sub ' ./mysqltuner.pl | \
88
perl -pe 's/sub //;s/\s*\{//g' | \
99
sort -n | \
1010
perl -pe 's/^/* /g' | \
11-
grep -vE '(get_|close_|check_|memerror|human_size|string2file|file2|arr2|dump|which|percentage|trim|is_|hr_|info|print|select|wrap|remove_)'
12-
) > ../FEATURES.md
13-
cat ../FEATURES.md
11+
grep -vE '(get_|close_|check_|memerror|cpu_cores|compare_tuner_version|grep_file_contents|update_tuner_version|mysql_version_|calculations|merge_hash|os_setup|pretty_uptime|update_tuner_version|human_size|string2file|file2|arr2|dump|which|percentage|trim|is_|hr_|info|print|select|wrap|remove_)'
12+
) > ./FEATURES.md
13+
cat ./FEATURES.md

build/updateCVElist.pl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ sub AUTOLOAD {
4949

5050
my @versions;
5151
my $temp;
52-
unlink '../vulnerabilities.csv' if -f '../vulnerabilities.csv';
52+
unlink './vulnerabilities.csv' if -f './vulnerabilities.csv';
5353
open(CVE, 'cve.csv') or die("Could not open file.");
5454
foreach my $line (<CVE>) {
5555
if ($line =~ /(mysql|mariadb|percona)/i
@@ -69,7 +69,7 @@ sub AUTOLOAD {
6969
#print $vers."\n".Dumper @nb;
7070
#print "$line";
7171
#exit 0 if ($line =~/before/i) ;
72-
$f->write_file('file' => '../vulnerabilities.csv', 'content' => "$nb[0].$nb[1].$nb[2];$nb[0];$nb[1];$nb[2];$line", 'mode' => 'append');
72+
$f->write_file('file' => './vulnerabilities.csv', 'content' => "$nb[0].$nb[1].$nb[2];$nb[0];$nb[1];$nb[2];$line", 'mode' => 'append');
7373
}
7474
}
7575
}

mysqltuner.pl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env perl
2-
# mysqltuner.pl - Version 2.2.8
2+
# mysqltuner.pl - Version 2.2.9
33
# High Performance MySQL Tuning Script
44
# Copyright (C) 2015-2023 Jean-Marie Renouard - jmrenouard@gmail.com
55
# Copyright (C) 2006-2023 Major Hayden - major@mhtx.net
@@ -57,7 +57,7 @@ package main;
5757
#use Env;
5858

5959
# Set up a few variables for use in the script
60-
my $tunerversion = "2.2.8";
60+
my $tunerversion = "2.2.9";
6161
my ( @adjvars, @generalrec );
6262

6363
# Set defaults
@@ -7357,7 +7357,7 @@ sub which {
73577357
73587358
=head1 NAME
73597359
7360-
MySQLTuner 2.2.8 - MySQL High Performance Tuning Script
7360+
MySQLTuner 2.2.9 - MySQL High Performance Tuning Script
73617361
73627362
=head1 IMPORTANT USAGE GUIDELINES
73637363

0 commit comments

Comments
 (0)