Revision: | 1.1.1.1 (vendor branch) |
Committed: | Mon Feb 6 20:26:11 2006 UTC (18 years, 5 months ago) by root |
Content type: | text/plain |
Branch: | UPSTREAM, MAIN |
CVS Tags: | pre_first_cfarch_normalize_run, pre_second_normalise_run, post_second_normalise_run, post_normalise_revert, rel-2_82, rel-2_81, rel-2_80, UPSTREAM_2006_03_15, rel-3_0, rel-2_6, rel-2_7, rel-2_4, rel-2_5, rel-2_2, rel-2_0, rel-2_1, rel-2_72, rel-2_73, rel-2_71, rel-2_76, rel-2_77, rel-2_74, rel-2_75, rel-2_54, rel-2_55, rel-2_56, rel-2_79, UPSTREAM_2006_02_01, rel-2_53, rel-2_32, post_first_cfarch_normalize_run, UPSTREAM_2006_02_22, rel-2_90, rel-2_92, rel-2_93, rel-2_78, rel-2_61, pre_normalise_revert, rel-2_43, rel-2_42, rel-2_41, HEAD |
Changes since 1.1: | +0 -0 lines |
Log Message: | Initial Import |
# | User | Rev | Content |
---|---|---|---|
1 | root | 1.1 | #!/usr/bin/perl |
2 | $TYPE = $ARGV[0]; | ||
3 | die ("type is 0: $TYPE\n") if (($TYPE + 1) == 1); | ||
4 | |||
5 | for ($i=1; $i<=$#ARGV; $i++) { | ||
6 | if (!rename("$ARGV[$i]", "$ARGV[$i].bak")) { | ||
7 | print STDERR "Unable to rename file $ARGV[$i]\n"; | ||
8 | next; | ||
9 | } | ||
10 | open(IN,"<$ARGV[$i].bak"); | ||
11 | open(OUT,">$ARGV[$i]"); | ||
12 | while (<IN>) { | ||
13 | $in = $_; | ||
14 | if (/^end\s*$/) { | ||
15 | print OUT "name_pl $namepl\n"; | ||
16 | print OUT "client_type $TYPE\n"; | ||
17 | $namepl=""; | ||
18 | } | ||
19 | if (/^Object (.*)$/) { | ||
20 | $namepl = $1."s"; | ||
21 | } | ||
22 | if (/^name (.*)$/) { | ||
23 | $namepl = $1."s"; | ||
24 | } | ||
25 | print OUT $in; | ||
26 | } | ||
27 | close(OUT); | ||
28 | close(IN); | ||
29 | unlink("$ARGV[$i].bak"); | ||
30 | } |