Skip to contentSkip to conversation

autotools.bbclass: fix issue with native and sed

PATCH New Denis 'Gnutoo' Carikli 2 participants 6 messages Feb 12, 2010 – Feb 13, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 autotools.bbclass: fix issue with native and sed

Hi,
libxml2-native failed with:
sed: -e expression #1, char 0: no previous regular expression I've a temporary fix for it.
The details are in the patch commit message.

Denis.

#1 lore raw

PATCH 1/1 autotools.bbclass fix issue with native

STAGING_DIR_HOST is "" when using native bbclass:
native.bbclass:STAGING_DIR_HOST = ""
But in autotools.bbclass there is:
sed -i -e s:${STAGING_DIR_HOST}::g $i
which result in the following code in run.autotools_prepackage_lamangler
sed -i -e s:::g $i
which makes libxml2-native fail like this:
| sed: -e expression #1, char 0: no previous regular expression

I discussed it on IRC:

Feb 11 17:41:29 <RP>    GNUtoo: We should only be doing that is STAGING_DIR_HOST isn't empty I guess

So I made a temporary fix which only workarround,because some issues persist:

Feb 11 17:41:02 <pb_>   RP: heh, I wonder whether paths with colons in would be considered valid :-}
---
 classes/autotools.bbclass |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
classes/autotools.bbclass +4 -1
index 1ea4b6f..daa0deb 100644
@@ -152,7 +152,10 @@ autotools_prepackage_lamangler () {
                 sed -i -e s:${CROSS_DIR}/${HOST_SYS}::g $i
                 sed -i -e s:${CROSS_DIR}::g $i
                 sed -i -e s:${STAGING_LIBDIR}:${libdir}:g $i
-                sed -i -e s:${STAGING_DIR_HOST}::g $i
+                #TODO: needs better handling of native
+                if [ -n "${STAGING_DIR_HOST}" ]; then
+                        sed -i -e s:${STAGING_DIR_HOST}::g $i
+                fi
                 sed -i -e s:${STAGING_DIR}::g $i
                 sed -i -e s:${S}::g $i
                 sed -i -e s:${T}::g $i
Signature · 1 line
1.6.4.4
Acked-by on v1 1/1
#2 lore raw

Re: [PATCH] autotools.bbclass fix issue with native

2010/2/12 Denis 'Gnutoo' Carikli <[email protected]>:

Quoted 28 lines

STAGING_DIR_HOST is "" when using native bbclass:
native.bbclass:STAGING_DIR_HOST = ""
But in autotools.bbclass there is:
 sed -i -e s:${STAGING_DIR_HOST}::g $i
which result in the following code in run.autotools_prepackage_lamangler sed -i -e s:::g $i
which makes libxml2-native fail like this:
 | sed: -e expression #1, char 0: no previous regular expression

I discussed it on IRC:

Feb 11 17:41:29 <RP>    GNUtoo: We should only be doing that is STAGING_DIR_HOST isn't empty I guess

So I made a temporary fix which only workarround,because some issues persist:

Feb 11 17:41:02 <pb_>   RP: heh, I wonder whether paths with colons in would be considered valid :-}

---
 classes/autotools.bbclass |    5 ++++-

 1 files changed, 4 insertions(+), 1 deletions(-)
classes/autotools.bbclass +0 -0
index 1ea4b6f..daa0deb 100644
@@ -152,7 +152,10 @@ autotools_prepackage_lamangler () {

                sed -i -e s:${CROSS_DIR}/${HOST_SYS}::g $i sed -i -e s:${CROSS_DIR}::g $i
                sed -i -e s:${STAGING_LIBDIR}:${libdir}:g $i

Quoted 8 lines

-                sed -i -e s:${STAGING_DIR_HOST}::g $i
+                #TODO: needs better handling of native
+                if [ -n "${STAGING_DIR_HOST}" ]; then
+                        sed -i -e s:${STAGING_DIR_HOST}::g $i
+                fi
                sed -i -e s:${STAGING_DIR}::g $i
                sed -i -e s:${S}::g $i
                sed -i -e s:${T}::g $i

With some hesitation:

The hesitation mainly concerns the #TODO comment. I don't really find it explanatory, personally I'd say remove the whole comment.

FM

#3 lore raw

Re: [PATCH] autotools.bbclass fix issue with native

2010/2/12 Frans Meulenbroeks <[email protected]>:

Quoted 15 lines

2010/2/12 Denis 'Gnutoo' Carikli <[email protected]>:

Quoted 14 lines

STAGING_DIR_HOST is "" when using native bbclass:
native.bbclass:STAGING_DIR_HOST = ""
But in autotools.bbclass there is:
 sed -i -e s:${STAGING_DIR_HOST}::g $i
which result in the following code in run.autotools_prepackage_lamangler sed -i -e s:::g $i
which makes libxml2-native fail like this:
 | sed: -e expression #1, char 0: no previous regular expression

I discussed it on IRC:

Feb 11 17:41:29 <RP>    GNUtoo: We should only be doing that is STAGING_DIR_HOST isn't empty I guess

So I made a temporary fix which only workarround,because some issues persist:

Feb 11 17:41:02 <pb_>   RP: heh, I wonder whether paths with colons in would be considered valid :-}

BTW: paths with : are technically valid, but imho should be considered as morons.
It might be a good plan to use everywhere the same delimiter in sed scripts. : seems fine to me.

FM

author
#4 lore raw

Re: [PATCH] autotools.bbclass fix issue with native

In reply to Frans Meulenbroeks
Quoted 3 lines
Quoted 1 line

+ #TODO: needs better handling of native

The hesitation mainly concerns the #TODO comment. I don't really find it explanatory, personally I'd say remove the whole comment.

Ok I'll remove the comment.
Thanks a lot

Denis.

#5 lore raw

Re: [PATCH] autotools.bbclass fix issue with native

2010/2/13 GNUtoo <[email protected]>:

Quoted 4 lines
Quoted 3 lines
Quoted 1 line

+                #TODO: needs better handling of native

The hesitation mainly concerns the #TODO comment. I don't really find it explanatory, personally I'd say remove the whole comment.

Ok I'll remove the comment.

Well perhaps others have a different meaning on it :-) another option is to make the comment somewhat more explanatory.

Frans.

PS: thanks for the eeepc patch, will be trying it this weekend.