]> git.proxmox.com Git - mirror_zfs.git/commitdiff
RPM: Remove old versions of DKMS on upgrade
authorColMelvin <chris.lindee+github@gmail.com>
Fri, 15 May 2020 03:51:33 +0000 (22:51 -0500)
committerGitHub <noreply@github.com>
Fri, 15 May 2020 03:51:33 +0000 (20:51 -0700)
Due to a mismatch between the text and a regex looking for that text,
the `%preuninstall` script would never run the `dkms remove` command
necessary to avoid corrupting the DKMS data configuration.  Increase
regex specificity to avoid this issue.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Chris Lindee <chris.lindee+github@gmail.com>
Closes: #9891
Closes #10327

rpm/generic/zfs-dkms.spec.in

index f849125a4a7cc5f7a4eb2e76a62c390c9b088afa..29e8fd7dde0d8ab770898390f062b049b11c07ed 100644 (file)
@@ -93,7 +93,7 @@ fi
 CONFIG_H="/var/lib/dkms/%{module}/%{version}/*/*/%{module}_config.h"
 SPEC_META_ALIAS="@PACKAGE@-@VERSION@-@RELEASE@"
 DKMS_META_ALIAS=`cat $CONFIG_H 2>/dev/null |
-    awk -F'"' '/META_ALIAS/ { print $2; exit 0 }'`
+    awk -F'"' '/META_ALIAS\s+"/ { print $2; exit 0 }'`
 if [ "$SPEC_META_ALIAS" = "$DKMS_META_ALIAS" ]; then
     echo -e
     echo -e "Uninstall of %{module} module ($SPEC_META_ALIAS) beginning:"