summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-08-16 15:01:06 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-08-17 08:53:04 (GMT)
commitdd6b55d70c0616e69ecc7366650cd0f7e1678bd8 (patch)
treed00f23f07f237d833ee7e11df584fa17dd7c41cc
parent12e1f9815d7f0bf6dbe22e8e9cff6d1bda9241ce (diff)
downloadpoky-dd6b55d70c0616e69ecc7366650cd0f7e1678bd8.tar.gz
package/scripts: Fix FILES_INFO handling
There is a long standing bug where FILES_INFO isn't written into pkgdata with a package suffix. This means if the files are read into the datastore as intended, the last one "wins". Fix this to work as intended. Most of the call sites using the data need to be updated to handle this and the overrides change correctly. Also fix some other problematic references noticed along the way. (From OE-Core rev: a1190903e0a61a12c9854c96af918ae8d12c6327) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/insane.bbclass4
-rw-r--r--meta/classes/package.bbclass2
-rw-r--r--meta/classes/toaster.bbclass2
-rw-r--r--scripts/lib/devtool/search.py5
-rw-r--r--scripts/lib/recipetool/append.py8
-rw-r--r--scripts/lib/recipetool/create.py4
-rw-r--r--scripts/lib/recipetool/create_buildsys_python.py2
-rwxr-xr-xscripts/oe-pkgdata-util4
8 files changed, 16 insertions, 15 deletions
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index 810459d..b84e603 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -808,11 +808,11 @@ def package_qa_check_rdepends(pkg, pkgdest, skip, taskdeps, packages, d):
808 # For Saving the FILERPROVIDES, RPROVIDES and FILES_INFO 808 # For Saving the FILERPROVIDES, RPROVIDES and FILES_INFO
809 rdep_data = oe.packagedata.read_subpkgdata(rdep, d) 809 rdep_data = oe.packagedata.read_subpkgdata(rdep, d)
810 for key in rdep_data: 810 for key in rdep_data:
811 if key.startswith("FILERPROVIDES_") or key.startswith("RPROVIDES:"): 811 if key.startswith("FILERPROVIDES:") or key.startswith("RPROVIDES:"):
812 for subkey in bb.utils.explode_deps(rdep_data[key]): 812 for subkey in bb.utils.explode_deps(rdep_data[key]):
813 filerdepends.pop(subkey,None) 813 filerdepends.pop(subkey,None)
814 # Add the files list to the rprovides 814 # Add the files list to the rprovides
815 if key == "FILES_INFO": 815 if key.startswith("FILES_INFO:"):
816 # Use eval() to make it as a dict 816 # Use eval() to make it as a dict
817 for subkey in eval(rdep_data[key]): 817 for subkey in eval(rdep_data[key]):
818 filerdepends.pop(subkey,None) 818 filerdepends.pop(subkey,None)
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index a9138ff..fb3c346 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -1652,7 +1652,7 @@ fi
1652 if fstat.st_ino not in seen: 1652 if fstat.st_ino not in seen:
1653 seen.add(fstat.st_ino) 1653 seen.add(fstat.st_ino)
1654 total_size += fstat.st_size 1654 total_size += fstat.st_size
1655 d.setVar('FILES_INFO', json.dumps(files, sort_keys=True)) 1655 d.setVar('FILES_INFO:' + pkg , json.dumps(files, sort_keys=True))
1656 1656
1657 process_postinst_on_target(pkg, d.getVar("MLPREFIX")) 1657 process_postinst_on_target(pkg, d.getVar("MLPREFIX"))
1658 add_set_e_to_scriptlets(pkg) 1658 add_set_e_to_scriptlets(pkg)
diff --git a/meta/classes/toaster.bbclass b/meta/classes/toaster.bbclass
index 9518ddf..dd5c7f2 100644
--- a/meta/classes/toaster.bbclass
+++ b/meta/classes/toaster.bbclass
@@ -106,7 +106,7 @@ def _toaster_load_pkgdatafile(dirpath, filepath):
106 pkgdata['OPKGN'] = m.group(1) 106 pkgdata['OPKGN'] = m.group(1)
107 kn = "_".join([x for x in kn.split("_") if x.isupper()]) 107 kn = "_".join([x for x in kn.split("_") if x.isupper()])
108 pkgdata[kn] = kv.strip() 108 pkgdata[kn] = kv.strip()
109 if kn == 'FILES_INFO': 109 if kn.startswith('FILES_INFO'):
110 pkgdata[kn] = json.loads(kv) 110 pkgdata[kn] = json.loads(kv)
111 111
112 except ValueError: 112 except ValueError:
diff --git a/scripts/lib/devtool/search.py b/scripts/lib/devtool/search.py
index d81cdd8..70b81ca 100644
--- a/scripts/lib/devtool/search.py
+++ b/scripts/lib/devtool/search.py
@@ -62,10 +62,11 @@ def search(args, config, basepath, workspace):
62 with open(os.path.join(pkgdata_dir, 'runtime', pkg), 'r') as f: 62 with open(os.path.join(pkgdata_dir, 'runtime', pkg), 'r') as f:
63 for line in f: 63 for line in f:
64 if ': ' in line: 64 if ': ' in line:
65 splitline = line.split(':', 1) 65 splitline = line.split(': ', 1)
66 key = splitline[0] 66 key = splitline[0]
67 value = splitline[1].strip() 67 value = splitline[1].strip()
68 if key in ['PKG:%s' % pkg, 'DESCRIPTION', 'FILES_INFO'] or key.startswith('FILERPROVIDES_'): 68 key = key.replace(":" + pkg, "")
69 if key in ['PKG', 'DESCRIPTION', 'FILES_INFO', 'FILERPROVIDES']:
69 if keyword_rc.search(value): 70 if keyword_rc.search(value):
70 match = True 71 match = True
71 break 72 break
diff --git a/scripts/lib/recipetool/append.py b/scripts/lib/recipetool/append.py
index 5f629c0..88ed8c5 100644
--- a/scripts/lib/recipetool/append.py
+++ b/scripts/lib/recipetool/append.py
@@ -72,15 +72,15 @@ def find_target_file(targetpath, d, pkglist=None):
72 # This does assume that PN comes before other values, but that's a fairly safe assumption 72 # This does assume that PN comes before other values, but that's a fairly safe assumption
73 for line in f: 73 for line in f:
74 if line.startswith('PN:'): 74 if line.startswith('PN:'):
75 pn = line.split(':', 1)[1].strip() 75 pn = line.split(': ', 1)[1].strip()
76 elif line.startswith('FILES_INFO:'): 76 elif line.startswith('FILES_INFO'):
77 val = line.split(':', 1)[1].strip() 77 val = line.split(': ', 1)[1].strip()
78 dictval = json.loads(val) 78 dictval = json.loads(val)
79 for fullpth in dictval.keys(): 79 for fullpth in dictval.keys():
80 if fnmatch.fnmatchcase(fullpth, targetpath): 80 if fnmatch.fnmatchcase(fullpth, targetpath):
81 recipes[targetpath].append(pn) 81 recipes[targetpath].append(pn)
82 elif line.startswith('pkg_preinst:') or line.startswith('pkg_postinst:'): 82 elif line.startswith('pkg_preinst:') or line.startswith('pkg_postinst:'):
83 scriptval = line.split(':', 1)[1].strip().encode('utf-8').decode('unicode_escape') 83 scriptval = line.split(': ', 1)[1].strip().encode('utf-8').decode('unicode_escape')
84 if 'update-alternatives --install %s ' % targetpath in scriptval: 84 if 'update-alternatives --install %s ' % targetpath in scriptval:
85 recipes[targetpath].append('?%s' % pn) 85 recipes[targetpath].append('?%s' % pn)
86 elif targetpath_re.search(scriptval): 86 elif targetpath_re.search(scriptval):
diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py
index 0ac97e0..5cd72ea 100644
--- a/scripts/lib/recipetool/create.py
+++ b/scripts/lib/recipetool/create.py
@@ -115,8 +115,8 @@ class RecipeHandler(object):
115 for line in f: 115 for line in f:
116 if line.startswith('PN:'): 116 if line.startswith('PN:'):
117 pn = line.split(':', 1)[-1].strip() 117 pn = line.split(':', 1)[-1].strip()
118 elif line.startswith('FILES_INFO:'): 118 elif line.startswith('FILES_INFO:%s:' % pkg):
119 val = line.split(':', 1)[1].strip() 119 val = line.split(': ', 1)[1].strip()
120 dictval = json.loads(val) 120 dictval = json.loads(val)
121 for fullpth in sorted(dictval): 121 for fullpth in sorted(dictval):
122 if fullpth.startswith(includedir) and fullpth.endswith('.h'): 122 if fullpth.startswith(includedir) and fullpth.endswith('.h'):
diff --git a/scripts/lib/recipetool/create_buildsys_python.py b/scripts/lib/recipetool/create_buildsys_python.py
index fdd3366..8aa4465 100644
--- a/scripts/lib/recipetool/create_buildsys_python.py
+++ b/scripts/lib/recipetool/create_buildsys_python.py
@@ -545,7 +545,7 @@ class PythonRecipeHandler(RecipeHandler):
545 with open(pkgdatafile, 'r') as f: 545 with open(pkgdatafile, 'r') as f:
546 for line in f.readlines(): 546 for line in f.readlines():
547 field, value = line.split(': ', 1) 547 field, value = line.split(': ', 1)
548 if field == 'FILES_INFO': 548 if field.startswith('FILES_INFO'):
549 files_info = ast.literal_eval(value) 549 files_info = ast.literal_eval(value)
550 break 550 break
551 else: 551 else:
diff --git a/scripts/oe-pkgdata-util b/scripts/oe-pkgdata-util
index 94d4400..ffa3850 100755
--- a/scripts/oe-pkgdata-util
+++ b/scripts/oe-pkgdata-util
@@ -431,7 +431,7 @@ def list_pkg_files(args):
431 for line in f: 431 for line in f:
432 if line.startswith('FILES_INFO:'): 432 if line.startswith('FILES_INFO:'):
433 found = True 433 found = True
434 val = line.split(':', 1)[1].strip() 434 val = line.split(': ', 1)[1].strip()
435 dictval = json.loads(val) 435 dictval = json.loads(val)
436 if long: 436 if long:
437 width = max(map(len, dictval), default=0) 437 width = max(map(len, dictval), default=0)
@@ -500,7 +500,7 @@ def find_path(args):
500 with open(os.path.join(root,fn)) as f: 500 with open(os.path.join(root,fn)) as f:
501 for line in f: 501 for line in f:
502 if line.startswith('FILES_INFO:'): 502 if line.startswith('FILES_INFO:'):
503 val = line.split(':', 1)[1].strip() 503 val = line.split(': ', 1)[1].strip()
504 dictval = json.loads(val) 504 dictval = json.loads(val)
505 for fullpth in dictval.keys(): 505 for fullpth in dictval.keys():
506 if fnmatch.fnmatchcase(fullpth, args.targetpath): 506 if fnmatch.fnmatchcase(fullpth, args.targetpath):