Merge pull request #113969 from peterhoeg/f/mysqltuner

mysqltuner: do not pollute global /share
This commit is contained in:
davidak 2021-02-22 05:13:58 +01:00 committed by GitHub
commit e8c545f2b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5,16 +5,15 @@ stdenv.mkDerivation rec {
version = "1.7.21";
src = fetchFromGitHub {
owner = "major";
repo = "MySQLTuner-perl";
rev = version;
owner = "major";
repo = "MySQLTuner-perl";
rev = version;
sha256 = "sha256-Yv1XjD8sZcmGr2SVD6TEElUH7vspJ61WwQwfXLOrao0=";
};
postPatch = ''
substituteInPlace mysqltuner.pl \
--replace '$basic_password_files = "/usr/share/mysqltuner/basic_passwords.txt"' "\$basic_password_files = \"$out/share/basic_passwords.txt\"" \
--replace '$opt{cvefile} = "/usr/share/mysqltuner/vulnerabilities.csv"' "\$opt{cvefile} = \"$out/share/vulnerabilities.csv\""
--replace '/usr/share' "$out/share"
'';
buildInputs = [ perl ];
@ -22,10 +21,8 @@ stdenv.mkDerivation rec {
installPhase = ''
runHook preInstall
mkdir -p "$out/bin"
install -Dm 0755 mysqltuner.pl "$out/bin/mysqltuner"
install -Dm 0644 basic_passwords.txt "$out/share/basic_passwords.txt"
install -Dm 0644 vulnerabilities.csv "$out/share/vulnerabilities.csv"
install -Dm0555 mysqltuner.pl $out/bin/mysqltuner
install -Dm0444 -t $out/share/mysqltuner basic_passwords.txt vulnerabilities.csv
runHook postInstall
'';