Debian Codegraph @

scripts/configreplacements

raw
1 #!/bin/bash
2
3 CONFIG="tmp/wip/config.h"
4
5 # This script changes all definitions of elements in $CONFIG in the
6 # file passed as arg 1, generating arg 2.
7 # The default path to the macro files in $CONFIG can be overrules
8 # by a 3rd argument.
9
10 case $# in
11 (3)
12 YODL_BIN=`grep YODL_BIN $CONFIG | cut -d\" -f2`
13 VERSION=`grep VERSION $CONFIG | cut -d\" -f2`
14 STD_INCLUDE=$3
15 ;;
16
17 (*)
18 echo "Usage: $0 xxx.in xxx.yo path-to-macro-files"
19 exit 1
20 ;;
21 esac
22
23 # Create the destination file, changing @... into the required
24 # values
25 #
26 sed '
27 s,@STD_INCLUDE@,'$STD_INCLUDE',g
28 s,@YODL_BIN@,'$YODL_BIN',g
29 s,@VERSION@,'$VERSION',g
30 ' $1 > $2
31
32
33