[1/1] create-pull-request: fix sed command for SUBJECT

Submitted by Robert Yang on Dec. 20, 2018, 8:04 a.m. | Patch ID: 157355

Details

Message ID 3d6fbb3825ef92b93f0e99d4ff06af2156ecac71.1545293075.git.liezhi.yang@windriver.com
State New
Headers show

Commit Message

Robert Yang Dec. 20, 2018, 8:04 a.m.
Fixed when SUBJECT contains slash(/):
sed: -e expression #1, char 35: unknown option to `s'

Use '#' as separator to fix the problem.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
 scripts/create-pull-request | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/scripts/create-pull-request b/scripts/create-pull-request
index 280880b..ff0f7e6 100755
--- a/scripts/create-pull-request
+++ b/scripts/create-pull-request
@@ -278,7 +278,7 @@  fi
 
 # Replace the SUBJECT token with it.
 if [ -n "$SUBJECT" ]; then
-	sed -i -e "s/\*\*\* SUBJECT HERE \*\*\*/$SUBJECT/" "$CL"
+	sed -i -e "s#\*\*\* SUBJECT HERE \*\*\*#$SUBJECT#" "$CL"
 fi
 
 

Comments

Ross Burton Dec. 20, 2018, 11:48 a.m.
So if I sent a patch with the subject "Fix #1234" it fails?

Sounds like a good reason to rewrite create-pull-request in Python to
avoid this nonsense.

Ross
On Thu, 20 Dec 2018 at 08:05, Robert Yang <liezhi.yang@windriver.com> wrote:
>
> Fixed when SUBJECT contains slash(/):
> sed: -e expression #1, char 35: unknown option to `s'
>
> Use '#' as separator to fix the problem.
>
> Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
> ---
>  scripts/create-pull-request | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/create-pull-request b/scripts/create-pull-request
> index 280880b..ff0f7e6 100755
> --- a/scripts/create-pull-request
> +++ b/scripts/create-pull-request
> @@ -278,7 +278,7 @@ fi
>
>  # Replace the SUBJECT token with it.
>  if [ -n "$SUBJECT" ]; then
> -       sed -i -e "s/\*\*\* SUBJECT HERE \*\*\*/$SUBJECT/" "$CL"
> +       sed -i -e "s#\*\*\* SUBJECT HERE \*\*\*#$SUBJECT#" "$CL"
>  fi
>
>
> --
> 2.10.2
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
Robert Yang Dec. 24, 2018, 6:24 a.m.
On 12/20/18 7:48 PM, Burton, Ross wrote:
> So if I sent a patch with the subject "Fix #1234" it fails?
> 
> Sounds like a good reason to rewrite create-pull-request in Python to
> avoid this nonsense.

Yes, that's a good idea, and we can improve it a little, such as:
* Check SOB, Upstream-Status and so on.
* Make it can check the patches on patchwork/patchtest if possible.

Our team can work on it if no objections.

// Robert

> 
> Ross
> On Thu, 20 Dec 2018 at 08:05, Robert Yang <liezhi.yang@windriver.com> wrote:
>>
>> Fixed when SUBJECT contains slash(/):
>> sed: -e expression #1, char 35: unknown option to `s'
>>
>> Use '#' as separator to fix the problem.
>>
>> Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
>> ---
>>   scripts/create-pull-request | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/scripts/create-pull-request b/scripts/create-pull-request
>> index 280880b..ff0f7e6 100755
>> --- a/scripts/create-pull-request
>> +++ b/scripts/create-pull-request
>> @@ -278,7 +278,7 @@ fi
>>
>>   # Replace the SUBJECT token with it.
>>   if [ -n "$SUBJECT" ]; then
>> -       sed -i -e "s/\*\*\* SUBJECT HERE \*\*\*/$SUBJECT/" "$CL"
>> +       sed -i -e "s#\*\*\* SUBJECT HERE \*\*\*#$SUBJECT#" "$CL"
>>   fi
>>
>>
>> --
>> 2.10.2
>>
>> --
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>