Skip to content

Commit 0b2de04

Browse files
committed
feat: parse text from gentoo autobuilds
1 parent 14d3202 commit 0b2de04

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

lib/rootfs/data.rb

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,28 @@ def from_sha256sum(str, keywords, ignores = [])
3636
end
3737
results
3838
end
39+
40+
def from_gentoo_txt(str, keywords)
41+
results = []
42+
lines = str.split("\n")
43+
lines.each do |line|
44+
next if line.start_with?("#")
45+
46+
arr = line.split(" ")
47+
file = arr[0]
48+
next unless file
49+
50+
all_matched = true
51+
52+
keywords.each do |keyword|
53+
unless file.include?(keyword)
54+
all_matched = false
55+
break
56+
end
57+
end
58+
results.push(file) if all_matched
59+
end
60+
results
61+
end
3962
end
4063
end

0 commit comments

Comments
 (0)