From 992eb78f5912ed52eb2cbbaffcc3a3c6a70ba8dd Mon Sep 17 00:00:00 2001 From: Bo Ren Date: Mon, 16 Jun 2025 18:02:22 +0800 Subject: [PATCH] no wait for shell execution Signed-off-by: Bo Ren --- 0001-no-wait-for-shell-execution.patch | 30 ++++++++++++++++++++++++++ rpm.spec | 6 +++++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 0001-no-wait-for-shell-execution.patch diff --git a/0001-no-wait-for-shell-execution.patch b/0001-no-wait-for-shell-execution.patch new file mode 100644 index 0000000..538815f --- /dev/null +++ b/0001-no-wait-for-shell-execution.patch @@ -0,0 +1,30 @@ +From 876514ecfa04d749a4666c726f29f434652ff78c Mon Sep 17 00:00:00 2001 +From: Liwei Ge +Date: Thu, 16 Jan 2025 10:30:21 +0800 +Subject: [PATCH] no wait for shell execution + +--- + lib/rpmlock.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/lib/rpmlock.c b/lib/rpmlock.c +index d693c4b..34645c7 100644 +--- a/lib/rpmlock.c ++++ b/lib/rpmlock.c +@@ -126,12 +126,11 @@ int rpmlockAcquire(rpmlock lock) + { + int locked = 0; /* assume failure */ + int myerrno = errno; +- int maywait = isatty(STDIN_FILENO); /* dont wait within scriptlets */ + errno = myerrno; + + if (lock) { + locked = rpmlock_acquire(lock, RPMLOCK_WRITE); +- if (!locked && (lock->openmode & RPMLOCK_WRITE) && maywait) { ++ if (!locked && (lock->openmode & RPMLOCK_WRITE)) { + rpmlog(RPMLOG_WARNING, _("waiting for %s lock on %s\n"), + lock->descr, lock->path); + locked = rpmlock_acquire(lock, (RPMLOCK_WRITE|RPMLOCK_WAIT)); +-- +2.43.5 + diff --git a/rpm.spec b/rpm.spec index 966a885..f77c13d 100644 --- a/rpm.spec +++ b/rpm.spec @@ -1,4 +1,4 @@ -%define anolis_release .0.2 +%define anolis_release .0.2.1 %define _legacy_common_support 1 # build against xz? %bcond_without xz @@ -188,6 +188,7 @@ Patch2003: 2004-rpm-anolis-support-sw_64.patch Patch2004: rpm-4.14.3-keep-compatibility-between-sw-and-other-architecture.patch Patch2005: rpm-4.14.3-Fix-compatibility-of-debugedit-tool-on-sw_64-platfor.patch Patch2006: rpm-4.14.3-sw8a.patch +Patch2007: 0001-no-wait-for-shell-execution.patch # Partially GPL/LGPL dual-licensed and some bits with BSD # SourceLicense: (GPLv2+ and LGPLv2+ with exceptions) and BSD @@ -767,6 +768,9 @@ fi %doc doc/librpm/html/* %changelog +* Mon Jun 16 2025 Liwei Ge - 4.14.4-32.0.2.1 +- no wait for lock as exec in shell + * Tue May 27 2025 happy_orange - 4.14.4-32.0.2 - switch rpmdb to sqlite -- Gitee