From: Samuel VERSCHELDE Date: Mon, 10 Jun 2019 16:06:58 +0000 (+0200) Subject: Fix %post and %postun generation in kmodtool X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=01d1e88b1aad73f76b0071fba1a79d79bda24c96;p=zfs Fix %post and %postun generation in kmodtool During zfs-kmod RPM build, $(uname -r) gets unintentionally evaluated on the build host, once and for all. It should be evaluated during the execution of the scriptlets on the installation host. Escaping the $ character avoids evaluating it during build. Reviewed-by: Brian Behlendorf Reviewed-by: Olaf Faaland Reviewed-by: Neal Gompa Signed-off-by: Samuel Verschelde Closes #8866 --- diff --git a/scripts/kmodtool b/scripts/kmodtool index 27a14cdac..a632dd046 100755 --- a/scripts/kmodtool +++ b/scripts/kmodtool @@ -178,9 +178,9 @@ EOF else cat < /dev/null || : +[[ "\$(uname -r)" == "${kernel_uname_r}" ]] && ${prefix}/sbin/depmod -a > /dev/null || : %postun -n kmod-${kmodname}-${kernel_uname_r} -[[ "$(uname -r)" == "${kernel_uname_r}" ]] && ${prefix}/sbin/depmod -a > /dev/null || : +[[ "\$(uname -r)" == "${kernel_uname_r}" ]] && ${prefix}/sbin/depmod -a > /dev/null || : EOF fi