[pw-ci] [PATCH] post_pw: Allow for whitespace on input

Aaron Conole aconole at redhat.com
Fri Mar 4 21:18:11 UTC 2022


Michael Santana <msantana at redhat.com> writes:

> I am not too familiar with xargs but a quick look at the man page
> tells me that it defaults to just doing echo without any arguments.
> From my limited testing it did get rid of starting/trailing white
> spaces. If this is the intended use then this patch LGTM

Thanks - I applied it, although without an ACK.

> On Thu, Mar 3, 2022 at 2:36 PM Aaron Conole <aconole at redhat.com> wrote:
>>
>> The input parsing side is a bit too rigid, which prevents adding reports
>> from all different robots.  Allow the variables to have extra whitespace
>> and trim it out when it arrives.
>>
>> Signed-off-by: Aaron Conole <aconole at redhat.com>
>> ---
>>  post_pw.sh | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/post_pw.sh b/post_pw.sh
>> index 2998644..e98e8ab 100755
>> --- a/post_pw.sh
>> +++ b/post_pw.sh
>> @@ -60,7 +60,7 @@ send_post() {
>>      fi
>>
>>      context="$(echo "$report" | sed -n 's/.*Test-Label: //p' | tr ' ' '_' | tr ':' '-')"
>> -    state="$(echo "$report" | sed -n 's/.*Test-Status: //p')"
>> +    state="$(echo "$report" | sed -n 's/.*Test-Status: //p' | xargs)"
>>      description="$(echo "$report" | sed -ne 's/^_\(.*\)_$/\1/p')"
>>      patch_id="$(echo "$report" | sed -ne 's at .*href.*/patch[es]*/\(.*\)/\?".*@\1 at ip' | sed 's@/@@')"
>>      target_url="$link"
>> --
>> 2.31.1
>>



More information about the Pwci mailing list