aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorloli10K <[email protected]>2019-09-04 00:20:39 +0200
committerBrian Behlendorf <[email protected]>2019-09-03 15:20:39 -0700
commita49dbbbe06c6c0d0c401530c756c0c056d49fbb7 (patch)
tree3a272d13495044711c9b2115d9ef7739a2440bf9
parenta6a2877774faa5abfc0491e66c8361da759d22fd (diff)
Fix zfs-dkms .deb package warning in prerm script
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
-rw-r--r--rpm/generic/zfs-dkms.spec.in2
1 files changed, 1 insertions, 1 deletions
diff --git a/rpm/generic/zfs-dkms.spec.in b/rpm/generic/zfs-dkms.spec.in
index 568bef988..d87293686 100644
--- a/rpm/generic/zfs-dkms.spec.in
+++ b/rpm/generic/zfs-dkms.spec.in
@@ -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