Skip to content
Snippets Groups Projects
Commit 3f6e1d96 authored by Tobias Kahlki's avatar Tobias Kahlki
Browse files

package_release: Added option to copy licenses with release

BCS 746-000303
parent ddbf1bd4
No related branches found
No related tags found
1 merge request!80package_release: Added option to copy licenses with release
Pipeline #8688 passed with stages
in 26 seconds
......@@ -84,6 +84,7 @@ def generate_metadata(
"""Generates a metainfo.json for the release"""
install_script = None
licenses = None
image_general = None
image_wic = None
......@@ -100,8 +101,10 @@ def generate_metadata(
# Collect metadata and write to metainfo.json
for artifact in artifacts_image:
if artifact.endswith("fng-install.sh"):
if artifact == "fng-install.sh":
install_script = artifact
elif artifact == "license.manifest":
licenses = artifact
elif artifact.endswith(machine + ".tar.gz"):
image_general = artifact
elif artifact.endswith(machine + ".wic"):
......@@ -138,6 +141,12 @@ def generate_metadata(
new_file["path"] = "sdk/" + sdk + ".sh"
metadata["files"].append(new_file)
if licenses is not None:
new_file = dict()
new_file["name"] = "Licenses"
new_file["path"] = licenses
metadata["files"].append(new_file)
with open(filepath, "w", encoding="utf-8") as file:
file.write(json.dumps(metadata))
......@@ -149,6 +158,11 @@ def main():
help="""Yocto images directory""",
dest="images_dir",
)
parser.add_argument(
"--licenses-dir",
help="""Yocto licenses directory""",
dest="licenses_dir",
)
parser.add_argument(
"--outputdir-upload",
help="""Base directory name for uploaded artifacts""",
......@@ -247,6 +261,33 @@ def main():
artifacts_all, args.images_dir, machine, output_dir, outlocal_dir
)
# If the path for the licenses is set, we check for the list with all
# licenses. If the list is found, we copy it to the output directory
# and also add it to the artifacts dictionary.
if args.licenses_dir is not None and os.path.isdir(args.licenses_dir):
licenses_dir = None
for entry in os.listdir(args.licenses_dir):
if entry.startswith("guf-image-"):
fullpath = os.path.join(args.licenses_dir, entry)
if os.path.isdir(fullpath):
licenses_dir = fullpath
break
if licenses_dir is not None:
md5sums.update(
copy_files(
["license.manifest"],
licenses_dir,
machine,
output_dir,
outlocal_dir,
)
)
artifacts_all.append("license.manifest")
# Generate alphaplan FWR articles
if args.generate_fwr_articles:
alphaplan_fwr.generate_fwr_articles(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment