From a9fa210431e8480bf4e2715826199a3c7f22018f Mon Sep 17 00:00:00 2001 From: Mark Reynolds Date: Jul 18 2018 13:31:42 +0000 Subject: Ticket 49857 - RPM scriptlet for 389-ds-base-legacy-tools throws an error Bug Description: If no instances are present when the legacy tool subpackage is installed the RPM scriplet throws an error: line 29: [: -eq: unary operator expected Fix Description: The error occurs because a variable that counts the existing instances is not initialized. https://pagure.io/389-ds-base/issue/49857 Reviewed by: mreynolds (one line commit rule) --- diff --git a/rpm/389-ds-base.spec.in b/rpm/389-ds-base.spec.in index 7d99feb..99fdabd 100644 --- a/rpm/389-ds-base.spec.in +++ b/rpm/389-ds-base.spec.in @@ -544,6 +544,7 @@ fi echo looking for instances in %{_sysconfdir}/%{pkgname} > $output 2>&1 || : instbase="%{_sysconfdir}/%{pkgname}" +ninst=0 for dir in $instbase/slapd-* ; do echo dir = $dir >> $output 2>&1 || : if [ ! -d "$dir" ] ; then continue ; fi