diff --git a/build/build_rpm.sh b/build/build_rpm.sh index c05ecc1..8443226 100755 --- a/build/build_rpm.sh +++ b/build/build_rpm.sh @@ -8,11 +8,11 @@ sh ./clean.sh perl -pe "s/%VERSION%/$VERSION/g" mysqltuner.spec.tpl > mysqltuner.spec mkdir -p $BUILD_DIR/mysqltuner-$VERSION -cp $BUILD_DIR/../mysqltuner.pl mysqltuner.spec $BUILD_DIR/../LICENSE $BUILD_DIR/../basic_passwords.txt $BUILD_DIR/mysqltuner-$VERSION +cp $BUILD_DIR/../mysqltuner.pl mysqltuner.spec $BUILD_DIR/../LICENSE $BUILD_DIR/../basic_passwords.txt $BUILD_DIR/../*.csv $BUILD_DIR/mysqltuner-$VERSION pod2man $BUILD_DIR/../mysqltuner.pl | gzip > $BUILD_DIR/mysqltuner-$VERSION/mysqltuner.1.gz tar czf $BUILD_DIR/mysqltuner-${VERSION}.tgz mysqltuner-$VERSION rpmbuild -ta mysqltuner-${VERSION}.tgz 2>&1 | tee -a ./build.log set -x -grep --color=never -E '^Wrote:' $BUILD_DIR/build.log | cut -d: -f2 | xargs -I{} mv {} . +grep --color=never -E '(Wrote|crit)\S*:' $BUILD_DIR/build.log | cut -d: -f2 | xargs -I{} mv {} . #rm -rf mysqltuner-$VERSION ./build.log diff --git a/build/mysqltuner.spec.tpl b/build/mysqltuner.spec.tpl index 9401a1f..1fde663 100644 --- a/build/mysqltuner.spec.tpl +++ b/build/mysqltuner.spec.tpl @@ -46,6 +46,6 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/man1/* %changelog -* Tue Jan 05 2015 Jean-Marie RENOUARD %VERSION%-1 +* Thu Jan 5 2015 Jean-Marie RENOUARD %VERSION%-1 - Initial RPM release diff --git a/mysqltuner.pl b/mysqltuner.pl index 0c447c7..5c4812e 100755 --- a/mysqltuner.pl +++ b/mysqltuner.pl @@ -152,6 +152,11 @@ my $basic_password_files = $basic_password_files = "/usr/share/mysqltuner/basic_passwords.txt" unless -f "$basic_password_files"; +# for RPM distributions +$opt{cvefile} = "/usr/share/mysqltuner/vulnerabilities.csv" + unless ( defined $opt{cvefile} and -f "$opt{cvefile}"); +$opt{cvefile} ='' unless -f "$opt{cvefile}"; + # my $outputfile = undef; $outputfile = abs_path( $opt{outputfile} ) unless $opt{outputfile} eq "0"; @@ -769,7 +774,7 @@ sub cve_recommendations { prettyprint "\n-------- CVE Security Recommendations -------------------------------------------"; unless ( defined($opt{cvefile}) && -f "$opt{cvefile}" ) { - infoprint "Skipped due to --cvefile option"; + infoprint "Skipped due to --cvefile option undefined"; return; }