diff options
author | Ming Liu <peter.x.liu@external.atlascopco.com> | 2017-02-26 08:44:45 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-03-01 23:27:10 +0000 |
commit | 2f821f3c094927572fa599e3a07931b97073642e (patch) | |
tree | caf872e10efef9cf93c1cea7fa4ca572f643bbe4 /scripts/contrib | |
parent | e720e3b4af036f0867f7616470013c714cad38e1 (diff) | |
download | poky-2f821f3c094927572fa599e3a07931b97073642e.tar.gz |
generate-manifest-3.5.py: add logic to generate native manifest
python3-native supposes to RPROVIDE all native packages as added in
generate-manifest-3.5.py, but it does not so far, this leads a problem
that sometimes bitbake cant find a runtime provider for a python3-*-native
when a new runtime dependency on it being required, this usualy happens
after a new native python3-* recipe is created or the old native python3-*
recipes are upgraded.
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 python3 manifest, with a
RPROVIDE line only, the RPROVIDE should contain all the sub-packages.
The generated python-native-3.5-manifest.inc is also added which is
included by python3-native recipe.
(From OE-Core rev: 800753069f667cd1664d70b3779150c467e3b3fe)
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>
Diffstat (limited to 'scripts/contrib')
-rwxr-xr-x | scripts/contrib/python/generate-manifest-3.5.py | 37 |
1 files changed, 30 insertions, 7 deletions
diff --git a/scripts/contrib/python/generate-manifest-3.5.py b/scripts/contrib/python/generate-manifest-3.5.py index 5e2eeb7bef..a7fc8bad09 100755 --- a/scripts/contrib/python/generate-manifest-3.5.py +++ b/scripts/contrib/python/generate-manifest-3.5.py | |||
@@ -13,9 +13,13 @@ | |||
13 | # 2014 Khem Raj <raj.khem@gmail.com> | 13 | # 2014 Khem Raj <raj.khem@gmail.com> |
14 | # Added python3 support | 14 | # Added python3 support |
15 | # | 15 | # |
16 | # February 26, 2017 -- Ming Liu <peter.x.liu@external.atlascopco.com> | ||
17 | # * Updated to support generating manifest for native python3 | ||
18 | |||
16 | import os | 19 | import os |
17 | import sys | 20 | import sys |
18 | import time | 21 | import time |
22 | import argparse | ||
19 | 23 | ||
20 | VERSION = "3.5.0" | 24 | VERSION = "3.5.0" |
21 | 25 | ||
@@ -24,16 +28,17 @@ __version__ = "20140131" | |||
24 | 28 | ||
25 | class MakefileMaker: | 29 | class MakefileMaker: |
26 | 30 | ||
27 | def __init__( self, outfile ): | 31 | def __init__( self, outfile, isNative ): |
28 | """initialize""" | 32 | """initialize""" |
29 | self.packages = {} | 33 | self.packages = {} |
30 | self.targetPrefix = "${libdir}/python%s/" % VERSION[:3] | 34 | self.targetPrefix = "${libdir}/python%s/" % VERSION[:3] |
35 | self.isNative = isNative | ||
31 | self.output = outfile | 36 | self.output = outfile |
32 | self.out( """ | 37 | self.out( """ |
33 | # WARNING: This file is AUTO GENERATED: Manual edits will be lost next time I regenerate the file. | 38 | # WARNING: This file is AUTO GENERATED: Manual edits will be lost next time I regenerate the file. |
34 | # Generator: '%s' Version %s (C) 2002-2010 Michael 'Mickey' Lauer <mlauer@vanille-media.de> | 39 | # Generator: '%s%s' Version %s (C) 2002-2010 Michael 'Mickey' Lauer <mlauer@vanille-media.de> |
35 | # Visit the Python for Embedded Systems Site => http://www.Vanille.de/projects/python.spy | 40 | # Visit the Python for Embedded Systems Site => http://www.Vanille.de/projects/python.spy |
36 | """ % ( sys.argv[0], __version__ ) ) | 41 | """ % ( sys.argv[0], ' --native' if isNative else '', __version__ ) ) |
37 | 42 | ||
38 | # | 43 | # |
39 | # helper functions | 44 | # helper functions |
@@ -79,6 +84,20 @@ class MakefileMaker: | |||
79 | global VERSION | 84 | global VERSION |
80 | 85 | ||
81 | # | 86 | # |
87 | # generate rprovides line for native | ||
88 | # | ||
89 | |||
90 | if self.isNative: | ||
91 | rprovideLine = 'RPROVIDES+="' | ||
92 | for name in sorted(self.packages): | ||
93 | rprovideLine += "%s-native " % name.replace( '${PN}', 'python3' ) | ||
94 | rprovideLine += '"' | ||
95 | |||
96 | self.out( rprovideLine ) | ||
97 | self.out( "" ) | ||
98 | return | ||
99 | |||
100 | # | ||
82 | # generate provides line | 101 | # generate provides line |
83 | # | 102 | # |
84 | 103 | ||
@@ -160,17 +179,21 @@ class MakefileMaker: | |||
160 | self.doEpilog() | 179 | self.doEpilog() |
161 | 180 | ||
162 | if __name__ == "__main__": | 181 | if __name__ == "__main__": |
182 | parser = argparse.ArgumentParser( description='generate python3 manifest' ) | ||
183 | parser.add_argument( '-n', '--native', help='generate manifest for native python3', action='store_true' ) | ||
184 | parser.add_argument( 'outfile', metavar='OUTPUT_FILE', nargs='?', default='', help='Output file (defaults to stdout)' ) | ||
185 | args = parser.parse_args() | ||
163 | 186 | ||
164 | if len( sys.argv ) > 1: | 187 | if args.outfile: |
165 | try: | 188 | try: |
166 | os.unlink(sys.argv[1]) | 189 | os.unlink( args.outfile ) |
167 | except Exception: | 190 | except Exception: |
168 | sys.exc_clear() | 191 | sys.exc_clear() |
169 | outfile = open( sys.argv[1], "w" ) | 192 | outfile = open( args.outfile, "w" ) |
170 | else: | 193 | else: |
171 | outfile = sys.stdout | 194 | outfile = sys.stdout |
172 | 195 | ||
173 | m = MakefileMaker( outfile ) | 196 | m = MakefileMaker( outfile, args.native ) |
174 | 197 | ||
175 | # Add packages here. Only specify dlopen-style library dependencies here, no ldd-style dependencies! | 198 | # Add packages here. Only specify dlopen-style library dependencies here, no ldd-style dependencies! |
176 | # Parameters: revision, name, description, dependencies, filenames | 199 | # Parameters: revision, name, description, dependencies, filenames |