Merge pull request #16902 from cho-m/utils-pypi-allow-overwrite-resource-patches

utils/pypi: allow overwriting resource patches
This commit is contained in:
Mike McQuaid 2024-03-18 12:41:13 +00:00 committed by GitHub
commit 672eb1f892
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -370,7 +370,18 @@ module PyPI
new_resource_blocks += " def install"
else
# Replace existing resource blocks with new resource blocks
inreplace_regex = / (resource .* do\s+url .*\s+sha256 .*\s+ end\s*)+/
inreplace_regex = /
\ \ (
resource\ .*\ do\s+
url\ .*\s+
sha256\ .*\s+
((\#.*\s+)*
patch\ (.*\ )?do\s+
url\ .*\s+
sha256\ .*\s+
end\s+)*
end\s+)+
/x
new_resource_blocks += " "
end