python: Adds instructions to the manifest file

While there is a bit of documentation regarding building a new
manifest file for python, it seems that users usually only read
the manifest file.

The manifest file is in JSON format which doesn't allow comments,
hence why instructions were initially put elsewhere.

This patch hacks the call to open the JSON manifest file by using a
marker to trick it into reading only part of the file as the manifest
itself, and keep the other part as comments, which contain instructions
for the user to run the create_manifest task after an upgrade or
when adding a new package.

(From OE-Core rev: 5641a24a70b54544012c04c6a082514d9a5aa49a)

Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandr@xilinx.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Alejandro Enedino Hernandez Samaniego
2018-11-16 11:31:46 -08:00
committed by Richard Purdie
parent 6c524c0906
commit 8627773268
4 changed files with 117 additions and 6 deletions

View File

@@ -69,7 +69,11 @@ python(){
import json
pythondir = d.getVar('THISDIR',True)
with open(pythondir+'/python/python2-manifest.json') as manifest_file:
python_manifest=json.load(manifest_file)
manifest_str = manifest_file.read()
json_start = manifest_str.find('# EOC') + 6
manifest_file.seek(json_start)
manifest_str = manifest_file.read()
python_manifest = json.loads(manifest_str)
rprovides = d.getVar('RPROVIDES').split()