xref: /trunk/main/odk/util/checkdiff.pl (revision 569f9dbcf6b6e381a1fb2d124b30824476b68dba)
1*7e90fac2SAndrew Rist#**************************************************************
2cdf0e10cSrcweir#
3*7e90fac2SAndrew Rist#  Licensed to the Apache Software Foundation (ASF) under one
4*7e90fac2SAndrew Rist#  or more contributor license agreements.  See the NOTICE file
5*7e90fac2SAndrew Rist#  distributed with this work for additional information
6*7e90fac2SAndrew Rist#  regarding copyright ownership.  The ASF licenses this file
7*7e90fac2SAndrew Rist#  to you under the Apache License, Version 2.0 (the
8*7e90fac2SAndrew Rist#  "License"); you may not use this file except in compliance
9*7e90fac2SAndrew Rist#  with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir#
11*7e90fac2SAndrew Rist#    http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir#
13*7e90fac2SAndrew Rist#  Unless required by applicable law or agreed to in writing,
14*7e90fac2SAndrew Rist#  software distributed under the License is distributed on an
15*7e90fac2SAndrew Rist#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*7e90fac2SAndrew Rist#  KIND, either express or implied.  See the License for the
17*7e90fac2SAndrew Rist#  specific language governing permissions and limitations
18*7e90fac2SAndrew Rist#  under the License.
19cdf0e10cSrcweir#
20*7e90fac2SAndrew Rist#**************************************************************
21*7e90fac2SAndrew Rist
22*7e90fac2SAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir#
25cdf0e10cSrcweir# checkit - a perl script to check the output of 'dircmp'
26cdf0e10cSrcweir#
27cdf0e10cSrcweir
28cdf0e10cSrcweir$return = 0;
29cdf0e10cSrcweir$possible_error = 0;
30cdf0e10cSrcweir$possible_error_descript = "";
31cdf0e10cSrcweirwhile( <STDIN> )
32cdf0e10cSrcweir{
33cdf0e10cSrcweir    if( /^diff/ )
34cdf0e10cSrcweir    {
35cdf0e10cSrcweir        $possible_error = 1;
36cdf0e10cSrcweir        $possible_error_descript = $_;
37cdf0e10cSrcweir    }
38cdf0e10cSrcweir    elsif( /^Binary/ )
39cdf0e10cSrcweir    {
40cdf0e10cSrcweir        print STDERR "ERROR : $_";
41cdf0e10cSrcweir        $return++;
42cdf0e10cSrcweir    }
43cdf0e10cSrcweir    elsif( /^[0-9]/ && $possible_error == 1 )
44cdf0e10cSrcweir    {
45cdf0e10cSrcweir        print STDERR "ERROR : diff ".$possible_error_descript;
46cdf0e10cSrcweir        $return++;
47cdf0e10cSrcweir        $possible_error = 0;
48cdf0e10cSrcweir    }
49cdf0e10cSrcweir    else
50cdf0e10cSrcweir    {
51cdf0e10cSrcweir        $possible_error = 0;
52cdf0e10cSrcweir    }
53cdf0e10cSrcweir}
54cdf0e10cSrcweirif( $return != 0 )
55cdf0e10cSrcweir{
56cdf0e10cSrcweir    unlink "$ARGV[0]";
57cdf0e10cSrcweir}
58cdf0e10cSrcweirexit $return;
59