github_packages: use full license only if within limit
This commit is contained in:
parent
0b3d78aa0f
commit
e7f01653ae
@ -291,6 +291,7 @@ class GitHubPackages
|
|||||||
remote
|
remote
|
||||||
end
|
end
|
||||||
|
|
||||||
|
license = bottle_hash["formula"]["license"].to_s
|
||||||
created_date = bottle_hash["bottle"]["date"]
|
created_date = bottle_hash["bottle"]["date"]
|
||||||
if keep_old
|
if keep_old
|
||||||
index = JSON.parse((root/"index.json").read)
|
index = JSON.parse((root/"index.json").read)
|
||||||
@ -301,12 +302,20 @@ class GitHubPackages
|
|||||||
formula_annotations_hash = image_index["annotations"]
|
formula_annotations_hash = image_index["annotations"]
|
||||||
manifests = image_index["manifests"]
|
manifests = image_index["manifests"]
|
||||||
else
|
else
|
||||||
|
image_license = if license.length <= 256
|
||||||
|
license
|
||||||
|
else
|
||||||
|
# TODO: Consider generating a truncated license when over the limit
|
||||||
|
require "utils/spdx"
|
||||||
|
SPDX.license_expression_to_string(:cannot_represent)
|
||||||
|
end
|
||||||
|
|
||||||
formula_annotations_hash = {
|
formula_annotations_hash = {
|
||||||
"com.github.package.type" => GITHUB_PACKAGE_TYPE,
|
"com.github.package.type" => GITHUB_PACKAGE_TYPE,
|
||||||
"org.opencontainers.image.created" => created_date,
|
"org.opencontainers.image.created" => created_date,
|
||||||
"org.opencontainers.image.description" => bottle_hash["formula"]["desc"],
|
"org.opencontainers.image.description" => bottle_hash["formula"]["desc"],
|
||||||
"org.opencontainers.image.documentation" => documentation,
|
"org.opencontainers.image.documentation" => documentation,
|
||||||
"org.opencontainers.image.licenses" => bottle_hash["formula"]["license"],
|
"org.opencontainers.image.licenses" => image_license,
|
||||||
"org.opencontainers.image.ref.name" => version_rebuild,
|
"org.opencontainers.image.ref.name" => version_rebuild,
|
||||||
"org.opencontainers.image.revision" => git_revision,
|
"org.opencontainers.image.revision" => git_revision,
|
||||||
"org.opencontainers.image.source" => source,
|
"org.opencontainers.image.source" => source,
|
||||||
@ -395,6 +404,7 @@ class GitHubPackages
|
|||||||
"sh.brew.bottle.glibc.version" => glibc_version,
|
"sh.brew.bottle.glibc.version" => glibc_version,
|
||||||
"sh.brew.bottle.size" => local_file_size.to_s,
|
"sh.brew.bottle.size" => local_file_size.to_s,
|
||||||
"sh.brew.bottle.installed_size" => tag_hash["installed_size"].to_s,
|
"sh.brew.bottle.installed_size" => tag_hash["installed_size"].to_s,
|
||||||
|
"sh.brew.license" => license,
|
||||||
"sh.brew.tab" => tab.to_json,
|
"sh.brew.tab" => tab.to_json,
|
||||||
"sh.brew.path_exec_files" => path_exec_files_string,
|
"sh.brew.path_exec_files" => path_exec_files_string,
|
||||||
}.compact_blank
|
}.compact_blank
|
||||||
|
Loading…
x
Reference in New Issue
Block a user