All of lore.kernel.org
 help / color / mirror / Atom feed
* archiver.bbclass: do_dumpdata - shell format
@ 2018-10-16 12:44 Tomasz Dziendzielski
  2018-10-16 13:00 ` Burton, Ross
  0 siblings, 1 reply; 6+ messages in thread
From: Tomasz Dziendzielski @ 2018-10-16 12:44 UTC (permalink / raw)
  To: yocto

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

Hi,
when using archiver.bbclass the do_dumpdata task is using bb.data.emit_env
function, which should emit variables "in a format such that it can be
sourced by a shell.".
The problem is that the *-showdata.dump file can't be properly sourced,
because variables are not in a correct format.

There are many lines like:
PREFERRED_PROVIDER_virtual/fakeroot-native="pseudo-native"
The variables with slash are considered to be a directory and the ones with
dash are considered to be a command.
Also shell cannot properly set the variables like FOO_machine.

Should it be sourced with some specific shell or is that function wrong and
should be fixed?

Best regards,
Tomasz Dziendzielski

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

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

* Re: archiver.bbclass: do_dumpdata - shell format
  2018-10-16 12:44 archiver.bbclass: do_dumpdata - shell format Tomasz Dziendzielski
@ 2018-10-16 13:00 ` Burton, Ross
  2018-10-16 14:00   ` Tomasz Dziendzielski
  0 siblings, 1 reply; 6+ messages in thread
From: Burton, Ross @ 2018-10-16 13:00 UTC (permalink / raw)
  To: tomasz.dziendzielski; +Cc: Yocto-mailing-list

Do you actually want to source the data files, and if so why?  As with
the bitbake -e output, it's shell-like but not actually shell.

Ross
On Tue, 16 Oct 2018 at 13:44, Tomasz Dziendzielski
<tomasz.dziendzielski@gmail.com> wrote:
>
> Hi,
> when using archiver.bbclass the do_dumpdata task is using bb.data.emit_env function, which should emit variables "in a format such that it can be sourced by a shell.".
> The problem is that the *-showdata.dump file can't be properly sourced, because variables are not in a correct format.
>
> There are many lines like:
> PREFERRED_PROVIDER_virtual/fakeroot-native="pseudo-native"
> The variables with slash are considered to be a directory and the ones with dash are considered to be a command.
> Also shell cannot properly set the variables like FOO_machine.
>
> Should it be sourced with some specific shell or is that function wrong and should be fixed?
>
> Best regards,
> Tomasz Dziendzielski
> --
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto


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

* Re: archiver.bbclass: do_dumpdata - shell format
  2018-10-16 13:00 ` Burton, Ross
@ 2018-10-16 14:00   ` Tomasz Dziendzielski
  2018-10-18  8:56     ` Tomasz Dziendzielski
  0 siblings, 1 reply; 6+ messages in thread
From: Tomasz Dziendzielski @ 2018-10-16 14:00 UTC (permalink / raw)
  To: ross.burton; +Cc: yocto

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

Yes, I want to source the data files. I'm trying to adapt devtool the way
it's creating the workspace, then I'm sourcing a script with all the
necessary variables and then interactively run commands by hand.
I was thinking about the devshell but in devshell variables like ${S}, ${B}
are not set and developers would need to set it manually. Or maybe this is
where we should do the change and inject exporting that variables in
devshell?

>it's shell-like but not actually shell.
So we should not state that this can be sourced by a shell. It's stated in
bitbake/lib/bb/data.py few times.
Or fix it and make it possible to source.

Best regards,
Tomasz Dziendzielski

wt., 16 paź 2018 o 15:00 Burton, Ross <ross.burton@intel.com> napisał(a):

> Do you actually want to source the data files, and if so why?  As with
> the bitbake -e output, it's shell-like but not actually shell.
>
> Ross
> On Tue, 16 Oct 2018 at 13:44, Tomasz Dziendzielski
> <tomasz.dziendzielski@gmail.com> wrote:
> >
> > Hi,
> > when using archiver.bbclass the do_dumpdata task is using
> bb.data.emit_env function, which should emit variables "in a format such
> that it can be sourced by a shell.".
> > The problem is that the *-showdata.dump file can't be properly sourced,
> because variables are not in a correct format.
> >
> > There are many lines like:
> > PREFERRED_PROVIDER_virtual/fakeroot-native="pseudo-native"
> > The variables with slash are considered to be a directory and the ones
> with dash are considered to be a command.
> > Also shell cannot properly set the variables like FOO_machine.
> >
> > Should it be sourced with some specific shell or is that function wrong
> and should be fixed?
> >
> > Best regards,
> > Tomasz Dziendzielski
> > --
> > _______________________________________________
> > yocto mailing list
> > yocto@yoctoproject.org
> > https://lists.yoctoproject.org/listinfo/yocto
>

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

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

* Re: archiver.bbclass: do_dumpdata - shell format
  2018-10-16 14:00   ` Tomasz Dziendzielski
@ 2018-10-18  8:56     ` Tomasz Dziendzielski
  2018-10-18  9:51       ` Burton, Ross
  0 siblings, 1 reply; 6+ messages in thread
From: Tomasz Dziendzielski @ 2018-10-18  8:56 UTC (permalink / raw)
  To: ross.burton; +Cc: yocto

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

So what is the proper solution?

Best regards,
Tomasz Dziendzielski

wt., 16 paź 2018 o 16:00 Tomasz Dziendzielski <
tomasz.dziendzielski@gmail.com> napisał(a):

> Yes, I want to source the data files. I'm trying to adapt devtool the way
> it's creating the workspace, then I'm sourcing a script with all the
> necessary variables and then interactively run commands by hand.
> I was thinking about the devshell but in devshell variables like ${S},
> ${B} are not set and developers would need to set it manually. Or maybe
> this is where we should do the change and inject exporting that variables
> in devshell?
>
> >it's shell-like but not actually shell.
> So we should not state that this can be sourced by a shell. It's stated in
> bitbake/lib/bb/data.py few times.
> Or fix it and make it possible to source.
>
> Best regards,
> Tomasz Dziendzielski
>
> wt., 16 paź 2018 o 15:00 Burton, Ross <ross.burton@intel.com> napisał(a):
>
>> Do you actually want to source the data files, and if so why?  As with
>> the bitbake -e output, it's shell-like but not actually shell.
>>
>> Ross
>> On Tue, 16 Oct 2018 at 13:44, Tomasz Dziendzielski
>> <tomasz.dziendzielski@gmail.com> wrote:
>> >
>> > Hi,
>> > when using archiver.bbclass the do_dumpdata task is using
>> bb.data.emit_env function, which should emit variables "in a format such
>> that it can be sourced by a shell.".
>> > The problem is that the *-showdata.dump file can't be properly sourced,
>> because variables are not in a correct format.
>> >
>> > There are many lines like:
>> > PREFERRED_PROVIDER_virtual/fakeroot-native="pseudo-native"
>> > The variables with slash are considered to be a directory and the ones
>> with dash are considered to be a command.
>> > Also shell cannot properly set the variables like FOO_machine.
>> >
>> > Should it be sourced with some specific shell or is that function wrong
>> and should be fixed?
>> >
>> > Best regards,
>> > Tomasz Dziendzielski
>> > --
>> > _______________________________________________
>> > yocto mailing list
>> > yocto@yoctoproject.org
>> > https://lists.yoctoproject.org/listinfo/yocto
>>
>

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

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

* Re: archiver.bbclass: do_dumpdata - shell format
  2018-10-18  8:56     ` Tomasz Dziendzielski
@ 2018-10-18  9:51       ` Burton, Ross
  2018-10-18 10:05         ` Tomasz Dziendzielski
  0 siblings, 1 reply; 6+ messages in thread
From: Burton, Ross @ 2018-10-18  9:51 UTC (permalink / raw)
  To: tomasz.dziendzielski; +Cc: Yocto-mailing-list

Well, as you've discovered, bitbake variables can have names that are
invalid in shell.  I suspect the proper solution is to treat the -e
output as shell-like, and parse it with a proper parser.

Ross
On Thu, 18 Oct 2018 at 09:56, Tomasz Dziendzielski
<tomasz.dziendzielski@gmail.com> wrote:
>
> So what is the proper solution?
>
> Best regards,
> Tomasz Dziendzielski
>
> wt., 16 paź 2018 o 16:00 Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com> napisał(a):
>>
>> Yes, I want to source the data files. I'm trying to adapt devtool the way it's creating the workspace, then I'm sourcing a script with all the necessary variables and then interactively run commands by hand.
>> I was thinking about the devshell but in devshell variables like ${S}, ${B} are not set and developers would need to set it manually. Or maybe this is where we should do the change and inject exporting that variables in devshell?
>>
>> >it's shell-like but not actually shell.
>> So we should not state that this can be sourced by a shell. It's stated in bitbake/lib/bb/data.py few times.
>> Or fix it and make it possible to source.
>>
>> Best regards,
>> Tomasz Dziendzielski
>>
>> wt., 16 paź 2018 o 15:00 Burton, Ross <ross.burton@intel.com> napisał(a):
>>>
>>> Do you actually want to source the data files, and if so why?  As with
>>> the bitbake -e output, it's shell-like but not actually shell.
>>>
>>> Ross
>>> On Tue, 16 Oct 2018 at 13:44, Tomasz Dziendzielski
>>> <tomasz.dziendzielski@gmail.com> wrote:
>>> >
>>> > Hi,
>>> > when using archiver.bbclass the do_dumpdata task is using bb.data.emit_env function, which should emit variables "in a format such that it can be sourced by a shell.".
>>> > The problem is that the *-showdata.dump file can't be properly sourced, because variables are not in a correct format.
>>> >
>>> > There are many lines like:
>>> > PREFERRED_PROVIDER_virtual/fakeroot-native="pseudo-native"
>>> > The variables with slash are considered to be a directory and the ones with dash are considered to be a command.
>>> > Also shell cannot properly set the variables like FOO_machine.
>>> >
>>> > Should it be sourced with some specific shell or is that function wrong and should be fixed?
>>> >
>>> > Best regards,
>>> > Tomasz Dziendzielski
>>> > --
>>> > _______________________________________________
>>> > yocto mailing list
>>> > yocto@yoctoproject.org
>>> > https://lists.yoctoproject.org/listinfo/yocto


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

* Re: archiver.bbclass: do_dumpdata - shell format
  2018-10-18  9:51       ` Burton, Ross
@ 2018-10-18 10:05         ` Tomasz Dziendzielski
  0 siblings, 0 replies; 6+ messages in thread
From: Tomasz Dziendzielski @ 2018-10-18 10:05 UTC (permalink / raw)
  To: ross.burton; +Cc: yocto

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

>I suspect the proper solution is to treat the -e output as shell-like
From the bitbake/lib/bb/data.py:
"""Emits all items in the data store in a format such that it can be
sourced by a shell."""
so if you say it's shell-like, not shell, shouldn't we replace that to
"""Emits all items in the data store in a shell-like format"""?
If it cannot be sourced the statement "can be sourced by a shell" should be
removed.

>parse it with a proper parser.
So is there any proper parser to source this?

Best regards,
Tomasz Dziendzielski

czw., 18 paź 2018 o 11:51 Burton, Ross <ross.burton@intel.com> napisał(a):

> Well, as you've discovered, bitbake variables can have names that are
> invalid in shell.  I suspect the proper solution is to treat the -e
> output as shell-like, and parse it with a proper parser.
>
> Ross
> On Thu, 18 Oct 2018 at 09:56, Tomasz Dziendzielski
> <tomasz.dziendzielski@gmail.com> wrote:
> >
> > So what is the proper solution?
> >
> > Best regards,
> > Tomasz Dziendzielski
> >
> > wt., 16 paź 2018 o 16:00 Tomasz Dziendzielski <
> tomasz.dziendzielski@gmail.com> napisał(a):
> >>
> >> Yes, I want to source the data files. I'm trying to adapt devtool the
> way it's creating the workspace, then I'm sourcing a script with all the
> necessary variables and then interactively run commands by hand.
> >> I was thinking about the devshell but in devshell variables like ${S},
> ${B} are not set and developers would need to set it manually. Or maybe
> this is where we should do the change and inject exporting that variables
> in devshell?
> >>
> >> >it's shell-like but not actually shell.
> >> So we should not state that this can be sourced by a shell. It's stated
> in bitbake/lib/bb/data.py few times.
> >> Or fix it and make it possible to source.
> >>
> >> Best regards,
> >> Tomasz Dziendzielski
> >>
> >> wt., 16 paź 2018 o 15:00 Burton, Ross <ross.burton@intel.com>
> napisał(a):
> >>>
> >>> Do you actually want to source the data files, and if so why?  As with
> >>> the bitbake -e output, it's shell-like but not actually shell.
> >>>
> >>> Ross
> >>> On Tue, 16 Oct 2018 at 13:44, Tomasz Dziendzielski
> >>> <tomasz.dziendzielski@gmail.com> wrote:
> >>> >
> >>> > Hi,
> >>> > when using archiver.bbclass the do_dumpdata task is using
> bb.data.emit_env function, which should emit variables "in a format such
> that it can be sourced by a shell.".
> >>> > The problem is that the *-showdata.dump file can't be properly
> sourced, because variables are not in a correct format.
> >>> >
> >>> > There are many lines like:
> >>> > PREFERRED_PROVIDER_virtual/fakeroot-native="pseudo-native"
> >>> > The variables with slash are considered to be a directory and the
> ones with dash are considered to be a command.
> >>> > Also shell cannot properly set the variables like FOO_machine.
> >>> >
> >>> > Should it be sourced with some specific shell or is that function
> wrong and should be fixed?
> >>> >
> >>> > Best regards,
> >>> > Tomasz Dziendzielski
> >>> > --
> >>> > _______________________________________________
> >>> > yocto mailing list
> >>> > yocto@yoctoproject.org
> >>> > https://lists.yoctoproject.org/listinfo/yocto
>

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

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

end of thread, other threads:[~2018-10-18 10:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-16 12:44 archiver.bbclass: do_dumpdata - shell format Tomasz Dziendzielski
2018-10-16 13:00 ` Burton, Ross
2018-10-16 14:00   ` Tomasz Dziendzielski
2018-10-18  8:56     ` Tomasz Dziendzielski
2018-10-18  9:51       ` Burton, Ross
2018-10-18 10:05         ` Tomasz Dziendzielski

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.