From 3e052f3a743bc47e867890eb826875e16c1f1df1 Mon Sep 17 00:00:00 2001 From: Florian Festi Date: Mon, 11 Dec 2023 16:01:23 +0100 Subject: [PATCH] Fix warning if file removal fails Resolves: RHEL-14598 RHEL-14599 RHEL-14600 --- ...rint-full-path-if-file-removal-fails.patch | 32 +++++++++++++++++++ rpm.spec | 12 ++++--- 2 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 0001-Print-full-path-if-file-removal-fails.patch diff --git a/0001-Print-full-path-if-file-removal-fails.patch b/0001-Print-full-path-if-file-removal-fails.patch new file mode 100644 index 0000000..266bd69 --- /dev/null +++ b/0001-Print-full-path-if-file-removal-fails.patch @@ -0,0 +1,32 @@ +From f1503ab6e898430b80017c0f8347860f3a74d5bb Mon Sep 17 00:00:00 2001 +From: Florian Festi +Date: Mon, 11 Dec 2023 15:50:15 +0100 +Subject: [PATCH] Print full path if file removal fails + +For normal debug output the basename of the files are sufficient as when +debugging is enabled the directories are also printed. But here the +warning is given without a debug flag so we need the full context right +there. +--- + lib/fsm.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/lib/fsm.c b/lib/fsm.c +index fcd764648..2189bd84c 100644 +--- a/lib/fsm.c ++++ b/lib/fsm.c +@@ -1174,9 +1174,9 @@ int rpmPackageFilesRemove(rpmts ts, rpmte te, rpmfiles files, + + if (rc) { + int lvl = strict_erasures ? RPMLOG_ERR : RPMLOG_WARNING; +- rpmlog(lvl, _("%s %s: remove failed: %s\n"), ++ rpmlog(lvl, _("%s %s%s: remove failed: %s\n"), + S_ISDIR(fp->sb.st_mode) ? _("directory") : _("file"), +- fp->fpath, strerror(errno)); ++ rpmfiDN(fi), fp->fpath, strerror(errno)); + } + } + +-- +2.43.0 + diff --git a/rpm.spec b/rpm.spec index 4196c16..bd597be 100644 --- a/rpm.spec +++ b/rpm.spec @@ -32,7 +32,7 @@ %global rpmver 4.16.1.3 #global snapver rc1 -%global rel 27 +%global rel 28 %global sover 9 %global srcver %{rpmver}%{?snapver:-%{snapver}} @@ -102,10 +102,11 @@ Patch129: 0001-Swap-over-to-dirfd-basename-based-operation-within-t.patch Patch130: 0001-Use-file-state-machine-from-rpm-4.19.patch Patch131: 0001-Emit-full-paths-for-file-disposition-diagnostics-on-.patch Patch132: 0001-Fix-wrong-return-code-on-O_DIRECTORY-open-of-invalid.patch +Patch133: 0001-Print-full-path-if-file-removal-fails.patch -Patch133: 0001-Fix-short-circuiting-of-version-strings-in-expressio.patch -Patch134: 0001-Fix-a-copy-paste-help-description-of-whatconflicts-R.patch -Patch135: 0001-Expose-and-document-rpmdb-verifydb-operation.patch +Patch140: 0001-Fix-short-circuiting-of-version-strings-in-expressio.patch +Patch141: 0001-Fix-a-copy-paste-help-description-of-whatconflicts-R.patch +Patch142: 0001-Expose-and-document-rpmdb-verifydb-operation.patch # These are not yet upstream Patch906: rpm-4.7.1-geode-i686.patch @@ -655,6 +656,9 @@ fi %doc doc/librpm/html/* %changelog +* Mon Dec 11 2023 Florian Festi - 4.16.1.3-28 +- Fix warning if file removal fails + * Mon Nov 27 2023 Florian Festi - 4.16.1.3-27 - Fix short circuiting of version strings in expressions (RHEL-15688) - Fix description of whatconflicts in the man page (RHEL-6303)