106 | | {{{ |
107 | | textreplace -sf bin/gdal-config.tmpl -df bin/gdal-config \ |
108 | | -map @osgeo4w@ "%OSGEO4W_ROOT%" \ |
109 | | -map @osgeo4w_msys@ "%OSGEO4W_ROOT_MSYS%" |
110 | | }}} |
111 | | Both examples use the bin/textreplace program (part of the msvcrt package). The second example uses it with source file bin/gdal-config.tmpl and destination file bin/gdal-config and replaces occurances of @osgeo4w@ with the value of the OSGEO4W_ROOT environment variable, and @osgeo4w_msys@ with the value of the OSGEO4W_ROOT_MSYS environment variable. The pattern of processing a file from a .tmpl version is sufficiently common that textreplace supports this short form for the same action: |
112 | | {{{ |
113 | | textreplace -std -t bin/gdal-config |
114 | | }}} |
115 | | This applies the "standard" conversions to file bin/gdal-config.tmpl and puts the results in bin/gdal-config |
| 106 | As of April 2008 textreplace will update files in place, so the infile/outfile syntax is not needed: |
| 107 | {{{ |
| 108 | textreplace -std -t bin/o4w_env.bat |
| 109 | }}} |
| 110 | will apply the standard mapping change; this: |
| 111 | {{{ |
| 112 | #!html |
| 113 | <blockquote><pre>@echo off |
| 114 | set OSGEO4W_ROOT=<b>@osgeo4w@</b> |
| 115 | PATH=%OSGEO4W_ROOT%\bin;%PATH% |
| 116 | for %%f in ("%OSGEO4W_ROOT%"\etc\ini\*.bat) do call "%%f" |
| 117 | @echo on</pre></blockquote> |
| 118 | }}} |
| 119 | to this: |
| 120 | {{{ |
| 121 | #!html |
| 122 | <blockquote><pre>@echo off |
| 123 | set OSGEO4W_ROOT=<b>X:\Path\to\OSGeo4W</b> |
| 124 | PATH=%OSGEO4W_ROOT%\bin;%PATH% |
| 125 | for %%f in ("%OSGEO4W_ROOT%"\etc\ini\*.bat) do call "%%f" |
| 126 | @echo on</pre></blockquote> |
| 127 | }}} |