use builtin methods
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e83f415139
commit
81768d1da5
@ -1,33 +1,12 @@
|
|||||||
|
|
||||||
def uniq(data)
|
data = []
|
||||||
last=nil
|
IO.foreach("|/usr/ccs/bin/nm -p #{ARGV[0]}") do |line|
|
||||||
data.delete_if do |name|
|
|
||||||
if last == name
|
|
||||||
TRUE
|
|
||||||
else
|
|
||||||
last = name
|
|
||||||
FALSE
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def extract(nm, out)
|
|
||||||
data = nm.readlines.collect{|line|
|
|
||||||
line = line.split
|
line = line.split
|
||||||
case line[1]
|
case line[1]
|
||||||
when "B", "D"
|
when "B", "D"
|
||||||
line[0]
|
data << line[0]
|
||||||
else
|
|
||||||
next
|
|
||||||
end
|
end
|
||||||
}.compact!.sort!
|
|
||||||
uniq(data)
|
|
||||||
exp = open(out, "w")
|
|
||||||
exp.printf "#!\n"
|
|
||||||
for line in data
|
|
||||||
exp.printf "%s\n", line
|
|
||||||
end
|
end
|
||||||
exp.close
|
data.uniq!
|
||||||
nm.close
|
data.sort!
|
||||||
end
|
open(ARGV[1], "w") {|exp| exp.puts "#!", data}
|
||||||
extract(open("|/usr/ccs/bin/nm -p ../libruby.a"), "../ruby.imp")
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user