All of lore.kernel.org
 help / color / mirror / Atom feed
* [SDK] meta-toolchain.bb generates very interesting environment-setup
@ 2010-03-25 15:16 Sergey Lapin
  2010-03-25 18:01 ` Denys Dmytriyenko
  0 siblings, 1 reply; 3+ messages in thread
From: Sergey Lapin @ 2010-03-25 15:16 UTC (permalink / raw)
  To: openembedded-devel

$ cat /usr/local/angstrom/arm/environment-setup
export SDK_PATH=/usr/local/angstrom/arm
export TARGET_SYS=arm-angstrom-linux-gnueabi
export PATH=$SDK_PATH/bin:$PATH
export CPATH=$SDK_PATH/$TARGET_SYS/usr/include:$CPATH
export LIBTOOL_SYSROOT_PATH=$SDK_PATH/$TARGET_SYS
export PKG_CONFIG_SYSROOT_DIR=$SDK_PATH/$TARGET_SYS
export PKG_CONFIG_PATH=$SDK_PATH/$TARGET_SYS/usr/lib/pkgconfig
export CONFIG_SITE=$SDK_PATH/site-config
alias opkg='LD_LIBRARY_PATH=/lib /bin/opkg-cl -f //etc/opkg-sdk.conf -o '
alias opkg-target='LD_LIBRARY_PATH=/lib /bin/opkg-cl -f //etc/opkg.conf -o /'

A problem seems to be this code:

# Create environment setup script
        script=${SDK_OUTPUT}/${SDKPATH}/environment-setup
        touch $script
        echo 'export SDK_PATH=${SDKPATH}' >> $script
        echo 'export TARGET_SYS=${TARGET_SYS}' >> $script
        echo 'export PATH=$SDK_PATH/bin:$PATH' >> $script
        echo 'export CPATH=$SDK_PATH/$TARGET_SYS/usr/include:$CPATH' >> $script
        echo 'export LIBTOOL_SYSROOT_PATH=$SDK_PATH/$TARGET_SYS' >> $script
        echo 'export PKG_CONFIG_SYSROOT_DIR=$SDK_PATH/$TARGET_SYS' >> $script
        echo 'export
PKG_CONFIG_PATH=$SDK_PATH/$TARGET_SYS${libdir}/pkgconfig' >> $script
        echo 'export CONFIG_SITE=$SDK_PATH/site-config' >> $script
        echo "alias opkg='LD_LIBRARY_PATH=$SDK_PATH/lib
$SDK_PATH/bin/opkg-cl -f $SDK_PATH/${sysconfdir}/opkg-s
dk.conf -o $SDK_PATH'" >> $script
        echo "alias opkg-target='LD_LIBRARY_PATH=$SDK_PATH/lib
$SDK_PATH/bin/opkg-cl -f $SDK_PATH/$TARGET_SYS${
sysconfdir}/opkg.conf -o $SDK_PATH/$TARGET_SYS'" >> $script


it seems that $SDK_PATH in last two lines gets resolved instead of
being written literally. adding \ before $ in these lines seems to fix
this problem. Is it appropriate fix?

diff --git a/recipes/meta/meta-toolchain.bb b/recipes/meta/meta-toolchain.bb
index 688995c..4f7ffda 100644
--- a/recipes/meta/meta-toolchain.bb
+++ b/recipes/meta/meta-toolchain.bb
@@ -145,8 +145,8 @@ do_populate_sdk() {
        echo 'export PKG_CONFIG_SYSROOT_DIR=$SDK_PATH/$TARGET_SYS' >> $script
        echo 'export
PKG_CONFIG_PATH=$SDK_PATH/$TARGET_SYS${libdir}/pkgconfig' >> $script
        echo 'export CONFIG_SITE=$SDK_PATH/site-config' >> $script
-       echo "alias opkg='LD_LIBRARY_PATH=$SDK_PATH/lib
$SDK_PATH/bin/opkg-cl -f $SDK_PATH/${sysconfdir}/opkg-sd
-       echo "alias opkg-target='LD_LIBRARY_PATH=$SDK_PATH/lib
$SDK_PATH/bin/opkg-cl -f $SDK_PATH/$TARGET_SYS${s
+       echo "alias opkg='LD_LIBRARY_PATH=\$SDK_PATH/lib
\$SDK_PATH/bin/opkg-cl -f \$SDK_PATH/${sysconfdir}/opkg
+       echo "alias opkg-target='LD_LIBRARY_PATH=\$SDK_PATH/lib
\$SDK_PATH/bin/opkg-cl -f \$SDK_PATH/$TARGET_SYS

        # Add version information
        versionfile=${SDK_OUTPUT}/${SDKPATH}/version



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

* Re: [SDK] meta-toolchain.bb generates very interesting environment-setup
  2010-03-25 15:16 [SDK] meta-toolchain.bb generates very interesting environment-setup Sergey Lapin
@ 2010-03-25 18:01 ` Denys Dmytriyenko
  2010-03-25 18:33   ` Tom Rini
  0 siblings, 1 reply; 3+ messages in thread
From: Denys Dmytriyenko @ 2010-03-25 18:01 UTC (permalink / raw)
  To: openembedded-devel

On Thu, Mar 25, 2010 at 06:16:49PM +0300, Sergey Lapin wrote:
> $ cat /usr/local/angstrom/arm/environment-setup
> export SDK_PATH=/usr/local/angstrom/arm
> export TARGET_SYS=arm-angstrom-linux-gnueabi
> export PATH=$SDK_PATH/bin:$PATH
> export CPATH=$SDK_PATH/$TARGET_SYS/usr/include:$CPATH
> export LIBTOOL_SYSROOT_PATH=$SDK_PATH/$TARGET_SYS
> export PKG_CONFIG_SYSROOT_DIR=$SDK_PATH/$TARGET_SYS
> export PKG_CONFIG_PATH=$SDK_PATH/$TARGET_SYS/usr/lib/pkgconfig
> export CONFIG_SITE=$SDK_PATH/site-config
> alias opkg='LD_LIBRARY_PATH=/lib /bin/opkg-cl -f //etc/opkg-sdk.conf -o '
> alias opkg-target='LD_LIBRARY_PATH=/lib /bin/opkg-cl -f //etc/opkg.conf -o /'
> 
> A problem seems to be this code:
> 
> # Create environment setup script
>         script=${SDK_OUTPUT}/${SDKPATH}/environment-setup
>         touch $script
>         echo 'export SDK_PATH=${SDKPATH}' >> $script
>         echo 'export TARGET_SYS=${TARGET_SYS}' >> $script
>         echo 'export PATH=$SDK_PATH/bin:$PATH' >> $script
>         echo 'export CPATH=$SDK_PATH/$TARGET_SYS/usr/include:$CPATH' >> $script
>         echo 'export LIBTOOL_SYSROOT_PATH=$SDK_PATH/$TARGET_SYS' >> $script
>         echo 'export PKG_CONFIG_SYSROOT_DIR=$SDK_PATH/$TARGET_SYS' >> $script
>         echo 'export
> PKG_CONFIG_PATH=$SDK_PATH/$TARGET_SYS${libdir}/pkgconfig' >> $script
>         echo 'export CONFIG_SITE=$SDK_PATH/site-config' >> $script
>         echo "alias opkg='LD_LIBRARY_PATH=$SDK_PATH/lib
> $SDK_PATH/bin/opkg-cl -f $SDK_PATH/${sysconfdir}/opkg-s
> dk.conf -o $SDK_PATH'" >> $script
>         echo "alias opkg-target='LD_LIBRARY_PATH=$SDK_PATH/lib
> $SDK_PATH/bin/opkg-cl -f $SDK_PATH/$TARGET_SYS${
> sysconfdir}/opkg.conf -o $SDK_PATH/$TARGET_SYS'" >> $script
> 
> 
> it seems that $SDK_PATH in last two lines gets resolved instead of
> being written literally. adding \ before $ in these lines seems to fix
> this problem. Is it appropriate fix?

Ah, interesting... It worked for me when the last two lines had double quotes 
inside single quotes. But to match RP's styling, I had to revert that to 
single quotes inside double quotes and it doesn't seem to work:

$ echo 'show "$SDK_PATH"'
show "$SDK_PATH"

$ echo "show '$SDK_PATH'"
show ''

I wonder if it would be Ok to revert back to the original quoting... Or is 
escaping with \ a better fix?

> diff --git a/recipes/meta/meta-toolchain.bb b/recipes/meta/meta-toolchain.bb
> index 688995c..4f7ffda 100644
> --- a/recipes/meta/meta-toolchain.bb
> +++ b/recipes/meta/meta-toolchain.bb
> @@ -145,8 +145,8 @@ do_populate_sdk() {
>         echo 'export PKG_CONFIG_SYSROOT_DIR=$SDK_PATH/$TARGET_SYS' >> $script
>         echo 'export
> PKG_CONFIG_PATH=$SDK_PATH/$TARGET_SYS${libdir}/pkgconfig' >> $script
>         echo 'export CONFIG_SITE=$SDK_PATH/site-config' >> $script
> -       echo "alias opkg='LD_LIBRARY_PATH=$SDK_PATH/lib
> $SDK_PATH/bin/opkg-cl -f $SDK_PATH/${sysconfdir}/opkg-sd
> -       echo "alias opkg-target='LD_LIBRARY_PATH=$SDK_PATH/lib
> $SDK_PATH/bin/opkg-cl -f $SDK_PATH/$TARGET_SYS${s
> +       echo "alias opkg='LD_LIBRARY_PATH=\$SDK_PATH/lib
> \$SDK_PATH/bin/opkg-cl -f \$SDK_PATH/${sysconfdir}/opkg
> +       echo "alias opkg-target='LD_LIBRARY_PATH=\$SDK_PATH/lib
> \$SDK_PATH/bin/opkg-cl -f \$SDK_PATH/$TARGET_SYS
> 
>         # Add version information
>         versionfile=${SDK_OUTPUT}/${SDKPATH}/version
> 
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel



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

* Re: [SDK] meta-toolchain.bb generates very interesting environment-setup
  2010-03-25 18:01 ` Denys Dmytriyenko
@ 2010-03-25 18:33   ` Tom Rini
  0 siblings, 0 replies; 3+ messages in thread
From: Tom Rini @ 2010-03-25 18:33 UTC (permalink / raw)
  To: openembedded-devel

On Thu, 2010-03-25 at 14:01 -0400, Denys Dmytriyenko wrote:
> On Thu, Mar 25, 2010 at 06:16:49PM +0300, Sergey Lapin wrote:
> > $ cat /usr/local/angstrom/arm/environment-setup
> > export SDK_PATH=/usr/local/angstrom/arm
> > export TARGET_SYS=arm-angstrom-linux-gnueabi
> > export PATH=$SDK_PATH/bin:$PATH
> > export CPATH=$SDK_PATH/$TARGET_SYS/usr/include:$CPATH
> > export LIBTOOL_SYSROOT_PATH=$SDK_PATH/$TARGET_SYS
> > export PKG_CONFIG_SYSROOT_DIR=$SDK_PATH/$TARGET_SYS
> > export PKG_CONFIG_PATH=$SDK_PATH/$TARGET_SYS/usr/lib/pkgconfig
> > export CONFIG_SITE=$SDK_PATH/site-config
> > alias opkg='LD_LIBRARY_PATH=/lib /bin/opkg-cl -f //etc/opkg-sdk.conf -o '
> > alias opkg-target='LD_LIBRARY_PATH=/lib /bin/opkg-cl -f //etc/opkg.conf -o /'
> > 
> > A problem seems to be this code:
> > 
> > # Create environment setup script
> >         script=${SDK_OUTPUT}/${SDKPATH}/environment-setup
> >         touch $script
> >         echo 'export SDK_PATH=${SDKPATH}' >> $script
> >         echo 'export TARGET_SYS=${TARGET_SYS}' >> $script
> >         echo 'export PATH=$SDK_PATH/bin:$PATH' >> $script
> >         echo 'export CPATH=$SDK_PATH/$TARGET_SYS/usr/include:$CPATH' >> $script
> >         echo 'export LIBTOOL_SYSROOT_PATH=$SDK_PATH/$TARGET_SYS' >> $script
> >         echo 'export PKG_CONFIG_SYSROOT_DIR=$SDK_PATH/$TARGET_SYS' >> $script
> >         echo 'export
> > PKG_CONFIG_PATH=$SDK_PATH/$TARGET_SYS${libdir}/pkgconfig' >> $script
> >         echo 'export CONFIG_SITE=$SDK_PATH/site-config' >> $script
> >         echo "alias opkg='LD_LIBRARY_PATH=$SDK_PATH/lib
> > $SDK_PATH/bin/opkg-cl -f $SDK_PATH/${sysconfdir}/opkg-s
> > dk.conf -o $SDK_PATH'" >> $script
> >         echo "alias opkg-target='LD_LIBRARY_PATH=$SDK_PATH/lib
> > $SDK_PATH/bin/opkg-cl -f $SDK_PATH/$TARGET_SYS${
> > sysconfdir}/opkg.conf -o $SDK_PATH/$TARGET_SYS'" >> $script
> > 
> > 
> > it seems that $SDK_PATH in last two lines gets resolved instead of
> > being written literally. adding \ before $ in these lines seems to fix
> > this problem. Is it appropriate fix?
> 
> Ah, interesting... It worked for me when the last two lines had double quotes 
> inside single quotes. But to match RP's styling, I had to revert that to 
> single quotes inside double quotes and it doesn't seem to work:
> 
> $ echo 'show "$SDK_PATH"'
> show "$SDK_PATH"
> 
> $ echo "show '$SDK_PATH'"
> show ''
> 
> I wonder if it would be Ok to revert back to the original quoting... Or is 
> escaping with \ a better fix?

Ordered quoting ('""') is how we handle this in other recipes, so we
should do it here.

-- 
Tom Rini <tom_rini@mentor.com>
Mentor Graphics Corporation



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

end of thread, other threads:[~2010-03-25 18:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-25 15:16 [SDK] meta-toolchain.bb generates very interesting environment-setup Sergey Lapin
2010-03-25 18:01 ` Denys Dmytriyenko
2010-03-25 18:33   ` Tom Rini

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.