<Tokamak>
quite confused on bitbake variable expansion. I found a recipe that defines `local VAR=foo'. Is this similar to `export VAR=foo`, expect the context is local to the recipe?
<moto-timo>
What you are looking at is a shell task. It’s not the same as bitbake variables.
<Tokamak>
this was non-obvious to me until about 1 hour ago
<moto-timo>
So in this case, that variable is only in the scope of that shell function or shell task.
<Tokamak>
so where i'm really darn confused is.. bitbake shell tasks are not actually executed by bash?
<Tokamak>
the syntax of local makes sense (coming from a bash background) but where i'm really struggling is a somewhat formal definition of the shell task environment.
<Tokamak>
${FOO} expands from yocto var db
<Tokamak>
$FOO expands from environment
<Tokamak>
FOO="stuff" sets in yocto var db?export FOO="stuff" exports to shell?
<Tokamak>
local FOO="suff" creates a local shell variable (to processing context of recipe)?
<Tokamak>
(sorry, copy paste in my irc client really failed here)
<moto-timo>
local would only be in the scope of the shell task or shell function
<Tokamak>
I elaborated the above examples i've seen thus far, are these remotely correct?
<moto-timo>
${} is immediate expansion
<moto-timo>
export makes it available outside the specific task
<moto-timo>
Try not to make it a black box. It’s all shell and python underneath.
troth has quit [Ping timeout: 256 seconds]
<Tokamak>
how do i look to make it less of a black box? e.g. I tried to do $((var1 + var2)), which resulted in an error
<moto-timo>
I can't see your code, so I can only go on what you've asked
<moto-timo>
what was the error? etc.
<Tokamak>
i just worked around it by piping through bc. but i'll revert here in a bit for a test
<moto-timo>
what are you trying to accomplish by adding the variables?
<moto-timo>
most things in the bitbake context are strings, and most commonly the lists are space delimited (so variables which are a list are space delimited)
<moto-timo>
so you could do:
<Tokamak>
ultimately i messaged trying to understand how this all works as the links earlier really don't capture the mechanics of variable expansion
<moto-timo>
FOO = "bar"
<moto-timo>
FOO += "baz"
<moto-timo>
echo ${FOO}
<moto-timo>
barbaz
<moto-timo>
or using override syntax
<moto-timo>
FOO = "bar"
<moto-timo>
FOO:append = "baz"
<Tokamak>
oh, i wanted to do the bash arithmetic addition. $((var1 + var2)) where
<moto-timo>
same result (although normally you are appending to a space delimited variable so you want FOO:append = " baz"
<Tokamak>
i'm calculating image byte offsets for dm-verity
vd has quit [Quit: Client closed]
vd has joined #yocto
<Tokamak>
yea the special syntax for variable appends / overrides makes sense. i'm just struggling inside the task's shell context
<moto-timo>
we frequently move to python for more complicated tasks, shell has it's limitations and the syntax gets ugly very very fast
<moto-timo>
but without looking at exactly what you've tried, I can't really say much more
<Tokamak>
trying to give you an example here in a second
<moto-timo>
(and I should be shutting down and idling my brain a bit)
<Tokamak>
well that fine if you want to shutdown - i appreciate the help you've given
<moto-timo>
if you have something, give it a shot
<moto-timo>
no promises
sakoman has joined #yocto
<Tokamak>
man, i'm used to the ease of gentoo's wgetpaste. do you happen to know of a similar tool to upload a file?
<moto-timo>
you can use pastebin (or use irccloud which allows both pasting snippets and uploading files)
<moto-timo>
or a GitHub gist
<moto-timo>
or put it in a git repo somewhere and paste the link
<Tokamak>
manual copy-paste is really awkward in my environment, unfortunately
<moto-timo>
ah, I'm not sure you can pipe within a shell task
<moto-timo>
anyway, my eyelids are telling me time to move away from screens
<moto-timo>
good luck!
<Tokamak>
this is what i mean about being very confused about bitbake's shell being not bash
<Tokamak>
and thanks. about to try to verify what i have now, with the ugly work arounds
<moto-timo>
I was trying to search the bitbake code for where the shell tasks are called, but my tired brain didn't find it
<Tokamak>
thanks for trying!
<moto-timo>
when the EU/UK folks are on-line you might get more help
<Tokamak>
i certainly hope i'm not up that late :P
troth has quit [Ping timeout: 240 seconds]
troth has joined #yocto
goliath has quit [Quit: SIGSEGV]
jmiehe1 has joined #yocto
jmiehe has quit [Ping timeout: 268 seconds]
jmiehe1 is now known as jmiehe
chep has quit [Ping timeout: 268 seconds]
chep has joined #yocto
sakoman has quit [Quit: Leaving.]
chep has quit [Ping timeout: 256 seconds]
chep has joined #yocto
troth has quit [Ping timeout: 264 seconds]
troth has joined #yocto
troth has quit [Ping timeout: 260 seconds]
Vonter has joined #yocto
troth has joined #yocto
xmn has quit [Ping timeout: 260 seconds]
chep has quit [Ping timeout: 264 seconds]
chep has joined #yocto
kroon has joined #yocto
davidinux has joined #yocto
kroon has quit [Quit: Leaving]
camus1 has joined #yocto
kroon has joined #yocto
camus has quit [Ping timeout: 256 seconds]
camus1 is now known as camus
pgowda_ has joined #yocto
camus has quit [Ping timeout: 240 seconds]
camus has joined #yocto
chep has quit [Ping timeout: 256 seconds]
chep has joined #yocto
chep has quit [Ping timeout: 260 seconds]
chep has joined #yocto
eloi1 has joined #yocto
eloi1 has quit [Ping timeout: 240 seconds]
adrian__ has joined #yocto
camus has quit [Ping timeout: 240 seconds]
camus has joined #yocto
florian_kc has joined #yocto
zyga has joined #yocto
<RP>
Tokamak: Firstly, bitbake uses sh syntax, not bash, we don't support bashisms. Secondly, bitbake performs variable expansion on the shell tasks before running them. This means ${XXX} will be expanded if XXX is set in the datastore
<RP>
Tokamak: finally, we do have to parse the shell to get some dependency information. Our parser doesn't understand some shell expressions so you will see errors if you use syntax our parser doesn't understand
<Guest66>
Ma Problem is that the path is available within morty but Not in dunfell…
zenstoic has joined #yocto
<Guest66>
So it is returning „unable to find any package producing path…“
<vmeson>
Guest66: odd, I don't think we would have changed anything related to alternatives
* vmeson
checks email logs...
<Guest66>
Opkg was updated between morty and dunfell. But could yet Not find why the path is not there.
Guest66 has quit [Quit: Client closed]
Guest66 has joined #yocto
Guest66 has quit [Client Quit]
Guest66 has joined #yocto
<vmeson>
Guest66: here as an email [OE-core] [PATCH v4] opkg-utils: Change alternatives lib path from /usr/lib/opkg to /var/lib/opkg -- 2017-10-30, 10:12 p.m.
<vmeson>
but I don't think that was merged.
<Guest66>
Either I dont have it under var
jmiehe has quit [Ping timeout: 268 seconds]
Guest66 has quit [Quit: Client closed]
Guest66 has joined #yocto
Guest66 has quit [Quit: Client closed]
Guest66 has joined #yocto
<Tokamak>
Thanks for the context RP.
Guest66 has quit [Quit: Client closed]
Guest66 has joined #yocto
Guest66 has quit [Client Quit]
Guest66 has joined #yocto
Guest66 has quit [Client Quit]
manuel1985 has quit [Remote host closed the connection]
manuel1985 has joined #yocto
Guest10 has joined #yocto
Guest10 has quit [Client Quit]
chep has quit [Ping timeout: 256 seconds]
goliath has quit [Quit: SIGSEGV]
chep has joined #yocto
amitk_ has joined #yocto
amitk has quit [Ping timeout: 264 seconds]
chep has quit [Ping timeout: 256 seconds]
chep has joined #yocto
goliath has joined #yocto
xmn has quit [Quit: ZZZzzz…]
chep has quit [Ping timeout: 264 seconds]
chep has joined #yocto
eloi1 has joined #yocto
eloi1 has quit [Ping timeout: 250 seconds]
adrian__ has quit [Ping timeout: 268 seconds]
zenstoic has quit [Quit: Connection closed for inactivity]