Changeset 1294
- Timestamp:
- Nov 23, 2008, 2:08:17 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
ReleaseEdit.cmd (modified) (7 diffs)
-
ReleaseTool.cmd (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ReleaseEdit.cmd
r1293 r1294 2 2 * $Id$ 3 3 * 4 * ReleaseEdit: a program which will set the version number 5 * and the date and time of a FM/2 release 4 * ReleaseEdit: a program which will edit a file and set the version 5 * number and the date of an FM/2 release as appropriate for that file. 6 * This program operates non-interactively. 6 7 * 7 8 * Usage: 8 * ReleaseEdit <version> <relative-filename> 9 * 10 * where <version> is x.y.z 11 * 12 * and <relative-filename> is ONE of the files (i.e. no wildcards) 13 * which need a version number and/or date/time: 14 * *.def, file_id.diz, dll\version.h, warpin\fm2.wis 9 * ReleaseEdit <version> <relative-filename> [trace=<trace-option>] 10 * 11 * where 12 * <version> is in the form x.y.z or x.y (where x, y and z are numbers) 13 * <relative-filename> is ONE of the files (i.e. no wildcards) 14 * which need a version number and/or date set. For example: 15 * *.def, file_id.diz, dll\version.h, warpin\fm2.wis 16 * <trace-option> is a valid comnbination of trace options: 17 * '? a c e f i l n o r'. This is an OPTIONAL parameter. 18 * 19 * Examples: 20 * ReleaseEdit 3.15.0 av2.def 21 * ReleaseEdit 3.15.0 fm3.def trace=i 15 22 * 16 23 * Change log: … … 30 37 * - improved error handling: tmp file renamed back to deleted file 31 38 * - improved "usage" routine 39 * 22 Nov 08 JBS Ticket 297 40 * - Fix bugs in version edits and added 41 * - Support for an optional trace parameter. 42 * - Improved "usage" routine 43 * - Suppressed output of 'del' commands 32 44 * 33 45 */ 34 46 35 47 n = setlocal() 48 49 parse arg args 50 p = pos('TRACE=', translate(args)) 51 if p > 0 then 52 do 53 args = args || ' ' /* make sure there's a space at the end */ 54 traceopt = substr(args, p+6, pos(' ', args, p+5) - (p+6)) 55 args = delstr(args, p, 6+length(traceopt)) 56 if traceopt \= '' then 57 if verify(translate(traceopt), '?ACEFILNOR') = 0 & length(traceopt) < 3 then 58 trace value traceopt 59 end 36 60 37 61 signal on Error … … 44 68 signal on novalue /* for debugging */ 45 69 */ 46 47 70 /* 48 71 sed_separator: … … 59 82 60 83 /* Process parameters */ 61 parse argver file .84 parse var args ver file . 62 85 if ver = '' | file = '' then 63 86 call Usage /* and exit */ … … 153 176 do 154 177 say 'Processing file:' file 155 'grep -E "^#define.*COPYRIGHT_YEAR.*' || year || '" ' || file || ' >nul || del ' || file || ' && sed -r -e "/#define.*COPYRIGHT_YEAR/s/[0-9]+/' || year || '/" ' || tmpfile || ' >' file178 'grep -E "^#define.*COPYRIGHT_YEAR.*' || year || '" ' || file || ' >nul || del ' || file || '>nul 2>nul && sed -r -e "/#define.*COPYRIGHT_YEAR/s/[0-9]+/' || year || '/" ' || tmpfile || ' >' file 156 179 end 157 180 else … … 183 206 end 184 207 exit_routine: 185 '@if exist' tmpfile 'del' tmpfile 208 '@if exist' tmpfile 'del' tmpfile '>nul 2>nul' 186 209 n = endlocal() 187 210 return … … 239 262 say srcline 240 263 i = i + 1 264 if (i // 22) = 0 then 265 '@pause' 241 266 end 242 267 -
trunk/ReleaseTool.cmd
r1293 r1294 10 10 * 11 11 * Usage: 12 * ReleaseTool [ <this-version-number>] [<next-version-number>]12 * ReleaseTool [trace=<trace-option>] 13 13 * 14 * where the version number(s) are optional and of the form x.y.z 15 * 16 * This program will reformat the version numbers to suit their use: 17 * tag names 18 * wpi filenames 19 * warpin packageid/database version number(s) 14 * where 15 * <trace-option> is a valid comnbination of trace options: 16 * '? a c e f i l n o r'. This is an OPTIONAL parameter. 20 17 * 21 18 * This program uses the following enviromental variables, if set 22 * SVN_EDITOR to set the text editor that is called19 * SVN_EDITOR or EDITOR to set the text editor that is called 23 20 * SVN_TESTER to call a cmd file that copies files to your test directory 24 21 * and changes to that directory … … 34 31 * - Removed extraneous 'pause' in option 20 35 32 * - Fixed a bug in option 0 (run a command shell) 33 * 22 Nov 08 JBS Ticket 297 34 * - Fix bugs in version edits 35 * - Support for an optional trace parameter. 36 * - Support for EDITOR env var 37 * - Improved "usage" routine 36 38 * 37 39 */ … … 50 52 51 53 52 globals = 'cmd prompt editor editorcmds killpid tester killtarget version_filelist pager prev_action' 53 54 parse arg ver next_ver 55 if (pos('?', ver) > 0 | pos('h', ver) > 0) then 56 signal Usage /* and exit */ 54 globals = 'ver cmd prompt editor editorcmds killpid tester killtarget version_filelist pager prev_action' 55 56 parse arg args 57 p = pos('TRACE=', translate(args)) 58 if p > 0 then 59 do 60 args = args || ' ' /* make sure there's a space at the end */ 61 traceopt = substr(args, p+6, pos(' ', args, p+5) - (p+6)) 62 args = delstr(args, p, 6+length(traceopt)) 63 if traceopt \= '' then 64 if verify(translate(traceopt), '?ACEFILNOR') = 0 & length(traceopt) < 3 then 65 trace value traceopt 66 end 67 else 68 traceopt = '' 69 if strip(args) \= '' then /* trace= is the only supported parameter */ 70 call Usage 57 71 58 72 call Init … … 131 145 ver = GetVer('the pending release') 132 146 do f = 1 to words(version_filelist) 133 call ReleaseEdit ver word(version_filelist, f) 147 call ReleaseEdit ver word(version_filelist, f) 'trace=' || traceopt 134 148 say 135 149 end … … 307 321 next_ver = GetVer('the next release') 308 322 do f = 1 to words(version_filelist) 309 call ReleaseEdit next_ver word(version_filelist, f) 323 call ReleaseEdit next_ver word(version_filelist, f) 'trace=' || traceopt 310 324 say 311 325 end … … 339 353 Usage: 340 354 say;say;say 341 lastline = sigl - 10 342 do i = 1 to lastline 343 say sourceline(i) 355 i = 1 356 do forever 357 srcline = sourceline(i) 358 if pos('CHANGE LOG', translate(srcline)) > 0 then 359 leave 360 else 361 say srcline 362 i = i + 1 363 if (i // 22) = 0 then 364 '@pause' 344 365 end 345 366 exit … … 351 372 352 373 action = 0 374 ver = '' 353 375 354 376 editor = value('SVN_EDITOR',,'OS2ENVIRONMENT') 355 cmd = value('COMSPEC',,'OS2ENVIRONMENT')356 prompt = value('PROMPT',,'OS2ENVIRONMENT')357 tester = value('SVN_TESTER',,'OS2ENVIRONMENT')358 killpid = value('SVN_KILL',,'OS2ENVIRONMENT')359 360 377 editorcmds = "" 361 if editor == '' then 378 if editor = '' then 379 editor = value('EDITOR',,'OS2ENVIRONMENT') 380 if editor = '' then 362 381 editor = 'tedit' 363 382 else … … 367 386 editorcmds = "'3'" 368 387 end 388 cmd = value('COMSPEC',,'OS2ENVIRONMENT') 389 prompt = value('PROMPT',,'OS2ENVIRONMENT') 390 tester = value('SVN_TESTER',,'OS2ENVIRONMENT') 391 killpid = value('SVN_KILL',,'OS2ENVIRONMENT') 369 392 if killpid == '' then 370 393 killpid = 'killpid' 371 394 killtarget = ' FM/2' 395 372 396 version_filelist = 'av2.def databar.def dirsize.def dll\fm3dll.def dll\fm3res.def' 373 397 version_filelist = version_filelist 'dll\version.h eas.def fm3.def fm4.def global.def ini.def' … … 443 467 say 'Please enter the version (x.yy.zz) for' ver_text ':' 444 468 ver_value = linein() 445 parse var major '.' minor '.' CSDlevel469 parse var ver_value major '.' minor '.' CSDlevel 446 470 if minor = '' then 447 471 minor = 0 448 472 if CSDlevel = '' then 449 473 CSDlevel = 0 450 if datatype(major) \= 'NUM' | datatype(minor \= 'NUM')| datatype(CSDlevel) \= 'NUM' then474 if datatype(major) \= 'NUM' | datatype(minor) \= 'NUM' | datatype(CSDlevel) \= 'NUM' then 451 475 do 452 476 say 'Error: Invalid version entered:' ver_value … … 537 561 call charout , 'OK to proceed with file write? (Y/n) ' 538 562 entry = translate(SysGetKey()) 539 say;say 'Hex(key):' c2x(entry)540 563 end 541 564
Note:
See TracChangeset
for help on using the changeset viewer.
