Skip to content

Commit

Permalink
Always remove during spl-dkms uninstall/update
Browse files Browse the repository at this point in the history
Always do a dkms remove during %preun so that no cruft is left behind after upgrade or uninstall.

Closes openzfs#476

Signed-off-by: Nathaniel Clark <Nathaniel.Clark@misrule.us>
  • Loading branch information
utopiabound committed Sep 29, 2015
1 parent 2ebe396 commit a86b56d
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions rpm/generic/spl-dkms.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,8 @@ echo -e "support or upgrade DKMS to a more current version."
exit 1

%preun
# 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
echo -e "Uninstall of %{module} module (version %{version}) beginning:"
dkms remove -m %{module} -v %{version} --all --rpm_safe_upgrade
exit 0

%changelog
Expand Down

2 comments on commit a86b56d

@behlendorf
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@utopiabound thanks for the patch. This may take a little more thought, because this effectively reverts commit 4cdcdbf. This change was originally put in place to handle the case of the fast moving test repositories where only the release is updated. It would be nice if we could cleanly handle both cases somehow.

@behlendorf
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What appears to have happened in the dkms location for that spl/zfs.release file changed so this check is now always failing and nothing ever gets removed. This clearly wasn't as robust solution as I hoped. However, since we're now always bumping the version number and not just the release you fix should address the issue.

Please sign in to comment.