source: subversion/applications/rendering/toposm/generate_xml @ 34399

Last change on this file since 34399 was 22872, checked in by ahlzen, 9 years ago

Added central configuration script.

  • Property svn:executable set to *
File size: 605 bytes
Line 
1#!/bin/bash
2
3# Generates the mapnik xml files and includes from
4# their respective templates.
5
6# Variable declarations on the form ${VAR} are substituted with
7# the value of the corresponding enviroment variable VAR.
8
9if [[ -z $TOPOSM_ENV_SET ]]; then
10    echo "Error: TopOSM environment not set."
11    exit 1
12fi
13
14for SRC in `ls *.templ include/*.templ`; do
15    echo "Processing $SRC..."
16    DST=`dirname $SRC`/`basename $SRC .templ`
17    cat "$SRC" \
18        | awk '{while(match($0,"[$]{[^}]*}")){var=substr($0,RSTART+2,RLENGTH -3);gsub("[$]{"var"}",ENVIRON[var])}}1' \
19        > "$DST"
20done
21echo "Done."
22
Note: See TracBrowser for help on using the repository browser.