[OE-core] [PATCH] devtool: add package plugin that lets you create package via devtool

Paul Eggleton paul.eggleton at linux.intel.com
Tue Sep 1 21:11:13 UTC 2015


On Tuesday 01 September 2015 19:16:18 Brendan Le Foll wrote:
> On Thu, Aug 27, 2015 at 03:19:01PM +0100, Paul Eggleton wrote:
> > Hi Brendan,
> > 
> > > 'bitbake -e %s | grep IMAGE_PKGTYPE' % (args.recipename), watch=False) +
> > > except bb.process.ExecutionError as e:
> > > +        logger.error('Unable to get IMAGE_PKGTYPE for image')
> > > +        return e.exitcode
> > > +
> > > +    image_pkgtype = str(image_pkgtype).split('=', 1)[1].split('"',
> > > 2)[1]
> > > +    if image_pkgtype not in ("rpm", "ipk", "tar", "deb"):
> > > +        logger.error('Invalid package format (%s) found' %
> > > image_pkgtype)
> > > +        return 1
> > 
> > Instead of this, how about:
> >     tinfoil = setup_tinfoil()
> >     
> >     try:
> >         tinfoil.prepare(config_only=True)
> >         image_pkgtype = tinfoil.config_data.getVar('IMAGE_PKGTYPE', True)
> >     
> >     finally:
> >         tinfoil.shutdown()
> 
> Yeah that's much nicer. Wasn't too sure how to use tinfoil, I need to
> read about it.
> 
> > > +    package_task = config.get('Package', 'package_task',
> > > 'package_write_%s' % image_pkgtype)
> > 
> > Hmm, shouldn't the config be for image_pkgtype rather than this? (Since
> > even if this is set we'd still be using the IMAGE_PKGTYPE value for the
> > directory path in the message later on).
> 
> I don't understand what you mean, afaik I can't get IMAGE_PKGTYPE
> using config which is why bitbake/tinfoil has to be used. I'm probably
> missing something obvious sorry!

I mean optionally store the package type in the configuration instead of the 
package write task, and if it's set there you don't need to query the build 
system at all. At the moment the logic is a bit weird - e.g. hypothetically 
you may have the package write function configured as "package_write_ipk" but 
the build system could be set up to use RPM.

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre



More information about the Openembedded-core mailing list