From 4e3de24b61b9116f0138d22ec687d0a759b29967 Mon Sep 17 00:00:00 2001
From: LOLi <loli10K@users.noreply.github.com>
Date: Tue, 9 May 2017 20:51:40 +0200
Subject: [PATCH] Fix zfs .deb package warning in prerm script

Debian zfs 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:

   "zfs.prerm: line 2: [: remove: integer expression expected"

Modify the if-condition to avoid the warning.

Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: loli10K <ezomori.nozomu@gmail.com>
Closes #6108
---
 rpm/generic/zfs.spec.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rpm/generic/zfs.spec.in b/rpm/generic/zfs.spec.in
index bab7c5c61d..2ad4b693c1 100644
--- a/rpm/generic/zfs.spec.in
+++ b/rpm/generic/zfs.spec.in
@@ -257,7 +257,7 @@ exit 0
 %if 0%{?_systemd}
 %systemd_preun %{systemd_svcs}
 %else
-if [ $1 -eq 0 ] && [ -x /sbin/chkconfig ]; then
+if [ "$1" = "0" ] && [ -x /sbin/chkconfig ]; then
     /sbin/chkconfig --del zfs-import
     /sbin/chkconfig --del zfs-mount
     /sbin/chkconfig --del zfs-share