From aaa4e01d982018570eb1517dca359a6e3cc3278a Mon Sep 17 00:00:00 2001 From: ewt Date: Thu, 8 Jan 1998 15:32:10 +0000 Subject: [PATCH] don't run scripts in test mode CVS patchset: 1942 CVS date: 1998/01/08 15:32:10 --- lib/uninstall.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/lib/uninstall.c b/lib/uninstall.c index 32bae98..118eebf 100644 --- a/lib/uninstall.c +++ b/lib/uninstall.c @@ -243,12 +243,14 @@ int rpmRemovePackage(char * prefix, rpmdb db, unsigned int offset, int flags) { rmmess = "removing"; } - rpmMessage(RPMMESS_DEBUG, "running preuninstall script (if any)\n"); + if (!(flags & RPMUNINSTALL_TEST)) { + rpmMessage(RPMMESS_DEBUG, "running preuninstall script (if any)\n"); - if (runScript(prefix, h, RPMTAG_PREUN, RPMTAG_PREUNPROG, scriptArg, - flags & RPMUNINSTALL_NOSCRIPTS, 0)) { - headerFree(h); - return 1; + if (runScript(prefix, h, RPMTAG_PREUN, RPMTAG_PREUNPROG, scriptArg, + flags & RPMUNINSTALL_NOSCRIPTS, 0)) { + headerFree(h); + return 1; + } } rpmMessage(RPMMESS_DEBUG, "%s files test = %d\n", rmmess, flags & RPMUNINSTALL_TEST); @@ -304,9 +306,11 @@ int rpmRemovePackage(char * prefix, rpmdb db, unsigned int offset, int flags) { free(fileMd5List); } - rpmMessage(RPMMESS_DEBUG, "running postuninstall script (if any)\n"); - runScript(prefix, h, RPMTAG_POSTUN, RPMTAG_POSTUNPROG, scriptArg, - flags & RPMUNINSTALL_NOSCRIPTS, 0); + if (!(flags & RPMUNINSTALL_TEST)) { + rpmMessage(RPMMESS_DEBUG, "running postuninstall script (if any)\n"); + runScript(prefix, h, RPMTAG_POSTUN, RPMTAG_POSTUNPROG, scriptArg, + flags & RPMUNINSTALL_NOSCRIPTS, 0); + } headerFree(h); -- 2.7.4