]> granicus.if.org Git - zfs/commitdiff
Fix DKMS package upgrade and packager
authorBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 29 May 2014 21:06:32 +0000 (14:06 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 30 May 2014 18:20:51 +0000 (11:20 -0700)
Running 'yum upgrade spl-dkms' package could appear to work properly
and still leave you with no spl modules installed.  This will occur
when only the spl release, and not the version, are incremented.
This may be the case for a fast moving spl-testing repository.

During the upgrade process DKMS will realize that spl-x.y.z is already
installed and remove it.  DKMS then correctly builds the new modules
for spl-x.y.z.  However, as a final step when the old spl-x.y.z-r is
removed the %preun script runs and removes the newly build modules.
To handle this case the %preun script has been updated to only run
when the installed version exactly matches the full spec file version.

This change also updated ChangeLog section based on the DKMS
reference spec file.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
rpm/generic/spl-dkms.spec.in

index d0a649036d21ecc663d854209eb8b77e45557a25..6d8e058cb01acb3244c0700baf05bed2df683bfd 100644 (file)
@@ -1,3 +1,5 @@
+%{?!packager: %define packager Brian Behlendorf <behlendorf1@llnl.gov>}
+
 %define module  @PACKAGE@
 %define mkconf  scripts/dkms.mkconf
 
@@ -60,11 +62,16 @@ echo -e "support or upgrade DKMS to a more current version."
 exit 1
 
 %preun
-dkms remove -m %{module} -v %{version} --all --rpm_safe_upgrade
+# Only remove the modules if they are for this %{version}-%{release}.  A
+# package upgrade can replace them if only the %{release} is changed.
+RELEASE="/var/lib/dkms/%{module}/%{version}/build/%{module}.release"
+if [ -f $RELEASE ] && [ `cat $RELEASE`%{?dist} = "%{version}-%{release}" ]; then
+    echo -e
+    echo -e "Uninstall of %{module} module (version %{version}) beginning:"
+    dkms remove -m %{module} -v %{version} --all --rpm_safe_upgrade
+fi
 exit 0
 
 %changelog
-* Wed Aug 21 2013 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.2-1
-- Released 0.6.2-1
-* Fri Mar 22 2013 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.1-1
-- First official stable release.
+* %(date "+%a %b %d %Y") %packager %{version}-%{release}
+- Automatic build by DKMS