toaqua.rb tocsu.shを変更(ファイル名のパターン変化に対応)

git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/trunk@2289 b08762b0-b915-fc4b-9d8c-17b2551a87ff
This commit is contained in:
(no author) 2008-08-27 10:45:10 +00:00
parent 1e25203802
commit e3e4b41e1d
2 changed files with 15 additions and 8 deletions

View File

@ -27,17 +27,24 @@ REGION_DIR = {
def proc(target_dir, output_dir)
Find.find(target_dir){ |path|
next unless File.file?(path) && (/[a-z0-9A-Z]{4}-v[0-9]+\.tad\.out/ =~ path) != nil
next unless File.file?(path) && (/[a-z0-9A-Z]{4}-.*v[0-9]+\.tad\.out/ =~ path) != nil
# p path
src = path
# ディレクトリ内のtadファイルの.tadより前を取り出す
dest = ""
version = ""
Find.find(File.split(src)[0]){|tad|
next unless (/.*\.tad\z/ =~ tad) != nil
#p tad
dest = File.split(tad)[1]
# .tad が見つかった
if (/.*\.tad\z/ =~ tad) != nil
dest = File.split(tad)[1]
end
if (/.*\.cls\z/ =~ tad) != nil
p tad
version = tad.slice(/v[0-9]+/)
end
}
dest = /\.tad/.match(dest).pre_match + "-" + version + ".tad"
# リージョンを判別してコピー
regions = REGION_DIR[File.split(src)[1][3..3]]
for region in regions do

View File

@ -40,10 +40,10 @@ mkdir $tmp
find ../$1 -name "*.out" -exec cp {} $tmp \;
find $tmp -name "*[jaJA]-v0*.out" | gawk -F/ '{printf("cp %s jp/%s\n",$0, $2)}' | sed -e 's/\.out$//g' > jp.sh
find $tmp -name "*[uaUA]-v0*.out" | gawk -F/ '{printf("cp %s aus/%s\n",$0, $2)}' | sed -e 's/\.out$//g' > aus.sh
find $tmp -name "*[paPA]-v0*.out" | gawk -F/ '{printf("cp %s euro/%s\n",$0, $2)}' | sed -e 's/\.out$//g' > euro.sh
find $tmp -name "*[eaEA]-v0*.out" | gawk -F/ '{printf("cp %s usa/%s\n",$0, $2)}' | sed -e 's/\.out$//g' > usa.sh
find $tmp -regex "[^/]*/...[jaJA].*" | gawk -F/ '{printf("cp %s jp/%s\n",$0, $2)}' | sed -e 's/\.out$//g' > jp.sh
find $tmp -regex "[^/]*/...[uaUA].*" | gawk -F/ '{printf("cp %s aus/%s\n",$0, $2)}' | sed -e 's/\.out$//g' > aus.sh
find $tmp -regex "[^/]*/...[paPA].*" | gawk -F/ '{printf("cp %s euro/%s\n",$0, $2)}' | sed -e 's/\.out$//g' > euro.sh
find $tmp -regex "[^/]*/...[eaEA].*" | gawk -F/ '{printf("cp %s usa/%s\n",$0, $2)}' | sed -e 's/\.out$//g' > usa.sh
./jp.sh
./aus.sh