зеркало из https://github.com/github/ruby.git
* 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:
Родитель
2f37e03736
Коммит
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.
|
||||
|
||||
|
|
|
@ -22,11 +22,16 @@ count = 0
|
|||
lines = []
|
||||
encodings = []
|
||||
defs = {}
|
||||
encdir = ARGV[0]
|
||||
outhdr = ARGV[1] || 'encdb.h'
|
||||
encdirs = ARGV.dup
|
||||
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|
|
||||
e.scan(/(\d+)|(\D+)/).map {|n,a| a||[n.size,n.to_i]}.flatten
|
||||
}.each do |fn|
|
||||
next if files[fn]
|
||||
files[fn] = true
|
||||
open(File.join(encdir,fn)) do |f|
|
||||
orig = nil
|
||||
name = nil
|
||||
|
@ -62,6 +67,7 @@ Dir.open(encdir) {|d| d.grep(/.+\.[ch]\z/)}.sort_by {|e|
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
result = encodings.map {|e| %[ENC_DEFINE("#{e}");\n]}.join + lines.join +
|
||||
"\n#define ENCODING_COUNT #{count}\n"
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
|
||||
count = 0
|
||||
converters = {}
|
||||
outhdr = ARGV[0] || 'transdb.h'
|
||||
transdirs = ARGV[1..-1]
|
||||
transdirs = ARGV.dup
|
||||
outhdr = transdirs.shift || 'transdb.h'
|
||||
transdirs << 'enc/trans' if transdirs.empty?
|
||||
files = {}
|
||||
transdirs.each do |transdir|
|
||||
|
|
Загрузка…
Ссылка в новой задаче