Welcome to mirror list, hosted at ThFree Co, Russian Federation.

compare-bundle « _support - gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e71a795457f9d11be023a9920fdb1f18ac328f28 (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