Merge pull request #15777 from Bo98/manifest-fix

keg_relocate: fix all text files being marked as changed
This commit is contained in:
Bo Anderson 2023-07-28 01:06:16 +01:00 committed by GitHub
commit 3d44b93116
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -424,6 +424,7 @@ class GitHubPackages
end end
index_json_sha256, index_json_size = write_image_index(manifests, blobs, formula_annotations_hash) index_json_sha256, index_json_size = write_image_index(manifests, blobs, formula_annotations_hash)
raise "Image index too large!" if index_json_size >= 4 * 1024 * 1024 # GitHub will error 500 if too large
write_index_json(index_json_sha256, index_json_size, root, write_index_json(index_json_sha256, index_json_size, root,
"org.opencontainers.image.ref.name" => version_rebuild) "org.opencontainers.image.ref.name" => version_rebuild)

View File

@ -34,7 +34,7 @@ class Keg
@replacement_map.fetch(key) @replacement_map.fetch(key)
end end
sig { params(text: String).void } sig { params(text: String).returns(T::Boolean) }
def replace_text(text) def replace_text(text)
replacements = @replacement_map.values.to_h replacements = @replacement_map.values.to_h
@ -47,7 +47,7 @@ class Keg
changed = text.gsub!(key, replacements[key]) changed = text.gsub!(key, replacements[key])
any_changed ||= changed any_changed ||= changed
end end
any_changed !any_changed.nil?
end end
sig { params(path: T.any(String, Regexp)).returns(Regexp) } sig { params(path: T.any(String, Regexp)).returns(Regexp) }