* common.mk (encdb.h): see both $(srcdir)/enc and enc.
* enc/make_encdb.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18435 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2f37e03736
commit
b917553e68
@ -1,4 +1,8 @@
|
|||||||
Fri Aug 8 16:09:01 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Fri Aug 8 16:15:50 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* common.mk (encdb.h): see both $(srcdir)/enc and enc.
|
||||||
|
|
||||||
|
* enc/make_encdb.rb: ditto.
|
||||||
|
|
||||||
* enc/trans/make_transdb.rb: fix for the case no transdirs are given.
|
* enc/trans/make_transdb.rb: fix for the case no transdirs are given.
|
||||||
|
|
||||||
|
@ -22,11 +22,16 @@ count = 0
|
|||||||
lines = []
|
lines = []
|
||||||
encodings = []
|
encodings = []
|
||||||
defs = {}
|
defs = {}
|
||||||
encdir = ARGV[0]
|
encdirs = ARGV.dup
|
||||||
outhdr = ARGV[1] || 'encdb.h'
|
outhdr = encdirs.shift || 'encdb.h'
|
||||||
|
encdirs << 'enc' if encdirs.empty?
|
||||||
|
files = {}
|
||||||
|
encdirs.each do |encdir|
|
||||||
Dir.open(encdir) {|d| d.grep(/.+\.[ch]\z/)}.sort_by {|e|
|
Dir.open(encdir) {|d| d.grep(/.+\.[ch]\z/)}.sort_by {|e|
|
||||||
e.scan(/(\d+)|(\D+)/).map {|n,a| a||[n.size,n.to_i]}.flatten
|
e.scan(/(\d+)|(\D+)/).map {|n,a| a||[n.size,n.to_i]}.flatten
|
||||||
}.each do |fn|
|
}.each do |fn|
|
||||||
|
next if files[fn]
|
||||||
|
files[fn] = true
|
||||||
open(File.join(encdir,fn)) do |f|
|
open(File.join(encdir,fn)) do |f|
|
||||||
orig = nil
|
orig = nil
|
||||||
name = nil
|
name = nil
|
||||||
@ -62,6 +67,7 @@ Dir.open(encdir) {|d| d.grep(/.+\.[ch]\z/)}.sort_by {|e|
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
result = encodings.map {|e| %[ENC_DEFINE("#{e}");\n]}.join + lines.join +
|
result = encodings.map {|e| %[ENC_DEFINE("#{e}");\n]}.join + lines.join +
|
||||||
"\n#define ENCODING_COUNT #{count}\n"
|
"\n#define ENCODING_COUNT #{count}\n"
|
||||||
|
@ -8,8 +8,8 @@
|
|||||||
|
|
||||||
count = 0
|
count = 0
|
||||||
converters = {}
|
converters = {}
|
||||||
outhdr = ARGV[0] || 'transdb.h'
|
transdirs = ARGV.dup
|
||||||
transdirs = ARGV[1..-1]
|
outhdr = transdirs.shift || 'transdb.h'
|
||||||
transdirs << 'enc/trans' if transdirs.empty?
|
transdirs << 'enc/trans' if transdirs.empty?
|
||||||
files = {}
|
files = {}
|
||||||
transdirs.each do |transdir|
|
transdirs.each do |transdir|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user