[yocto] Perforce fetcher ignores module and label

Andrew Bradford andrew at bradfordembedded.com
Mon Aug 7 04:17:40 PDT 2017


Hi Katu,

Sorry for the delay in my reply, I was on holiday.

On 08/02 10:28, Paul Eggleton wrote:
> Andrew Bradford (on CC) was the last person to make significant changes to 
> that module.
>
> On Wednesday, 2 August 2017 9:40:10 AM CEST Katu Txakur wrote:
> > I'm still having problems fetching from Perforce. Is there any
> > documentation based on the latest implementation of the
> > poky/bitbake/lib/bb/fetch2/perforce.py file?

There's some documentation now in the official Yocto Project
documentation location for bitbake fetchers [1].  Prior to my changes
there was very little if any documentation, afaik.

[1]: http://www.yoctoproject.org/docs/2.3.1/bitbake-user-manual/bitbake-user-manual.html#perforce-fetcher

> > 2017-07-25 10:05 GMT+01:00 Katu Txakur <katutxakurra at gmail.com>:
> > 
> > > Hi,
> > >
> > > I'm upgrading a recipe that fetches the source code from Perforce.
> > >
> > > The old recipe was:
> > >
> > > SRC_URI = " \
> > >   p4://${P4USER}:${P4PASSWD}:${P4HOST}:${P4PORT}@Depot/path/pe
> > > rforce/...;module=local/path/relativeto/p4;label=${P4CHANGELIST} \
> > >   "
> > >
> > > With the new version of /lib/bb/fetch2/perforce.py, I had to set P4PORT
> > > outside SRC_URI, leaving the recipe with:
> > >
> > > SRC_URI = " \
> > >   p4://${P4USER}:${P4PASSWD}@Depot/path/perforce/...;module=
> > > local/path/relativeto/p4;label=${P4CHANGELIST} \
> > >   "
> > >
> > > The Perforce fetcher kind of works, but it seems to be ignoring the
> > > "module" and the "label" attributes. After reading the Python script I can
> > > see that after the "@", only the substring before the first ";" is used.

Sorry for not making the label change more clear, but you should be able
to simply set SRCREV="labelname" and have the functionality you desire.
However, we don't use labels very often internally, so the use of labels
in SRCREV isn't tested that often by me.

This change to using labels, changelist numbers, and allowing the use of
AUTOREV was made so that the perforce fetcher would act more like the
other source code control system fetchers.  Prior to my changes to the
p4 fetcher, the way that recipes using p4 had to be written seemed
rather awkward to me.  The way it is now isn't perfect, but it's closer
to how the other fetchers act, I think (and hope).

> > > Is there a way to set module and label/changelist? I have several folders
> > > per recipe that I need to map to different subfolders and with the current
> > > script some of the folders don't get fetched.

I'm not sure I understand enough about how you use perforce and what you
mean by mapping different subfolders.  Can you explain this in a more
expanded way to me?  Maybe with some examples?

Thanks,
Andrew



More information about the yocto mailing list