From db4f5b5e9cdf9877d0308ff672a07b05fae24726 Mon Sep 17 00:00:00 2001 From: Ilia Ross Date: Sun, 28 Dec 2025 19:39:52 +0200 Subject: [PATCH] Fix to skip uninstall when package is replaced by rename MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit *Note: This is to support clean upgrade and replacement of wbm-* → webmin-* modules --- makemodulerpm.pl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/makemodulerpm.pl b/makemodulerpm.pl index c7e83a9be..1b8c95240 100755 --- a/makemodulerpm.pl +++ b/makemodulerpm.pl @@ -551,6 +551,9 @@ if [ "$istheme" = "1" -a "\$1" = "0" ]; then fi # Run the pre-uninstall script, if we are not upgrading if [ "$prog" = "webmin" -a "\$1" = "0" -a -r "/usr/libexec/$prog/$mod/uninstall.pl" ]; then + # Skip if replaced by a different package (wbm-foo - webmin-foo) + owner=\$(rpm -qf --qf '%%{NAME}\\n' "/usr/libexec/$prog/$mod/uninstall.pl" 2>/dev/null || true) + [ -n "\$owner" -a "\$owner" != "%{name}" ] && exit 0 cd /usr/libexec/$prog WEBMIN_CONFIG=/etc/$prog WEBMIN_VAR=/var/$prog /usr/libexec/$prog/run-uninstalls.pl $mod fi