]> granicus.if.org Git - zfs/commitdiff
Fix zfs-dkms .deb package warning in prerm script
authorloli10K <loli10K@users.noreply.github.com>
Tue, 3 Sep 2019 22:20:39 +0000 (00:20 +0200)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 3 Sep 2019 22:20:39 +0000 (15:20 -0700)
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 <behlendorf1@llnl.gov>
Signed-off-by: loli10K <ezomori.nozomu@gmail.com>
Closes #9271

rpm/generic/zfs-dkms.spec.in

index 568bef988ca036470eb62f5642553ec9ba56a4cf..d87293686422990da555bfed35c7860409ebc187 100644 (file)
@@ -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