mirror of
https://git.yoctoproject.org/poky
synced 2026-04-20 11:28:58 +00:00
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>
This commit is contained in:
@@ -62,10 +62,11 @@ def search(args, config, basepath, workspace):
|
||||
with open(os.path.join(pkgdata_dir, 'runtime', pkg), 'r') as f:
|
||||
for line in f:
|
||||
if ': ' in line:
|
||||
splitline = line.split(':', 1)
|
||||
splitline = line.split(': ', 1)
|
||||
key = splitline[0]
|
||||
value = splitline[1].strip()
|
||||
if key in ['PKG:%s' % pkg, 'DESCRIPTION', 'FILES_INFO'] or key.startswith('FILERPROVIDES_'):
|
||||
key = key.replace(":" + pkg, "")
|
||||
if key in ['PKG', 'DESCRIPTION', 'FILES_INFO', 'FILERPROVIDES']:
|
||||
if keyword_rc.search(value):
|
||||
match = True
|
||||
break
|
||||
|
||||
@@ -72,15 +72,15 @@ def find_target_file(targetpath, d, pkglist=None):
|
||||
# This does assume that PN comes before other values, but that's a fairly safe assumption
|
||||
for line in f:
|
||||
if line.startswith('PN:'):
|
||||
pn = line.split(':', 1)[1].strip()
|
||||
elif line.startswith('FILES_INFO:'):
|
||||
val = line.split(':', 1)[1].strip()
|
||||
pn = line.split(': ', 1)[1].strip()
|
||||
elif line.startswith('FILES_INFO'):
|
||||
val = line.split(': ', 1)[1].strip()
|
||||
dictval = json.loads(val)
|
||||
for fullpth in dictval.keys():
|
||||
if fnmatch.fnmatchcase(fullpth, targetpath):
|
||||
recipes[targetpath].append(pn)
|
||||
elif line.startswith('pkg_preinst:') or line.startswith('pkg_postinst:'):
|
||||
scriptval = line.split(':', 1)[1].strip().encode('utf-8').decode('unicode_escape')
|
||||
scriptval = line.split(': ', 1)[1].strip().encode('utf-8').decode('unicode_escape')
|
||||
if 'update-alternatives --install %s ' % targetpath in scriptval:
|
||||
recipes[targetpath].append('?%s' % pn)
|
||||
elif targetpath_re.search(scriptval):
|
||||
|
||||
@@ -115,8 +115,8 @@ class RecipeHandler(object):
|
||||
for line in f:
|
||||
if line.startswith('PN:'):
|
||||
pn = line.split(':', 1)[-1].strip()
|
||||
elif line.startswith('FILES_INFO:'):
|
||||
val = line.split(':', 1)[1].strip()
|
||||
elif line.startswith('FILES_INFO:%s:' % pkg):
|
||||
val = line.split(': ', 1)[1].strip()
|
||||
dictval = json.loads(val)
|
||||
for fullpth in sorted(dictval):
|
||||
if fullpth.startswith(includedir) and fullpth.endswith('.h'):
|
||||
|
||||
@@ -545,7 +545,7 @@ class PythonRecipeHandler(RecipeHandler):
|
||||
with open(pkgdatafile, 'r') as f:
|
||||
for line in f.readlines():
|
||||
field, value = line.split(': ', 1)
|
||||
if field == 'FILES_INFO':
|
||||
if field.startswith('FILES_INFO'):
|
||||
files_info = ast.literal_eval(value)
|
||||
break
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user