with open(target_filename, "w") as f:
f.write(json.dumps(git_obs_mapping_abs_info))
+#Handle BRANCH-OBS project mapping
+def generate_branch_obs_mapping(prjdir, target_dir):
+ mapping_list = git_obs_map_full_list()
+
+ list_all = {}
+ for item in mapping_list:
+ if 'OBS_project' not in item or 'Branch_name' not in item:
+ continue
+ _branch = item['Branch_name']
+ _obs_prj = item['OBS_project']
+ if _obs_prj not in list_all:
+ list_all[_obs_prj] = []
+ for _br in _branch.split(','):
+ if _br not in list_all[_obs_prj]:
+ list_all[_obs_prj].append(_br)
+
+ target_filename = os.path.join(target_dir, "obs_project_branch_mapping.json")
+
+ with open(target_filename, "w") as f:
+ f.write(json.dumps(list_all))
+
###########################################################
# test code
#target_dir = ".dashboard/git_obs_mapping"
generate_mapping(prjdir, target_dir)
generate_fork_git_mapping(prjdir, target_dir)
generate_abs_git_mapping(prjdir, target_dir)
+generate_branch_obs_mapping(prjdir, target_dir)
sync_dest = os.path.join(os.getenv("IMG_SYNC_DEST_BASE"), "snapshots", target_dir)
# sync to the download server.