From c83aaa8efe24753dea6ce804f0b37597b6dacae9 Mon Sep 17 00:00:00 2001 From: yixiangzhike Date: Fri, 16 Aug 2024 14:48:57 +0800 Subject: [PATCH] fix missing trailer space, and don't treat backslash as escape char --- ...o-not-treat-backslash-as-escape-char.patch | 33 +++++++++++++++++++ rpmrebuild.spec | 6 +++- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 Fix-missing-trailer-space-and-do-not-treat-backslash-as-escape-char.patch diff --git a/Fix-missing-trailer-space-and-do-not-treat-backslash-as-escape-char.patch b/Fix-missing-trailer-space-and-do-not-treat-backslash-as-escape-char.patch new file mode 100644 index 0000000..d139a19 --- /dev/null +++ b/Fix-missing-trailer-space-and-do-not-treat-backslash-as-escape-char.patch @@ -0,0 +1,33 @@ +From 58f8f36e276432f47e04fed8e14aaef23a5efa06 Mon Sep 17 00:00:00 2001 +From: yixiangzhike +Date: Fri, 16 Aug 2024 14:01:15 +0800 +Subject: [PATCH] Fix missing trailer space and do not treat backslash as + escape char + +Trailer space may be part of filename. +Character backslash may be part of filename also. +--- + rpmrebuild_files.sh | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/rpmrebuild_files.sh b/rpmrebuild_files.sh +index 30955c0..7329742 100755 +--- a/rpmrebuild_files.sh ++++ b/rpmrebuild_files.sh +@@ -83,7 +83,12 @@ while :; do + read file_verify + read file_lang + read file_cap +- read file ++ # Trailer space may be part of filename. ++ OLD_IFS="$IFS" ++ IFS="" ++ # Character backslash may be part of filename also. ++ read -r file ++ IFS="$OLD_IFS" + + # on fedora 33, centos 7, 8, the root directory "/" is owned by filesystem package + # but for rpmrebuild, BUILDROOT is juste a symlink, not a directory (cf RpmBuild in rpmrebuild.sh) +-- +2.33.0 + diff --git a/rpmrebuild.spec b/rpmrebuild.spec index e0a58bf..d60a51d 100644 --- a/rpmrebuild.spec +++ b/rpmrebuild.spec @@ -1,6 +1,6 @@ Name: rpmrebuild Version: 2.18 -Release: 7 +Release: 8 Summary: A tool to build a rpm file from the rpm database License: GPLv2+ URL: http://rpmrebuild.sourceforge.net @@ -9,6 +9,7 @@ Source0: https://downloads.sourceforge.net/rpmrebuild/%{name}-%{version}. Patch6000: backport-Set-the-directory-mode-to-instead-of-omit.patch Patch9000: Add-macros-_binaries_in_noarch_packages_terminate_bu.patch +Patch9001: Fix-missing-trailer-space-and-do-not-treat-backslash-as-escape-char.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch @@ -60,6 +61,9 @@ rm -rf $RPM_BUILD_ROOT%{_mandir}/fr_FR.UTF-8/man1/ %{_mandir}/fr/man1/*.gz %changelog +* Tue Aug 20 2024 yixiangzhike - 2.18-8 +- fix missing trailer space, and don't treat backslash as escape char + * Thu Aug 1 2024 yixiangzhike - 2.18-7 - revert "avoid truncate trailer space and do not escape backslash when read filename"