From bdcecdea5d6eb6426fb2511ee6fee6792b42e935 Mon Sep 17 00:00:00 2001 From: Peter Wilmott Date: Mon, 10 Aug 2015 19:32:42 +0000 Subject: Resolve issue with truncated sha1 values --- web/lib/packages.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'web') diff --git a/web/lib/packages.rb b/web/lib/packages.rb index 9d5f64b..7a3e8db 100644 --- a/web/lib/packages.rb +++ b/web/lib/packages.rb @@ -6,12 +6,11 @@ def update_packages(ci_image) ) ci_container.start ci_container.wait(36_000) - packages_txt = ci_container.logs(stdout: true) + packages_txt = ci_container.streaming_logs(stdout: true) ci_container.delete 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(' ') identifier = category + '/' + name + '-' + version + (revision == 'r0' ? '' : "-#{revision}") @@ -37,7 +36,7 @@ def update_packages(ci_image) end Package.peach(8) do |package| - unless packages_txt.find { |sha1| /#{package[:sha1]}/ =~ sha1 } + unless packages_txt.find { |sha1| /^#{package[:sha1]}/ =~ sha1 } package.build.map(&:delete) package.repoman.map(&:delete) package.delete -- cgit v1.2.3-65-gdbad