source: release-kits/lirk3/resources/gs3-release-maker/apache-ant-1.6.5/src/etc/yearcheck.sh@ 14982

Last change on this file since 14982 was 14982, checked in by oranfry, 16 years ago

initial import of LiRK3

File size: 1.9 KB
Line 
1#
2# Copyright 2002-2004 The Apache Software Foundation
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16#
17
18#
19# Simple shell script that checks whether changed files contain a copyright
20# statement for a given year.
21#
22# Rename (or symlink) this script to the year you want to check, i.e. name it
23# 2002 if you want to check for copyright statements that do not contain#
24# the year 2002.
25#
26# Use this script instead of your usual cvs update command.
27#
28# Usage YEAR [all]
29#
30# If the optional all argument has been omitted, the proposal directory will
31# be skipped.
32#
33
34if [ -n "$TMP" ]; then
35 TEMP_FILE="$TMP"/changed-files
36else
37 if [ -n "$TEMP" ]; then
38 TEMP_FILE="$TEMP"/changed-files
39 else
40 TEMP_FILE=/tmp/changed-files
41 fi
42fi
43
44YEAR=`basename $0`
45
46if [ $YEAR = yearcheck.sh ]; then
47 YEAR=`date -R | cut -d ' ' -f 4`
48fi
49
50if [ -z "$1" ]; then
51 cvs -z3 update -dP | fgrep -v proposal | cut -f 2 -d ' ' > $TEMP_FILE
52else
53 if [ "all" == "$1" ]; then
54 cvs -z3 update -dP | cut -f 2 -d ' ' > $TEMP_FILE
55 else
56 echo "Usage: $YEAR [all]"
57 exit
58 fi
59fi
60
61echo "Changed:"
62echo "========"
63cat $TEMP_FILE
64echo
65
66xargs fgrep -L Copyright < $TEMP_FILE > /tmp/no-copyright
67
68echo "No Copyright line"
69echo "================="
70cat /tmp/no-copyright
71echo
72
73xargs egrep -L "Copyright.*$YEAR" < $TEMP_FILE | cut -f 1 -d : > /tmp/no-$YEAR
74
75echo "No Copyright line for year $YEAR"
76echo "================================"
77cat /tmp/no-$YEAR
78
79rm $TEMP_FILE
Note: See TracBrowser for help on using the repository browser.