summaryrefslogtreecommitdiffstats
path: root/bin/restore.sh
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2005-12-18 16:22:43 (GMT)
committerSteven Knight <knight@baldmt.com>2005-12-18 16:22:43 (GMT)
commit4d42bf663f2d069c8dc52ccc3130af9b8c84edae (patch)
tree2dc03f8cf2aa2925f2ffafe78112f02971d35764 /bin/restore.sh
parent745e6b9664e75e82cd4b8817f4e89ce709609a7a (diff)
downloadSCons-4d42bf663f2d069c8dc52ccc3130af9b8c84edae.zip
SCons-4d42bf663f2d069c8dc52ccc3130af9b8c84edae.tar.gz
SCons-4d42bf663f2d069c8dc52ccc3130af9b8c84edae.tar.bz2
Update the bin/restore.sh script for more complete conversion of substituted __*__ variables. Put proper __COPYRIGHT__ and __revision__ templates in LaTeXTests.py.
Diffstat (limited to 'bin/restore.sh')
-rw-r--r--bin/restore.sh70
1 files changed, 61 insertions, 9 deletions
diff --git a/bin/restore.sh b/bin/restore.sh
index d23d1d0..0ed181d 100644
--- a/bin/restore.sh
+++ b/bin/restore.sh
@@ -1,8 +1,8 @@
#!/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.
+# Simple hack script to restore __revision__, __COPYRIGHT_, __VERSION__
+# 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
@@ -11,27 +11,79 @@ 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
-ed $i <<EOF
+ header $i
+ ed $i <<EOF
+g/Copyright (c) 2001.*SCons Foundation/s//__COPYRIGHT__/p
+w
/^__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 'scons.bat'`; do
+ header $i
+ ed $i <<EOF
+g/Copyright (c) 2001.*SCons Foundation/s//__COPYRIGHT__/p
+w
+/^@REM src\/script\/scons.bat/s/@REM .* knight/@REM __FILE__ __REVISION__ __DATE__ __DEVELOPER__/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/= .*/= "__VERSION__"/p
+w
+/^__build__ = /s/= .*/= "__BUILD__"/p
+w
+/^__buildsys__ = /s/= .*/= "__BUILDSYS__"/p
+w
+/^__date__ = /s/= .*/= "__DATE__"/p
+w
+/^__developer__ = /s/= .*/= "__DEVELOPER__"/p
+w
+q
+EOF
+done
+
+for i in `find $DIRS -name 'setup.py'`; do
+ header $i
+ ed $i <<EOF
+/^ *version = /s/= .*/= "__VERSION__",/p
w
q
EOF
done
for i in `find $DIRS -name '*.txt'`; do
-ed $i <<EOF
+ header $i
+ ed $i <<EOF
+g/Copyright (c) 2001.*SCons Foundation/s//__COPYRIGHT__/p
+w
/# [^ ]* 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
+/Version [0-9][0-9]*\.[0-9][0-9]*/s//Version __VERSION__/p
w
q
EOF
done
for i in `find $DIRS -name '*.xml'`; do
-ed $i <<EOF
-/^<!-- Copyright (c) 2001.*SCons Foundation -->$/s/.*/<!-- __COPYRIGHT__ -->/p
+ header $i
+ ed $i <<EOF
+g/Copyright (c) 2001.*SCons Foundation/s//__COPYRIGHT__/p
w
q
EOF