Skip to content

Commit ee08786

Browse files
Apply DA mapping
Signed-off-by: Łukasz Gryglicki <[email protected]>
1 parent ed9cd01 commit ee08786

14 files changed

+47737
-47843
lines changed

company_developers1.txt

+695-585
Large diffs are not rendered by default.

company_developers2.txt

+279-632
Large diffs are not rendered by default.

company_developers3.txt

+164-193
Large diffs are not rendered by default.

company_developers4.txt

+351-389
Large diffs are not rendered by default.

company_developers5.txt

+580-686
Large diffs are not rendered by default.

company_developers6.txt

+310-41
Large diffs are not rendered by default.

developers_affiliations1.txt

+2,716-3,401
Large diffs are not rendered by default.

developers_affiliations2.txt

+3,380-4,092
Large diffs are not rendered by default.

developers_affiliations3.txt

+4,028-4,715
Large diffs are not rendered by default.

developers_affiliations4.txt

+3,626-1,558
Large diffs are not rendered by default.

src/all_affs.csv

+13,499-13,499
Large diffs are not rendered by default.

src/cncf-config/email-map

+18,049-18,050
Large diffs are not rendered by default.

src/github_users.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:465b09ab7b2e304845d92916bf32ead1e34568b4d9afad5960b3ba60fce69d67
3-
size 66238518
2+
oid sha256:32a56c04026b4bae30ab299c26bdbb5cb8e252a1c0fff26f65dd63a0efefff94
3+
size 66413887

src/merge_mappings.rb

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
def merge(infile1, infile2, outfile)
2+
# dbg: set to true to have very verbose output
3+
dbg = !ENV['DBG'].nil?
4+
5+
cmap = {}
6+
File.readlines(infile1).each do |line|
7+
next if line[0] == '#'
8+
index = line.index(' -> ')
9+
unless index
10+
puts "Broken line: #{line}"
11+
binding.pry
12+
exit 1
13+
end
14+
from = line[0..index - 1].strip
15+
to = line[index + 4..-1].strip
16+
next if from == to
17+
if cmap.key?(from) && cmap[from] != to
18+
puts "Broken map: already present cmap[#{from}] = #{cmap[from]}, new value different: #{to}"
19+
binding.pry
20+
exit 1
21+
end
22+
cmap[from] = to
23+
end
24+
puts "loaded #{cmap.length} items"
25+
cmap.each do |from, to|
26+
while cmap.key?(to)
27+
newto = cmap[to]
28+
cmap[from] = newto
29+
puts "key #{from} -> #{to} -> #{newto}: added: #{from} -> #{newto}"
30+
to = newto
31+
end
32+
end
33+
File.readlines(infile2).each do |line|
34+
next if line[0] == '#'
35+
index = line.index(' -> ')
36+
unless index
37+
puts "Broken line: #{line}"
38+
binding.pry
39+
exit 1
40+
end
41+
from = line[0..index - 1].strip
42+
to = line[index + 4..-1].strip
43+
next if from == to
44+
if cmap.key?(from) && cmap[from] != to
45+
puts "Broken map: already present cmap[#{from}] = #{cmap[from]}, new value different: #{to}"
46+
binding.pry
47+
exit 1
48+
end
49+
cmap[from] = to
50+
end
51+
end
52+
53+
if ARGV.length < 3
54+
puts "Arguments required: infile1 infile2 outfile"
55+
exit 1
56+
end
57+
58+
merge(ARGV[0], ARGV[1], ARGV[2])

0 commit comments

Comments
 (0)