summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--scripts/lib/devtool/standard.py18
1 files changed, 14 insertions, 4 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index f2ba69976f..1ec31bcafe 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -1039,6 +1039,18 @@ def _export_local_files(srctree, rd, destdir):
1039 return (updated, added, removed) 1039 return (updated, added, removed)
1040 1040
1041 1041
1042def _determine_files_dir(rd):
1043 """Determine the appropriate files directory for a recipe"""
1044 recipedir = rd.getVar('FILE_DIRNAME', True)
1045 for entry in rd.getVar('FILESPATH', True).split(':'):
1046 relpth = os.path.relpath(entry, recipedir)
1047 if not os.sep in relpth:
1048 # One (or zero) levels below only, so we don't put anything in machine-specific directories
1049 if os.path.isdir(entry):
1050 return entry
1051 return os.path.join(recipedir, rd.getVar('BPN', True))
1052
1053
1042def _update_recipe_srcrev(args, srctree, rd, config_data): 1054def _update_recipe_srcrev(args, srctree, rd, config_data):
1043 """Implement the 'srcrev' mode of update-recipe""" 1055 """Implement the 'srcrev' mode of update-recipe"""
1044 import bb 1056 import bb
@@ -1092,8 +1104,7 @@ def _update_recipe_srcrev(args, srctree, rd, config_data):
1092 rd, args.append, files, wildcardver=args.wildcard_version, 1104 rd, args.append, files, wildcardver=args.wildcard_version,
1093 extralines=patchfields, removevalues=removevalues) 1105 extralines=patchfields, removevalues=removevalues)
1094 else: 1106 else:
1095 files_dir = os.path.join(os.path.dirname(recipefile), 1107 files_dir = _determine_files_dir(rd)
1096 rd.getVar('BPN', True))
1097 for basepath, path in upd_f.items(): 1108 for basepath, path in upd_f.items():
1098 logger.info('Updating file %s' % basepath) 1109 logger.info('Updating file %s' % basepath)
1099 _move_file(os.path.join(local_files_dir, basepath), path) 1110 _move_file(os.path.join(local_files_dir, basepath), path)
@@ -1193,8 +1204,7 @@ def _update_recipe_patch(args, config, workspace, srctree, rd, config_data):
1193 _move_file(patchfn, path) 1204 _move_file(patchfn, path)
1194 updatefiles = True 1205 updatefiles = True
1195 # Add any new files 1206 # Add any new files
1196 files_dir = os.path.join(os.path.dirname(recipefile), 1207 files_dir = _determine_files_dir(rd)
1197 rd.getVar('BPN', True))
1198 for basepath, path in new_f.items(): 1208 for basepath, path in new_f.items():
1199 logger.info('Adding new file %s' % basepath) 1209 logger.info('Adding new file %s' % basepath)
1200 _move_file(os.path.join(local_files_dir, basepath), 1210 _move_file(os.path.join(local_files_dir, basepath),