From: Paul Eggleton <paul.eggleton@linux.intel.com>
To: seth bollinger <seth.boll@gmail.com>
Cc: yocto@yoctoproject.org
Subject: Re: bash specific syntax in bbclass files
Date: Thu, 02 May 2013 09:07:55 +0100 [thread overview]
Message-ID: <1370035.2iCAacKgHz@helios> (raw)
In-Reply-To: <5181AF9F.8040702@gmail.com>
On Wednesday 01 May 2013 19:13:19 seth bollinger wrote:
> I recently ran into a problem in
> meta-raspberrypi/classes/sdcard_image-rpi.bbclass
>
> The following was run through my default debian dash shell (I thought I
> switched a while back, but I must have reverted my VM image or
> something...).
>
> # If SDIMG_ROOTFS_TYPE is a .xz file use xzcat
> if [[ "$SDIMG_ROOTFS_TYPE" == *.xz ]]
> then
>
> The bash specific syntax ([[) failed in dash causing the "else" path to
> be traversed instead of the correct "then" path. The failure was silent
> and resulted in a blind copy of a compressed rootfs to the sdcard
> image. Of course this didn't run. :)
>
> 1. Is there particular shell syntax that class files should stick too?
No bashisms should be used, so the above should really be changed.
> 2. I couldn't find a wildcard string search in dash. Can anyone
> suggest a more shell agnostic way to do this?
AFAIK grep or awk is the only way.
> 3. Is there a way to guarantee we're running in bash if we're using
> bash specific syntax?
Not that I'm aware of.
Cheers,
Paul
--
Paul Eggleton
Intel Open Source Technology Centre
next prev parent reply other threads:[~2013-05-02 8:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-02 0:13 bash specific syntax in bbclass files seth bollinger
2013-05-02 8:07 ` Paul Eggleton [this message]
2013-05-03 6:36 ` Gaurang Shastri
2013-05-03 6:58 ` Paul Eggleton
2013-05-03 11:40 ` Trevor Woerner
2013-05-03 12:12 ` Robert P. J. Day
2013-05-03 12:25 ` Paul Eggleton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1370035.2iCAacKgHz@helios \
--to=paul.eggleton@linux.intel.com \
--cc=seth.boll@gmail.com \
--cc=yocto@yoctoproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.