utils/pypi: ignore test resources when counting matches

Signed-off-by: Michael Cho <michael@michaelcho.dev>
This commit is contained in:
Michael Cho 2024-03-01 16:08:54 -05:00
parent 6e7e56fdec
commit 408c8e806f
No known key found for this signature in database
GPG Key ID: 55E85E28A7CD1E85

View File

@ -358,7 +358,7 @@ module PyPI
ohai "Updating resource blocks" unless silent ohai "Updating resource blocks" unless silent
Utils::Inreplace.inreplace formula.path do |s| Utils::Inreplace.inreplace formula.path do |s|
if s.inreplace_string.scan(inreplace_regex).length > 1 if T.must(s.inreplace_string.split(/^ test do\b/, 2).first).scan(inreplace_regex).length > 1
odie "Unable to update resource blocks for \"#{formula.name}\" automatically. Please update them manually." odie "Unable to update resource blocks for \"#{formula.name}\" automatically. Please update them manually."
end end
s.sub! inreplace_regex, new_resource_blocks s.sub! inreplace_regex, new_resource_blocks