summaryrefslogtreecommitdiffstats
path: root/bin/restore.sh
blob: d23d1d0c0ba9fb5148fbe99f32eeb5bc7caec9d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env sh
#
# Simple hack script to restore __revision__ and __COPYRIGHT_ lines
# to what gets checked in to source.  This comes in handy when people
# send in diffs based on the released source.
#

if test "X$*" = "X"; then
    DIRS="src test"
else
    DIRS="$*"
fi

for i in `find $DIRS -name '*.py'`; do
ed $i <<EOF
/^__revision__ = /s/= .*/= "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"/p
/Copyright (c) 2001.*SCons Foundation.*/s//__COPYRIGHT__/p
w
q
EOF
done

for i in `find $DIRS -name '*.txt'`; do
ed $i <<EOF
/# [^ ]* 0.96.[CD][0-9]* [0-9\/]* [0-9:]* knight$/s/.*/# __FILE__ __REVISION__ __DATE__ __DEVELOPER__/p
/Copyright (c) 2001.*SCons Foundation.*/s//__COPYRIGHT__/p
w
q
EOF
done

for i in `find $DIRS -name '*.xml'`; do
ed $i <<EOF
/^<!-- Copyright (c) 2001.*SCons Foundation -->$/s/.*/<!-- __COPYRIGHT__ -->/p
w
q
EOF
done