From bd7425df5d90d462090859d6e4dacecc15edb8fc Mon Sep 17 00:00:00 2001 From: lcrpkking Date: Thu, 18 May 2023 02:20:23 +0000 Subject: [PATCH] fix: whitespace in filename or dirname Signed-off-by: lcrpkking --- pyporter/pyporter.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/pyporter/pyporter.py b/pyporter/pyporter.py index 448fcdf..fcd06ca 100755 --- a/pyporter/pyporter.py +++ b/pyporter/pyporter.py @@ -540,20 +540,23 @@ def build_spec(porter, output): print("if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi") print("pushd %{buildroot}") print("if [ -d usr/lib ]; then") - print("\tfind usr/lib -type f -printf \"/%h/%f\\n\" >> filelist.lst") + # we double quota the path for the case: + # whitespace in filename or dirname + # see: https://rpm-list.redhat.narkive.com/7WUOZXa6/basic-question-space-in-file-name + print("\tfind usr/lib -type f -printf \"\\\"/%h/%f\\\"\\n\" >> filelist.lst") print("fi") print("if [ -d usr/lib64 ]; then") - print("\tfind usr/lib64 -type f -printf \"/%h/%f\\n\" >> filelist.lst") + print("\tfind usr/lib64 -type f -printf \"\\\"/%h/%f\\\"\\n\" >> filelist.lst") print("fi") print("if [ -d usr/bin ]; then") - print("\tfind usr/bin -type f -printf \"/%h/%f\\n\" >> filelist.lst") + print("\tfind usr/bin -type f -printf \"\\\"/%h/%f\\\"\\n\" >> filelist.lst") print("fi") print("if [ -d usr/sbin ]; then") - print("\tfind usr/sbin -type f -printf \"/%h/%f\\n\" >> filelist.lst") + print("\tfind usr/sbin -type f -printf \"\\\"/%h/%f\\\"\\n\" >> filelist.lst") print("fi") print("touch doclist.lst") print("if [ -d usr/share/man ]; then") - print("\tfind usr/share/man -type f -printf \"/%h/%f.gz\\n\" >> doclist.lst") + print("\tfind usr/share/man -type f -printf \"\\\"/%h/%f.gz\\\"\\n\" >> doclist.lst") print("fi") print("popd") print("mv %{buildroot}/filelist.lst .") -- Gitee