Fri, 12 Oct 2012 14:46:47 -0700
Merge
1 #!/bin/bash
2 #
3 # Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
4 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 #
6 # This code is free software; you can redistribute it and/or modify it
7 # under the terms of the GNU General Public License version 2 only, as
8 # published by the Free Software Foundation.
9 #
10 # This code is distributed in the hope that it will be useful, but WITHOUT
11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 # version 2 for more details (a copy is included in the LICENSE file that
14 # accompanied this code).
15 #
16 # You should have received a copy of the GNU General Public License version
17 # 2 along with this work; if not, write to the Free Software Foundation,
18 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 #
20 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 # or visit www.oracle.com if you need additional information or have any
22 # questions.
23 #
25 # The difftext.sh knows how to compare text files and
26 # ignore some specific differences.
27 # When difftext.sh is called, we already know that the
28 # files differ. But if the tests below trigger, then
29 # we ignore differences caused by:
30 #
31 # Timestamps in Java sources generated by idl2java
32 # Sorting order and cleanup style in .properties files.
34 OLD="$1"
35 NEW="$2"
36 SUF="${OLD##*.}"
37 TMP=1
38 if test "x$SUF" == "xjava"; then
39 TMP=$(LANG=C diff $OLD $NEW | \
40 grep '^[<>]' | \
41 sed '/[<>] \* from.*\.idl/d' | \
42 sed '/[<>] \*.*201[12].*/d' | \
43 sed '/\/\/ Generated from input file.*/d' | \
44 sed '/\/\/ This file was generated AUTOMATICALLY from a template file.*/d' | \
45 sed '/\/\/ java GenerateCharacter.*/d')
46 fi
47 if test "x$SUF" == "xproperties"; then
48 cat $OLD | sed -e 's/\([^\\]\):/\1\\:/g' -e 's/\([^\\]\)=/\1\\=/g' -e 's/#.*/#/g' \
49 -e 's/\\u0020/\x20/g' \
50 -e 's/\\u003A/\x3A/g' \
51 -e 's/\\u006B/\x6B/g' \
52 -e 's/\\u0075/\x75/g' \
53 -e 's/\\u00A0/\xA0/g' \
54 -e 's/\\u00A3/\xA3/g' \
55 -e 's/\\u00B0/\xB0/g' \
56 -e 's/\\u00B7/\xB7/g' \
57 -e 's/\\u00BA/\xBA/g' \
58 -e 's/\\u00BF/\xBF/g' \
59 -e 's/\\u00C0/\xC0/g' \
60 -e 's/\\u00C1/\xC1/g' \
61 -e 's/\\u00C2/\xC2/g' \
62 -e 's/\\u00C4/\xC4/g' \
63 -e 's/\\u00C5/\xC5/g' \
64 -e 's/\\u00C8/\xC8/g' \
65 -e 's/\\u00C9/\xC9/g' \
66 -e 's/\\u00CA/\xCA/g' \
67 -e 's/\\u00CD/\xCD/g' \
68 -e 's/\\u00CE/\xCE/g' \
69 -e 's/\\u00D3/\xD3/g' \
70 -e 's/\\u00D4/\xD4/g' \
71 -e 's/\\u00D6/\xD6/g' \
72 -e 's/\\u00DA/\xDA/g' \
73 -e 's/\\u00DC/\xDC/g' \
74 -e 's/\\u00DD/\xDD/g' \
75 -e 's/\\u00DF/\xDF/g' \
76 -e 's/\\u00E0/\xE0/g' \
77 -e 's/\\u00E1/\xE1/g' \
78 -e 's/\\u00E2/\xE2/g' \
79 -e 's/\\u00E3/\xE3/g' \
80 -e 's/\\u00E4/\xE4/g' \
81 -e 's/\\u00E5/\xE5/g' \
82 -e 's/\\u00E6/\xE6/g' \
83 -e 's/\\u00E7/\xE7/g' \
84 -e 's/\\u00E8/\xE8/g' \
85 -e 's/\\u00E9/\xE9/g' \
86 -e 's/\\u00EA/\xEA/g' \
87 -e 's/\\u00EB/\xEB/g' \
88 -e 's/\\u00EC/\xEC/g' \
89 -e 's/\\u00ED/\xED/g' \
90 -e 's/\\u00EE/\xEE/g' \
91 -e 's/\\u00EF/\xEF/g' \
92 -e 's/\\u00F1/\xF1/g' \
93 -e 's/\\u00F2/\xF2/g' \
94 -e 's/\\u00F3/\xF3/g' \
95 -e 's/\\u00F4/\xF4/g' \
96 -e 's/\\u00F5/\xF5/g' \
97 -e 's/\\u00F6/\xF6/g' \
98 -e 's/\\u00F9/\xF9/g' \
99 -e 's/\\u00FA/\xFA/g' \
100 -e 's/\\u00FC/\xFC/g' \
101 -e 's/\\u0020/\x20/g' \
102 -e 's/\\u003f/\x3f/g' \
103 -e 's/\\u006f/\x6f/g' \
104 -e 's/\\u0075/\x75/g' \
105 -e 's/\\u00a0/\xa0/g' \
106 -e 's/\\u00a3/\xa3/g' \
107 -e 's/\\u00b0/\xb0/g' \
108 -e 's/\\u00ba/\xba/g' \
109 -e 's/\\u00bf/\xbf/g' \
110 -e 's/\\u00c1/\xc1/g' \
111 -e 's/\\u00c4/\xc4/g' \
112 -e 's/\\u00c5/\xc5/g' \
113 -e 's/\\u00c8/\xc8/g' \
114 -e 's/\\u00c9/\xc9/g' \
115 -e 's/\\u00ca/\xca/g' \
116 -e 's/\\u00cd/\xcd/g' \
117 -e 's/\\u00d6/\xd6/g' \
118 -e 's/\\u00dc/\xdc/g' \
119 -e 's/\\u00dd/\xdd/g' \
120 -e 's/\\u00df/\xdf/g' \
121 -e 's/\\u00e0/\xe0/g' \
122 -e 's/\\u00e1/\xe1/g' \
123 -e 's/\\u00e2/\xe2/g' \
124 -e 's/\\u00e3/\xe3/g' \
125 -e 's/\\u00e4/\xe4/g' \
126 -e 's/\\u00e5/\xe5/g' \
127 -e 's/\\u00e7/\xe7/g' \
128 -e 's/\\u00e8/\xe8/g' \
129 -e 's/\\u00e9/\xe9/g' \
130 -e 's/\\u00ea/\xea/g' \
131 -e 's/\\u00eb/\xeb/g' \
132 -e 's/\\u00ec/\xec/g' \
133 -e 's/\\u00ed/\xed/g' \
134 -e 's/\\u00ee/\xee/g' \
135 -e 's/\\u00ef/\xef/g' \
136 -e 's/\\u00f0/\xf0/g' \
137 -e 's/\\u00f1/\xf1/g' \
138 -e 's/\\u00f2/\xf2/g' \
139 -e 's/\\u00f3/\xf3/g' \
140 -e 's/\\u00f4/\xf4/g' \
141 -e 's/\\u00f5/\xf5/g' \
142 -e 's/\\u00f6/\xf6/g' \
143 -e 's/\\u00f7/\xf7/g' \
144 -e 's/\\u00f8/\xf8/g' \
145 -e 's/\\u00f9/\xf9/g' \
146 -e 's/\\u00fa/\xfa/g' \
147 -e 's/\\u00fc/\xfc/g' \
148 -e 's/\\u00ff/\xff/g' \
149 | sed -e '/^#/d' -e '/^$/d' \
150 -e :a -e '/\\$/N; s/\\\n//; ta' \
151 -e 's/^[ \t]*//;s/[ \t]*$//' \
152 -e 's/\\=/=/' | LANG=C sort > $OLD.cleaned
153 TMP=$(LANG=C diff $OLD.cleaned $NEW)
154 fi
155 if test -n "$TMP"; then
156 echo Files $OLD and $NEW differ
157 fi