All of lore.kernel.org
 help / color / mirror / Atom feed
* [OE-core] [PATCH] opkg-utils: update-alternatives fails for "[" and "[[" in busybox
@ 2014-10-27  9:35 Liu Jian
  2014-10-27  9:52 ` Paul Barker
  0 siblings, 1 reply; 6+ messages in thread
From: Liu Jian @ 2014-10-27  9:35 UTC (permalink / raw)
  To: opkg-devel, yocto

Building a small filesystem with busybox gives the following error lines:
sed: -e expression #1, char 41: unterminated address regex
sed: -e expression #1, char 42: unterminated address regex
This is caused by the script update-alternatives.
"[" can not be used directly in sed expression.

Signed-off-by: Jian Liu <jian.liu@windriver.com>
---
...andle-leftbracket-for-update-alternatives.patch | 25
++++++++++++++++++++++
meta/recipes-devtools/opkg-utils/opkg-utils_git.bb | 4 +++-
2 files changed, 28 insertions(+), 1 deletion(-)
create mode 100644
meta/recipes-devtools/opkg-utils/opkg-utils/handle-leftbracket-for-update-alternatives.patch

diff --git
a/meta/recipes-devtools/opkg-utils/opkg-utils/handle-leftbracket-for-update-alternatives.patch
b/meta/recipes-devtools/opkg-utils/opkg-utils/handle-leftbracket-for-update-alternatives.patch
new file mode 100644
index 0000000..0cdc4e2
--- /dev/null
+++
b/meta/recipes-devtools/opkg-utils/opkg-utils/handle-leftbracket-for-update-alternatives.patch
@@ -0,0 +1,25 @@
+"[" should be escaped in sed expression. This patch is suitable for
opkg-0.2.2
+
+diff -Nur utils.orig/update-alternatives utils/update-alternatives
+--- utils.orig/update-alternatives 2013-08-16 04:22:29.000000000 +0800
++++ utils/update-alternatives 2014-09-19 10:55:22.238159317 +0800
+@@ -68,6 +68,10 @@
+ sed -e 's/\//\\\//g'
+ }
+
++protect_special_character() {
++ sed -e 's/\[/\\\[/g'
++}
++
+ remove_alt() {
+ [ $# -lt 2 ] && return 1
+ local name="$1"
+@@ -75,7 +79,7 @@
+
+ [ ! -f $ad/$name ] && return 0
+
+- path=`echo $path | protect_slashes`
++ path=`echo $path | protect_slashes | protect_special_character`
+ sed -ne "/^$path\>.*/!p" $ad/$name > $ad/$name.new
+ mv $ad/$name.new $ad/$name
+ }
diff --git a/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb
b/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb
index 693c216..04412d1 100644
--- a/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb
+++ b/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb
@@ -10,7 +10,9 @@ PROVIDES += "virtual/update-alternatives"
SRCREV = "eae0d8fa44e8594aa90eadf06e5f4fbeef314509"
PV = "0.1.8+git${SRCPV}"

-SRC_URI = "git://git.yoctoproject.org/opkg-utils"
+SRC_URI = "git://git.yoctoproject.org/opkg-utils \
+ file://handle-leftbracket-for-update-alternatives.patch \
+"

S = "${WORKDIR}/git"

-- 
1.8.5.2.233.g932f7e4

-- 
Jian Liu
Email: jian.liu@windriver.com
Office Phone: 86-10-84778539



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [OE-core] [PATCH] opkg-utils: update-alternatives fails for "[" and "[[" in busybox
  2014-10-27  9:35 [OE-core] [PATCH] opkg-utils: update-alternatives fails for "[" and "[[" in busybox Liu Jian
@ 2014-10-27  9:52 ` Paul Barker
  2014-10-27  9:55   ` Paul Barker
  0 siblings, 1 reply; 6+ messages in thread
From: Paul Barker @ 2014-10-27  9:52 UTC (permalink / raw)
  To: Liu Jian; +Cc: Yocto discussion list, opkg-devel

On 27 October 2014 09:35, Liu Jian <jian.liu@windriver.com> wrote:
> Building a small filesystem with busybox gives the following error lines:
> sed: -e expression #1, char 41: unterminated address regex
> sed: -e expression #1, char 42: unterminated address regex
> This is caused by the script update-alternatives.
> "[" can not be used directly in sed expression.
>
> Signed-off-by: Jian Liu <jian.liu@windriver.com>
> ---
> ...andle-leftbracket-for-update-alternatives.patch | 25
> ++++++++++++++++++++++
> meta/recipes-devtools/opkg-utils/opkg-utils_git.bb | 4 +++-
> 2 files changed, 28 insertions(+), 1 deletion(-)
> create mode 100644
> meta/recipes-devtools/opkg-utils/opkg-utils/handle-leftbracket-for-update-alternatives.patch
>
> diff --git
> a/meta/recipes-devtools/opkg-utils/opkg-utils/handle-leftbracket-for-update-alternatives.patch
> b/meta/recipes-devtools/opkg-utils/opkg-utils/handle-leftbracket-for-update-alternatives.patch
> new file mode 100644
> index 0000000..0cdc4e2
> --- /dev/null
> +++
> b/meta/recipes-devtools/opkg-utils/opkg-utils/handle-leftbracket-for-update-alternatives.patch
> @@ -0,0 +1,25 @@
> +"[" should be escaped in sed expression. This patch is suitable for
> opkg-0.2.2
> +
> +diff -Nur utils.orig/update-alternatives utils/update-alternatives
> +--- utils.orig/update-alternatives 2013-08-16 04:22:29.000000000 +0800
> ++++ utils/update-alternatives 2014-09-19 10:55:22.238159317 +0800
> +@@ -68,6 +68,10 @@
> + sed -e 's/\//\\\//g'
> + }
> +
> ++protect_special_character() {
> ++ sed -e 's/\[/\\\[/g'
> ++}
> ++
> + remove_alt() {
> + [ $# -lt 2 ] && return 1
> + local name="$1"
> +@@ -75,7 +79,7 @@
> +
> + [ ! -f $ad/$name ] && return 0
> +
> +- path=`echo $path | protect_slashes`
> ++ path=`echo $path | protect_slashes | protect_special_character`
> + sed -ne "/^$path\>.*/!p" $ad/$name > $ad/$name.new
> + mv $ad/$name.new $ad/$name
> + }
> diff --git a/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb
> b/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb
> index 693c216..04412d1 100644
> --- a/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb
> +++ b/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb
> @@ -10,7 +10,9 @@ PROVIDES += "virtual/update-alternatives"
> SRCREV = "eae0d8fa44e8594aa90eadf06e5f4fbeef314509"
> PV = "0.1.8+git${SRCPV}"
>
> -SRC_URI = "git://git.yoctoproject.org/opkg-utils"
> +SRC_URI = "git://git.yoctoproject.org/opkg-utils \
> + file://handle-leftbracket-for-update-alternatives.patch \
> +"
>
> S = "${WORKDIR}/git"
>
> --
> 1.8.5.2.233.g932f7e4
>

Sorry, you've sent a patch for oe-core to the wrong mailing lists here.

Also, this patch doesn't apply against oe-core anyway, it looks like
your email program has corrupted it by wrapping lines. Please use 'git
send-email' if you can.

To make this change, please submit a patch for opkg-utils itself
rather than for oe-core. In oe-core, we can then simply change SRCREV
rather than holding additional patches.

Thanks,

-- 
Paul Barker

Email: paul@paulbarker.me.uk
http://www.paulbarker.me.uk


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [OE-core] [PATCH] opkg-utils: update-alternatives fails for "[" and "[[" in busybox
  2014-10-27  9:52 ` Paul Barker
@ 2014-10-27  9:55   ` Paul Barker
  2014-10-28  2:02     ` Liu Jian
  0 siblings, 1 reply; 6+ messages in thread
From: Paul Barker @ 2014-10-27  9:55 UTC (permalink / raw)
  To: Liu Jian; +Cc: Yocto discussion list, opkg-devel

On 27 October 2014 09:52, Paul Barker <paul@paulbarker.me.uk> wrote:
>
> Sorry, you've sent a patch for oe-core to the wrong mailing lists here.
>
> Also, this patch doesn't apply against oe-core anyway, it looks like
> your email program has corrupted it by wrapping lines. Please use 'git
> send-email' if you can.
>
> To make this change, please submit a patch for opkg-utils itself
> rather than for oe-core. In oe-core, we can then simply change SRCREV
> rather than holding additional patches.
>
> Thanks,
>

Actually, that's a bit short worded. Hope it doesn't sound harsh,
getting patches in the right format to the right list can be a pain if
you're new to the project.

If you've got any questions just ask, either on the mailing list or on
IRC. I or someone else should be able to help you out.

Thanks,

-- 
Paul Barker

Email: paul@paulbarker.me.uk
http://www.paulbarker.me.uk


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [OE-core] [PATCH] opkg-utils: update-alternatives fails for "[" and "[[" in busybox
  2014-10-27  9:55   ` Paul Barker
@ 2014-10-28  2:02     ` Liu Jian
  2014-10-28  9:28       ` [opkg-devel] " Paul Barker
  0 siblings, 1 reply; 6+ messages in thread
From: Liu Jian @ 2014-10-28  2:02 UTC (permalink / raw)
  To: Paul Barker, opkg-devel, Yocto discussion list

[-- Attachment #1: Type: text/plain, Size: 1329 bytes --]

Hi Paul,

Thanks to your correction.

Could you please tell me the mailing lists? I use this mailing lists 
following the
guidance of 
http://git.yoctoproject.org/cgit/cgit.cgi/opkg-utils/tree/CONTRIBUTING.

You told me that URL in your last mail. So should I follow the 
instruction in it?

Thanks very much!

Jian


于 2014年10月27日 17:55, Paul Barker 写道:
> On 27 October 2014 09:52, Paul Barker <paul@paulbarker.me.uk> wrote:
>> Sorry, you've sent a patch for oe-core to the wrong mailing lists here.
>>
>> Also, this patch doesn't apply against oe-core anyway, it looks like
>> your email program has corrupted it by wrapping lines. Please use 'git
>> send-email' if you can.
>>
>> To make this change, please submit a patch for opkg-utils itself
>> rather than for oe-core. In oe-core, we can then simply change SRCREV
>> rather than holding additional patches.
>>
>> Thanks,
>>
> Actually, that's a bit short worded. Hope it doesn't sound harsh,
> getting patches in the right format to the right list can be a pain if
> you're new to the project.
>
> If you've got any questions just ask, either on the mailing list or on
> IRC. I or someone else should be able to help you out.
>
> Thanks,
>

-- 
Jian Liu
Email: jian.liu@windriver.com
Office Phone: 86-10-84778539


[-- Attachment #2: Type: text/html, Size: 2271 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [opkg-devel] Re: [OE-core] [PATCH] opkg-utils: update-alternatives fails for "[" and "[[" in busybox
  2014-10-28  2:02     ` Liu Jian
@ 2014-10-28  9:28       ` Paul Barker
  2014-10-29  1:50         ` Liu Jian
  0 siblings, 1 reply; 6+ messages in thread
From: Paul Barker @ 2014-10-28  9:28 UTC (permalink / raw)
  To: Liu Jian; +Cc: Yocto discussion list, opkg-devel

On 28 October 2014 02:02, Liu Jian <jian.liu@windriver.com> wrote:
> Hi Paul,
>
> Thanks to your correction.
>
> Could you please tell me the mailing lists? I use this mailing lists
> following the
> guidance of
> http://git.yoctoproject.org/cgit/cgit.cgi/opkg-utils/tree/CONTRIBUTING.
>
> You told me that URL in your last mail. So should I follow the instruction
> in it?
>
> Thanks very much!
>
> Jian
>

The mailing lists you sent the patch to are correct for opkg-utils.
The patch you sent modified the opkg-utils recipe within OpenEmbedded
rather than modifying opkg-utils itself. As opkg and opkg-utils are
part of the Yocto Project, we prefer to fix problems in the upstream
repositories rather than maintaining patches within OpenEmbedded.

To submit a patch for opkg-utils, you need to clone from
git://git.yoctoproject.org/opkg-utils, apply and commit your changes
with a Sign-off as you have done for OpenEmbedded. So the patch will
apply to the opkg-utils repository rather than the openembedded-core
repository. Then send that patch to the mailing lists. I'd recommend
sending via 'git send-email' rather than using your normal email
client as that will ensure the patch doesn't get corrupted.
Alternatively, for opkg and opkg-utils I accept patches attached to a
regular email as a .patch file.

Many thanks,

-- 
Paul Barker

Email: paul@paulbarker.me.uk
http://www.paulbarker.me.uk


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [opkg-devel] Re: [OE-core] [PATCH] opkg-utils: update-alternatives fails for "[" and "[[" in busybox
  2014-10-28  9:28       ` [opkg-devel] " Paul Barker
@ 2014-10-29  1:50         ` Liu Jian
  0 siblings, 0 replies; 6+ messages in thread
From: Liu Jian @ 2014-10-29  1:50 UTC (permalink / raw)
  To: Paul Barker; +Cc: Yocto discussion list, opkg-devel

Hi Paul,

Thanks very much for your help.
I will send the right one later.

Many thanks!
Jian

于 2014年10月28日 17:28, Paul Barker 写道:
> On 28 October 2014 02:02, Liu Jian <jian.liu@windriver.com> wrote:
>> Hi Paul,
>>
>> Thanks to your correction.
>>
>> Could you please tell me the mailing lists? I use this mailing lists
>> following the
>> guidance of
>> http://git.yoctoproject.org/cgit/cgit.cgi/opkg-utils/tree/CONTRIBUTING.
>>
>> You told me that URL in your last mail. So should I follow the instruction
>> in it?
>>
>> Thanks very much!
>>
>> Jian
>>
> The mailing lists you sent the patch to are correct for opkg-utils.
> The patch you sent modified the opkg-utils recipe within OpenEmbedded
> rather than modifying opkg-utils itself. As opkg and opkg-utils are
> part of the Yocto Project, we prefer to fix problems in the upstream
> repositories rather than maintaining patches within OpenEmbedded.
>
> To submit a patch for opkg-utils, you need to clone from
> git://git.yoctoproject.org/opkg-utils, apply and commit your changes
> with a Sign-off as you have done for OpenEmbedded. So the patch will
> apply to the opkg-utils repository rather than the openembedded-core
> repository. Then send that patch to the mailing lists. I'd recommend
> sending via 'git send-email' rather than using your normal email
> client as that will ensure the patch doesn't get corrupted.
> Alternatively, for opkg and opkg-utils I accept patches attached to a
> regular email as a .patch file.
>
> Many thanks,
>

-- 
Jian Liu
Email: jian.liu@windriver.com
Office Phone: 86-10-84778539



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-10-29  1:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-27  9:35 [OE-core] [PATCH] opkg-utils: update-alternatives fails for "[" and "[[" in busybox Liu Jian
2014-10-27  9:52 ` Paul Barker
2014-10-27  9:55   ` Paul Barker
2014-10-28  2:02     ` Liu Jian
2014-10-28  9:28       ` [opkg-devel] " Paul Barker
2014-10-29  1:50         ` Liu Jian

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.