aboutsummaryrefslogtreecommitdiff
path: root/externals/gridflow/doc/find_missing.rb
blob: 5ac44da094eb6ff5148c020fc235b391a4d4bdab (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
32
33
34
35
36
37
38
39
40
#!/usr/bin/env ruby

a=[]
`grep -nriw install ../src/*.[ch]xx ../src/*.m`.each {|line|
  m=/install\(\"([^"]+)/.match(line)
  a<<m[1] if m
}

b=Dir["../abstractions/*.pd"].map{|x|
  x.gsub(/^\.\.\/abstractions\//,"").gsub(/\.pd$/,"")
}

c      = Dir["flow_classes/*-help.pd"   ].map{|x| x.gsub(/^flow_classes\//,"").gsub(/-help\.pd$/,"") }
c.concat Dir["flow_classes/cv/*-help.pd"].map{|x| x.gsub(/^flow_classes\//,"").gsub(/-help\.pd$/,"") }
ab=a+b

d=[]
File.open("index.pd") {|f|
  f.each {|line|
    m=/obj \d+ \d+ ([^ ;]+)/.match(line)
    d<<m[1] if m
  }
}

puts "missing from help files: "
puts (ab-c).sort.join" "
puts (ab-c).size
puts ""

puts "orphan help files:"
puts (c-ab).sort.join" "
puts ""

puts "missing from index:"
puts (ab-d).sort.join" "
puts (ab-d).size
puts ""

puts "orphan index entries: "
puts (d-ab).sort.join" "