Changeset 1389
- Timestamp:
- Jan 7, 2009, 1:19:01 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ReleaseEdit.cmd
r1388 r1389 44 44 * 23 Nov 08 JBS Improved handling of invalid or missing <trace-option> 45 45 * and a 'NOTREADY' condition when closing the repository. 46 * 05 Jan 09 JBS Added code to set VERREALMINOR to default in dll\version.h 46 * 06 Jan 09 JBS Added code to set VERREALMINOR in dll\version.h 47 * a) to value of FM2_VERREALMINOR environment variable, if set 48 * b) to " "__DATE__ if FM2_VERREALMINOR environment variable is not set 49 * NOTE: FM2_VERREALMINOR, if set, must have an even number (including 0) 50 * of double quotes. SED seems to choke on an odd number, even if they are 51 * propoerly escaped. 47 52 * 48 53 */ … … 198 203 do /* change below to delete and then update version.h only if version is different? */ 199 204 say 'Processing file:' file 205 fm2_verrealminor = value('FM2_VERREALMINOR',, 'OS2ENVIRONMENT') 206 if fm2_verrealminor = '' then 207 fm2_verrealminor = '\" \"__DATE__' 208 else 209 fm2_verrealminor = EscapeSEDString(fm2_verrealminor) 200 210 '@del' file '1>nul 2>nul' 201 'sed -r -e "/#define[ \t]+VERMAJOR/s/(#define[ \t]+VERMAJOR[ \t]+)[^ \t]+/\1' || major || '/g" -e "/#define[ \t]+VERMINOR/s/(#define[ \t]+VERMINOR[ \t]+)[^ \t]+/\1' || minor || '/g" -e "/^[ \t]*#define[ \t]+VERREALMINOR/s/(#define[ \t]+VERREALMINOR).*/\1 \" \"__DATE__/g" ' || tmpfile || ' >' file211 'sed -r -e "/#define[ \t]+VERMAJOR/s/(#define[ \t]+VERMAJOR[ \t]+)[^ \t]+/\1' || major || '/g" -e "/#define[ \t]+VERMINOR/s/(#define[ \t]+VERMINOR[ \t]+)[^ \t]+/\1' || minor || '/g" -e "/^[ \t]*#define[ \t]+VERREALMINOR/s/(#define[ \t]+VERREALMINOR).*/\1 ' || fm2_verrealminor || '/g" ' || tmpfile || ' >' file 202 212 end 203 213 end … … 283 293 end 284 294 295 EscapeSEDString: procedure 296 parse arg SEDString 297 SEDString = SEDString || '00'x 298 escape_chars = '\/"' 299 escape_char = '\' 300 escaped_string = '' 301 next_char = left(SEDString, 1) 302 do i = 1 to length(SEDString) 303 this_char = substr(SEDString, i, 1) 304 if this_char = escape_char then 305 do 306 next_char = substr(SEDString, i + 1, 1) 307 if pos(next_char, escape_chars) > 0 then 308 do 309 escaped_string = escaped_string || this_char || next_char 310 i = i + 1 311 end 312 else 313 escaped_string = escaped_string || escape_char || this_char 314 end 315 else 316 if pos(this_char, escape_chars) > 0 then 317 escaped_string = escaped_string || escape_char || this_char 318 else 319 if this_char \= '00'x then 320 escaped_string = escaped_string || this_char 321 end 322 return escaped_string 323 285 324 /*=== Error() Report ERROR, FAILURE etc. and exit ===*/ 286 325
Note:
See TracChangeset
for help on using the changeset viewer.