Skip to content

Commit

Permalink
Fix zfs-dkms .deb package warning in prerm script
Browse files Browse the repository at this point in the history
Debian zfs-dkms package generated by alien doesn't call the prerm script
(rpm's %preun) with an integer as first parameter, which results in the
following warning when the package is uninstalled:

   "zfs-dkms.prerm: line 3: [: remove: integer expression expected"

Modify the if-condition to avoid the warning.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: loli10K <[email protected]>
Closes #9271
  • Loading branch information
loli10K authored and behlendorf committed Sep 3, 2019
1 parent a6a2877 commit a49dbbb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rpm/generic/zfs-dkms.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ exit 1

%preun
# Are we doing an upgrade?
if [ $1 -ne 0 ] ; then
if [ "$1" = "1" -o "$1" = "upgrade" ] ; then
# Yes we are. Are we upgrading to a new ZFS version?
NEWEST_VER=$(dkms status zfs | sed 's/,//g' | sort -r -V | awk '/installed/{print $2; exit}')
if [ "$NEWEST_VER" != "%{version}" ] ; then
Expand Down

0 comments on commit a49dbbb

Please sign in to comment.