1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-09 05:29:32 +00:00

generate-manifest-2.7.py: add logic to generate native manifest

python-native supposes to RPROVIDE all native packages as added in
generate-manifest-2.7.py, but it does not so far, this leads a problem
that sometimes bitbake cant find a runtime provider for a python-*-native
when a new runtime dependency on it being required, this usualy happens
after a new native python-* recipe is created or the old native python-*
recipes are upgraded.

To give a example, the following commit is trying to address such a issue:
commit 4583cd1bb15306e8f0ab7bcd80732e6f35aa4533:
[ python-native: Make python-native also RPROVIDE python-unittest-native ]

To avoid manually extending RPROVIDE every time when a new runtime
dependency is introduced, an argument '-n/--native' is added to the
manifest generator, allowing it create a native python manifest, with a
RPROVIDE line only, the RPROVIDE should contain all the sub-packages.

The generated python-native-2.7-manifest.inc is also added which is
included by python-native recipe.

(From OE-Core rev: 0cb15d9559e34faffea1ac0be825d0602f225ba9)

Signed-off-by: Ming Liu <peter.x.liu@external.atlascopco.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Ming Liu
2017-02-26 08:39:19 +01:00
committed by Richard Purdie
parent 8d8d0a52d5
commit e720e3b4af
3 changed files with 42 additions and 15 deletions
@@ -9,10 +9,14 @@
# * Updated to no longer generate special -dbg package, instead use the
# single system -dbg
# * Update version with ".1" to indicate this change
#
# February 26, 2017 -- Ming Liu <peter.x.liu@external.atlascopco.com>
# * Updated to support generating manifest for native python
import os
import sys
import time
import argparse
VERSION = "2.7.2"
@@ -21,16 +25,17 @@ __version__ = "20110222.2"
class MakefileMaker:
def __init__( self, outfile ):
def __init__( self, outfile, isNative ):
"""initialize"""
self.packages = {}
self.targetPrefix = "${libdir}/python%s/" % VERSION[:3]
self.isNative = isNative
self.output = outfile
self.out( """
# WARNING: This file is AUTO GENERATED: Manual edits will be lost next time I regenerate the file.
# Generator: '%s' Version %s (C) 2002-2010 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
# Generator: '%s%s' Version %s (C) 2002-2010 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
# Visit the Python for Embedded Systems Site => http://www.Vanille.de/projects/python.spy
""" % ( sys.argv[0], __version__ ) )
""" % ( sys.argv[0], ' --native' if isNative else '', __version__ ) )
#
# helper functions
@@ -65,6 +70,20 @@ class MakefileMaker:
global VERSION
#
# generate rprovides line for native
#
if self.isNative:
rprovideLine = 'RPROVIDES+="'
for name in sorted(self.packages):
rprovideLine += "%s-native " % name.replace( '${PN}', 'python' )
rprovideLine += '"'
self.out( rprovideLine )
self.out( "" )
return
#
# generate provides line
#
@@ -147,17 +166,21 @@ class MakefileMaker:
self.doEpilog()
if __name__ == "__main__":
parser = argparse.ArgumentParser( description='generate python manifest' )
parser.add_argument( '-n', '--native', help='generate manifest for native python', action='store_true' )
parser.add_argument( 'outfile', metavar='OUTPUT_FILE', nargs='?', default='', help='Output file (defaults to stdout)' )
args = parser.parse_args()
if len( sys.argv ) > 1:
if args.outfile:
try:
os.unlink(sys.argv[1])
os.unlink( args.outfile )
except Exception:
sys.exc_clear()
outfile = open( sys.argv[1], "w" )
outfile = open( args.outfile, "w" )
else:
outfile = sys.stdout
m = MakefileMaker( outfile )
m = MakefileMaker( outfile, args.native )
# Add packages here. Only specify dlopen-style library dependencies here, no ldd-style dependencies!
# Parameters: revision, name, description, dependencies, filenames