Browse Source

Check for last version removal in preun - only run uninstall if removing the last version

Rich Megginson 20 years ago
parent
commit
29e9fa3d5d
1 changed files with 10 additions and 4 deletions
  1. 10 4
      ldapserver.spec.tmpl

+ 10 - 4
ldapserver.spec.tmpl

@@ -65,13 +65,19 @@ fi
 echo "Install finished.  Please run $RPM_INSTALL_PREFIX/setup/setup to set up the servers."
 
 %preun
-if [ -z "$RPM_INSTALL_PREFIX" ]; then
-	RPM_INSTALL_PREFIX=%{prefix}
+# only run uninstall if this is the last version of the package
+if [ "$1" = 0 ] ; then
+	if [ -z "$RPM_INSTALL_PREFIX" ]; then
+		RPM_INSTALL_PREFIX=%{prefix}
+	fi
+	cd $RPM_INSTALL_PREFIX
+	./uninstall -s -force
 fi
-cd $RPM_INSTALL_PREFIX
-./uninstall -s -force
 
 %changelog
+* Fri Apr  8 2005 Rich Megginson <[email protected]> 7.1-1
+- check for last version removal in preun
+
 * Tue Apr  5 2005 Rich Megginson <[email protected]> 7.1-1
 - make rpm name .flavor.rpm - flavor must be defined in rpmbuild