Changes between Version 22 and Version 23 of PackagingInstructions


Ignore:
Timestamp:
Feb 16, 2010, 9:57:13 PM (14 years ago)
Author:
maphew
Comment:

textreplace doesn't require a template file anymore

Legend:

Unmodified
Added
Removed
Modified
  • PackagingInstructions

    v22 v23  
    104104=== !TextReplace Example !#2 ===
    105105
    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
     106As of April 2008 textreplace will update files in place, so the infile/outfile syntax is not needed:
     107{{{
     108textreplace -std -t bin/o4w_env.bat
     109}}}
     110will apply the standard mapping change; this:
     111{{{
     112#!html
     113<blockquote><pre>@echo off
     114set OSGEO4W_ROOT=<b>@osgeo4w@</b>
     115PATH=%OSGEO4W_ROOT%\bin;%PATH%
     116for %%f in ("%OSGEO4W_ROOT%"\etc\ini\*.bat) do call "%%f"
     117@echo on</pre></blockquote>
     118}}}
     119to this:
     120{{{
     121#!html
     122<blockquote><pre>@echo off
     123set OSGEO4W_ROOT=<b>X:\Path\to\OSGeo4W</b>
     124PATH=%OSGEO4W_ROOT%\bin;%PATH%
     125for %%f in ("%OSGEO4W_ROOT%"\etc\ini\*.bat) do call "%%f"
     126@echo on</pre></blockquote>
     127}}}
    116128
    117129== Creating Shortcuts ==