aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--web/lib/packages.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/web/lib/packages.rb b/web/lib/packages.rb
index 22e9259..9d5f64b 100644
--- a/web/lib/packages.rb
+++ b/web/lib/packages.rb
@@ -1,5 +1,5 @@
def update_packages(ci_image)
- cmd = %w(/ruby-tinderbox/packages.py | sort -u)
+ cmd = %w(/ruby-tinderbox/packages.py)
ci_container = Docker::Container.create(
Cmd: cmd,
Image: ci_image.id
@@ -9,7 +9,8 @@ def update_packages(ci_image)
packages_txt = ci_container.logs(stdout: true)
ci_container.delete
- packages_txt.lines.peach do |line|
+ packages_txt = packages_txt.lines.sort.uniq
+ packages_txt.peach do |line|
line = line.bytes.drop(8).pack('c*')
next if line.empty?
sha1, category, name, version, revision, slot, amd64_keyword, r19_target, r20_target, r21_target, r22_target = line.split(' ')
@@ -36,7 +37,7 @@ def update_packages(ci_image)
end
Package.peach(8) do |package|
- unless packages_txt.include?(package[:sha1])
+ unless packages_txt.find { |sha1| /#{package[:sha1]}/ =~ sha1 }
package.build.map(&:delete)
package.repoman.map(&:delete)
package.delete