From 25aa5db3fd956e99ccb2074a21b7ef650eacc7e8 Mon Sep 17 00:00:00 2001 From: Mooffie Date: Mon, 6 Mar 2017 19:16:24 +0200 Subject: [PATCH] extfs: rpm: wrap variable in quotes. Our goal is to replace the 'echo' with 'printf' on this line, for the reason described in the previous commit. But before we do this we need to wrap one variable in quotes. This preliminary step does not affect the output of the helper. As for using "tr \n ' '": this mimics the current behavior (when using no quotes around the variable, newlines are converted to spaces by the shell; now that we do have quotes we need to do this conversion ourselves). An alternative is to tweak the sed script to be smarter, but it turns out it's not a simple task. Signed-off-by: Mooffie --- src/vfs/extfs/helpers/rpm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/vfs/extfs/helpers/rpm b/src/vfs/extfs/helpers/rpm index c41732d87..39f53c929 100755 --- a/src/vfs/extfs/helpers/rpm +++ b/src/vfs/extfs/helpers/rpm @@ -111,7 +111,8 @@ mcrpmfs_getAllNeededTags() "|PROVIDES=%{PROVIDES} %{PROVIDEFLAGS:depflags} %{PROVIDEVERSION}"\ ${tag_CONFLICTS}\ "|PACKAGER=%{PACKAGER}" \ - "${rpm_filename}" + "${rpm_filename}" \ + | tr '\n' ' ' # The newlines in DESCRIPTION mess with the sed script in mcrpmfs_getOneTag(). } mcrpmfs_getRawOneTag() @@ -121,7 +122,7 @@ mcrpmfs_getRawOneTag() mcrpmfs_getOneTag() { - echo $AllTAGS | $SED "s/.*|${1}=//" | cut -d '|' -f 1 + echo "$AllTAGS" | $SED "s/.*|${1}=//" | cut -d '|' -f 1 } mcrpmfs_printOneMetaInfo()