Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

gdp / adm / update-license.sh @ master

History | View | Annotate | Download (583 Bytes)

1 055d3009 Eric Allman
#!/bin/sh
2
3 453e2d99 Eric Allman
adm=`dirname $0`
4 055d3009 Eric Allman
5
update_license() {
6
	file=$1
7
	{
8
	    cp $file $file.BAK &&
9
	    awk -f $adm/update-license.awk $file > $file.$$ &&
10
	    cp $file.$$ $file &&
11
	    rm $file.$$
12
	} ||
13
	    echo WARNING: could not update license for $file 1>&2
14
}
15
16 987041ea Eric Allman
#  Fudge LICENSE file in this directory or parent, no further up
17
rmLICENSE=false
18 453e2d99 Eric Allman
if [ ! -r LICENSE ]
19
then
20 987041ea Eric Allman
	if [ -r ../LICENSE ]
21
	then
22
		ln -s ../LICENSE
23
		rmLICENSE=true
24
	else
25
		echo "[ERROR] LICENSE file must exist"
26
		exit 1
27
	fi
28 453e2d99 Eric Allman
fi
29
30
31 055d3009 Eric Allman
for f
32
do
33
	echo Updating $f
34
	update_license $f
35
done
36 987041ea Eric Allman
37
if $rmLICENSE
38
then
39
	rm LICENSE
40
fi
41
42
exit 0