1 |
#! /bin/sh |
#! /bin/sh |
2 |
|
|
3 |
# mkstamp - extract data from Revision and Date RCS tags in a file |
# mkstamp - extract data from Revision and Date RCS tags in a file |
4 |
# Copyright (C) 1999 Free Software Foundation, Inc. |
# Copyright (C) 1999, 2003 Free Software Foundation, Inc. |
5 |
# Alexandre Oliva <oliva@dcc.unicamp.br> |
# Alexandre Oliva <oliva@dcc.unicamp.br> |
6 |
# |
# |
7 |
# This file is free software; you can redistribute it and/or modify it |
# This file is free software; you can redistribute it and/or modify it |
24 |
# the same distribution terms that you use for the rest of that program. |
# the same distribution terms that you use for the rest of that program. |
25 |
|
|
26 |
# This script expects to find a line containing both Revision and Date |
# This script expects to find a line containing both Revision and Date |
27 |
# tags, and it edits this line so that it looks line ` ($rev $date)' |
# tags, and it edits this line so that it looks like ` $rev $date' |
28 |
|
|
29 |
# Command-line arguments are passed down to sed; additional -e cmd |
# Command-line arguments are passed down to sed; additional -e cmd |
30 |
# arguments are acceptable. If no input filename is specified in the |
# arguments are acceptable. If no input filename is specified in the |
31 |
# command line, sed will read from stdin. |
# command line, sed will read from stdin. |
32 |
|
|
33 |
exec sed -e ' |
exec sed -e ' |
34 |
s%.*\$''Revision: \([^$]*\) \$.*\$''Date: \([^$]*\) \$.*% (\1 \2)% |
s%.*\$''Revision: \([^$]*\) \$.*\$''Date: \([^$]*\) \$.*% \1 \2% |
35 |
t end |
t end |
36 |
d |
d |
37 |
: end' ${1+"$@"} |
: end' ${1+"$@"} |