From e8ce2a92d319c20bbb9241e9a9a6c821e3599d79 Mon Sep 17 00:00:00 2001 From: mame Date: Thu, 18 Jun 2015 14:03:51 +0000 Subject: * enc/make_encmake.rb: added --transes and --no-transes options. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- enc/make_encmake.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'enc/make_encmake.rb') diff --git a/enc/make_encmake.rb b/enc/make_encmake.rb index 8b1d163c9b..2342317b21 100755 --- a/enc/make_encmake.rb +++ b/enc/make_encmake.rb @@ -15,6 +15,8 @@ BUILTIN_ENCS = [] BUILTIN_TRANSES = [] ENC_PATTERNS = [] NOENC_PATTERNS = [] +TRANS_PATTERNS = [] +NOTRANS_PATTERNS = [] module_type = :dynamic until ARGV.empty? @@ -31,6 +33,12 @@ until ARGV.empty? when /\A--no-encs=/ NOENC_PATTERNS.concat $'.split ARGV.shift + when /\A--transes=/ + TRANS_PATTERNS.concat $'.split + ARGV.shift + when /\A--no-transes=/ + NOTRANS_PATTERNS.concat $'.split + ARGV.shift when /\A--module$/ ARGV.shift when /\A--modulestatic$/ @@ -91,6 +99,10 @@ def target_transcoders trans -= BUILTIN_TRANSES atrans -= BUILTIN_TRANSES trans.uniq! + atrans.reject! {|e| !TRANS_PATTERNS.any? {|p| File.fnmatch?(p, e)}} if !TRANS_PATTERNS.empty? + atrans.reject! {|e| NOTRANS_PATTERNS.any? {|p| File.fnmatch?(p, e)}} + trans.reject! {|e| !TRANS_PATTERNS.any? {|p| File.fnmatch?(p, e)}} if !TRANS_PATTERNS.empty? + trans.reject! {|e| NOTRANS_PATTERNS.any? {|p| File.fnmatch?(p, e)}} atrans = atrans.sort_by(&ALPHANUMERIC_ORDER) trans = trans.sort_by(&ALPHANUMERIC_ORDER) trans.delete(db = "transdb") -- cgit v1.2.1