blob: 85fc8fc4dc0875ac21f43027ef21bde4fc8bc507 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
#!/usr/bin/env ruby
# Usage: in gitlab-ce, run `bundle list > /tmp/gitlab-bundle`. Then run this script in the gitaly root.
def main
gitaly_bundle = Dir.chdir('ruby') { IO.popen(%w[bundle list], &:read).lines }
abort 'bundle list failed' unless $?.success?
gitaly_bundle.shift
gitaly_hash = bundle_lines_to_hash(gitaly_bundle)
gitlab_bundle = File.read('/tmp/gitlab-bundle').lines
gitlab_bundle.shift
gitlab_hash = bundle_lines_to_hash(gitlab_bundle)
puts(' ' * 25 + ' gitlab gitaly')
gitaly_hash.each do |k, v|
next if v == gitlab_hash[k]
printf("%25s %10s %10s\n", k, gitlab_hash[k], v)
end
end
def bundle_lines_to_hash(lines)
h = {}
lines.each do |l|
_, _, name, version = l.chomp.split(/\s+/, 4)
h[name] = version
end
h
end
main
|