summaryrefslogtreecommitdiff
path: root/bin/restore.sh
blob: 5fcdb08915faa170d3083985b036617af6b9ab0d (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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/usr/bin/env sh
#
# Simple hack script to restore __revision__, __COPYRIGHT_, 3.0.5
# and other similar variables 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

SEPARATOR="================================================================================"

header() {
    arg_space="$1 "
    dots=`echo "$arg_space" | sed 's/./\./g'`
    echo "$SEPARATOR" | sed "s;$dots;$arg_space;"
}

for i in `find $DIRS -name '*.py'`; do
    header $i
    ed $i <<EOF
g/Copyright (c) 2001.*SCons Foundation/s//Copyright (c) 2001 - 2019 The SCons Foundation/p
w
/^__revision__ = /s/= .*/= "bin/restore.sh 103260fce95bf5db1c35fb2371983087d85dd611 2019-07-13 18:25:30 bdbaddog"/p
w
q
EOF
done

for i in `find $DIRS -name 'scons.bat'`; do
    header $i
    ed $i <<EOF
g/Copyright (c) 2001.*SCons Foundation/s//Copyright (c) 2001 - 2019 The SCons Foundation/p
w
/^@REM src\/script\/scons.bat/s/@REM .* knight/@REM bin/restore.sh 103260fce95bf5db1c35fb2371983087d85dd611 2019-07-13 18:25:30 bdbaddog/p
w
q
EOF
done

for i in `find $DIRS -name '__init__.py' -o -name 'scons.py' -o -name 'sconsign.py'`; do
    header $i
    ed $i <<EOF
/^__version__ = /s/= .*/= "3.0.5"/p
w
/^__build__ = /s/= .*/= "103260fce95bf5db1c35fb2371983087d85dd611"/p
w
/^__buildsys__ = /s/= .*/= "Williams-MBP-2"/p
w
/^__date__ = /s/= .*/= "2019-07-13 18:25:30"/p
w
/^__developer__ = /s/= .*/= "bdbaddog"/p
w
q
EOF
done

for i in `find $DIRS -name 'setup.py'`; do
    header $i
    ed $i <<EOF
/^ *version = /s/= .*/= "3.0.5",/p
w
q
EOF
done

for i in `find $DIRS -name '*.txt'`; do
    header $i
    ed $i <<EOF
g/Copyright (c) 2001.*SCons Foundation/s//Copyright (c) 2001 - 2019 The SCons Foundation/p
w
/# [^ ]* 0.96.[CD][0-9]* [0-9\/]* [0-9:]* knight$/s/.*/# bin/restore.sh 103260fce95bf5db1c35fb2371983087d85dd611 2019-07-13 18:25:30 bdbaddog/p
w
/Version [0-9][0-9]*\.[0-9][0-9]*/s//Version 3.0.5/p
w
q
EOF
done

for i in `find $DIRS -name '*.xml'`; do
    header $i
    ed $i <<EOF
g/Copyright (c) 2001.*SCons Foundation/s//Copyright (c) 2001 - 2019 The SCons Foundation/p
w
q
EOF
done