Changeset 1289


Ignore:
Timestamp:
Nov 21, 2008, 9:30:11 PM (17 years ago)
Author:
John Small
Message:

Ticket 297: Current copyright year has been centralized into a single
#define in dll\copyright.h

Location:
trunk
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/ReleaseEdit.cmd

    r1287 r1289  
    2727 *            - support for environment variables
    2828 *          - edits length of all fields in option description
    29  *       - added support for changing copyright years in:
    30  *          - dll\copyright.c
    31  *          - dll\fm3res.rc
    32  *          - dll\fm3res.dlg (About box)
     29 *       - added support for changing copyright years
    3330 *       - improved error handling: tmp file renamed back to deleted file
    3431 *       - improved "usage" routine
     
    7168mkstr_makefile  = 'DLL\INTERNAL\MAKEFILE'
    7269warpin_makefile = 'WARPIN\MAKEFILE'
     70copyright_h     = 'DLL\COPYRIGHT.H'
    7371parse value date('s') with year 5 month 7 day
    7472last_year = year - 1
     
    8381      exit 1
    8482   end
    85 if wordpos(ext, 'C RC DLG') = 0 then
     83if wordpos(ext, 'H') = 0 then
    8684   'del' file
    8785
     
    127125         'sed -r -e "/option description/s' || sed_separator || '.*' || sed_separator || option_description || sed_separator || '" ' || tmpfile || ' >' file
    128126      end
    129    when wordpos(ext, 'C RC DLG') > 0 then
    130       do
    131          signal off error
    132          'grep -E "Copyright.*' || last_year || '[^,]" ' || file || ' >nul && del ' || file || ' && sed -r -e "/Copyright.*' || last_year || '[^,]/s/' || last_year || '/' || year || '/" ' || tmpfile || ' >' file
    133          signal on error
    134       end
    135127   when ext = 'H' then
    136128      do
    137          '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" ' || tmpfile || ' >' file
     129         if translate(file) = copyright_h then
     130            'grep -E "^#define.*COPYRIGHT_YEAR.*' || year || '" ' || file || ' >nul || del ' || file || ' && sed -r -e "/#define.*COPYRIGHT_YEAR/s/[0-9]+/' || year || '/" ' || tmpfile || ' >' file
     131         else
     132            do /* change below to delete and then update version.h only if version is different? */
     133               'del' file
     134               '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" ' || tmpfile || ' >' file
     135            end
    138136      end
    139137   when ext = 'DIZ' then
     
    141139         'sed -r "/FM\/2 v/s/(FM\/2 v)[0-9]+\.[0-9.]+/\1' || ver || '/" ' || tmpfile || ' >' file
    142140      end
    143    when right(ext, length(mkstr_makefile)) = mkstr_makefile then
     141   when ext = mkstr_makefile then
    144142      do
    145143         'sed -r -e "/desc/s/(SLAInc:).*(\$#@\$#\$#1\$#\$# )[0-9/]+ [0-9:]+/\1' || ver || '\2' || month || '\/' || day || '\/' || year right(major, 2, '0') || ':' || right(minor, 2, '0') || ':' || right(CSDlevel, 2, '0') || '/" ' || tmpfile || ' >' file
    146144      end
    147    when right(ext, length(warpin_makefile)) = warpin_makefile then
     145   when ext = warpin_makefile then
    148146      do
    149147         warpin_db_ver = (major + 0) || '\\' || (minor + 0) || '\\' || (CSDlevel + 0)
     
    228226    trace '?A'
    229227    say 'Exiting.'
    230     'ren' tmpfile file
     228    'if exist' tmpfile 'move' tmpfile file
    231229    call 'SYSSLEEP' 2
    232230    exit 'CONDITION'('C')
  • trunk/ReleaseTool.cmd

    r1287 r1289  
    2727 *
    2828 * Change log:
    29  *      18 Nov 08 JBS Ticket 297: Various build improvements/corrections
    30  *              - Use same file list for option 8 and option 20
    31  *              - Set the file list for option 8 and option 20 once, in Init routine
    32  *              - Removed fm2.wis from the file list for option 8 and option 20 (not needed)
    33  *              - Added optional commit to option 20
    34  *              - Removed extraneous 'pause' in option 20
    35  *              - Fixed a bug in option 0 (run a command shell)
     29 *    18 Nov 08 JBS Ticket 297: Various build improvements/corrections
     30 *       - Use same file list for option 8 and option 20
     31 *       - Set the file list for option 8 and option 20 once, in Init routine
     32 *       - Removed fm2.wis from the file list for option 8 and option 20 (not needed)
     33 *       - Added optional commit to option 20
     34 *       - Removed extraneous 'pause' in option 20
     35 *       - Fixed a bug in option 0 (run a command shell)
    3636 *
    3737*/
     
    5454parse arg ver next_ver
    5555if (pos('?', ver) > 0 | pos('h', ver) > 0) then
    56    signal Usage         /* and exit */
     56   signal Usage      /* and exit */
    5757
    5858call Init
     
    7474               '@'cmd '/c 'action
    7575               signal on Error
    76                action = -1                                      /* Skip SELECT below */
     76               action = -1             /* Skip SELECT below */
    7777            end
    7878      end
     
    132132               file = word(version_filelist2, f)
    133133               call SysCls
    134                                         say;say;say
    135                 say 'Next, edit the' file 'file.'
    136                 say
    137                 say 'Include descriptions of salient changes to FM/2.'
    138                 say
    139                 say 'And be sure to update the version number to' ver
    140                                         say
    141                                         '@pause'
    142                                         editor file editorcmds
     134               say;say;say
     135               say 'Next, edit the' file 'file.'
     136               say
     137               say 'Include descriptions of salient changes to FM/2.'
     138               say
     139               say 'And be sure to update the version number to' ver
     140               say
     141               '@pause'
     142               editor file editorcmds
    143143            end
    144144            call BuildHobbesTxt(ver)
     
    210210         do /* Test the release code */
    211211            if tester == '' then
    212                 do
    213                         call NotYet action
     212               do
     213                  call NotYet action
    214214                  say 'Test the (compressed) release code.'
    215215                  say
     
    290290            call CommitifOK version_filelist
    291291         end
    292         otherwise
    293                 nop
     292      otherwise
     293         nop
    294294   end
    295         say;say;say
    296         if action \= 0 then
    297                 '@pause'               
     295   say;say;say
     296   if action \= 0 then
     297      '@pause'
    298298end
    299299
     
    315315
    316316Usage:
    317         say;say;say
    318         lastline = sigl - 10
    319         do i = 1 to lastline
    320                 say sourceline(i)
    321         end
     317   say;say;say
     318   lastline = sigl - 10
     319   do i = 1 to lastline
     320      say sourceline(i)
     321   end
    322322exit
    323323
     
    327327   call SysLoadFuncs
    328328
    329         action = 0
    330 
    331         editor = value('SVN_EDITOR',,'OS2ENVIRONMENT')
    332    cmd          = value('COMSPEC',,'OS2ENVIRONMENT')
    333    prompt       = value('PROMPT',,'OS2ENVIRONMENT')
     329   action = 0
     330
     331   editor = value('SVN_EDITOR',,'OS2ENVIRONMENT')
     332   cmd      = value('COMSPEC',,'OS2ENVIRONMENT')
     333   prompt   = value('PROMPT',,'OS2ENVIRONMENT')
    334334   tester       = value('SVN_TESTER',,'OS2ENVIRONMENT')
    335335   killpid      = value('SVN_KILL',,'OS2ENVIRONMENT')
    336336
    337337   editorcmds = ""
    338         if editor == '' then
    339                 editor = 'tedit'
     338   if editor == '' then
     339      editor = 'tedit'
    340340   else
    341         do
    342                 upperwrd1 = translate(word(editor, 1))
    343                 if upperwrd1 = 'EPM' | upperwrd1 = 'EPM.EXE' then
    344                 editorcmds = "'3'"
    345       end               
     341      do
     342         upperwrd1 = translate(word(editor, 1))
     343         if upperwrd1 = 'EPM' | upperwrd1 = 'EPM.EXE' then
     344            editorcmds = "'3'"
     345      end
    346346   if killpid == '' then
    347347       killpid      = 'killpid'
    348348   killtarget  = ' FM/2'
    349         version_filelist = 'av2.def databar.def dirsize.def dll\fm3dll.def dll\fm3res.def'
    350         version_filelist = version_filelist 'dll\version.h eas.def fm3.def fm4.def global.def ini.def'
    351         version_filelist = version_filelist 'killproc.def sysinfo.def undel.def vcollect.def vdir.def'
    352         version_filelist = version_filelist 'viewinfs.def vtree.def file_id.diz'
    353         version_filelist = version_filelist 'warpin\makefile dll\internal\makefile'
    354         version_filelist = version_filelist 'dll\copyright.c dll\fm3res.rc dll\fm3res.dlg'
     349   version_filelist = 'av2.def databar.def dirsize.def dll\fm3dll.def dll\fm3res.def'
     350   version_filelist = version_filelist 'dll\version.h eas.def fm3.def fm4.def global.def ini.def'
     351   version_filelist = version_filelist 'killproc.def sysinfo.def undel.def vcollect.def vdir.def'
     352   version_filelist = version_filelist 'viewinfs.def vtree.def file_id.diz'
     353   version_filelist = version_filelist 'warpin\makefile dll\internal\makefile'
     354   version_filelist = version_filelist 'dll\copyright.h'
    355355return
    356356
    357357DisplayMenu: procedure
    358         do forever
    359         call SysCls
    360         say;say;say
    361         say 'Release Tasks'
    362         say
    363         say '1.  Ensure all work for this release is committed.'
    364         say '2.  Verify completed tickets are marked closed.'
    365         say '3.  (svn) update local files.'
    366         say '4.  Check (svn) status of local files.'
    367         say '5.  Edit various files with version #''s and date''s.'
     358   do forever
     359      call SysCls
     360      say;say;say
     361      say 'Release Tasks'
     362      say
     363      say '1.  Ensure all work for this release is committed.'
     364      say '2.  Verify completed tickets are marked closed.'
     365      say '3.  (svn) update local files.'
     366      say '4.  Check (svn) status of local files.'
     367      say '5.  Edit various files with version #''s and date''s.'
    368368      say '6.  Ensure the edits build.'
    369369      say '7.  Test built code.'
     
    395395      if action <= 20 then
    396396         leave
    397         end
     397   end
    398398return action
    399399
    400400NotYet: procedure
    401         parse arg action
    402         call SysCls
    403         say;say;say
    404         say 'This option, ' || action || ', has not yet been (and may never be) automated.'
    405         say
    406         say 'You will have to do this manually. See instructions below:'
    407         say;say;say
     401   parse arg action
     402   call SysCls
     403   say;say;say
     404   say 'This option, ' || action || ', has not yet been (and may never be) automated.'
     405   say
     406   say 'You will have to do this manually. See instructions below:'
     407   say;say;say
    408408return
    409409
    410410GetVer: procedure
    411         parse arg ver_text
    412         say
    413         say 'Please enter the version (x.yy.zz) for' ver_text ':'
     411   parse arg ver_text
     412   say
     413   say 'Please enter the version (x.yy.zz) for' ver_text ':'
    414414   parse value linein() with major '.' minor '.' CSDlevel
    415415   if minor    = '' then
     
    423423
    424424Tag_ver: procedure
    425         parse arg ver
     425   parse arg ver
    426426   parse var ver major '.' minor '.' CSDlevel
    427427return major || '_' || right(minor, 2, '0') || '_' || right(CSDlevel, 2, 0)
     
    432432
    433433BuildHobbesTxt: procedure expose (globals)
    434         parse arg ver
    435         wpi_version = WPI_ver(ver)
    436         HobbesTxtFilename = 'FM2-' || wpi_version || '.txt'
    437         if stream(HobbesTxtFilename, 'c', 'query exists') \= '' then
    438                 do
    439                         say;say;say
    440                         say HobbesTxtFilename 'already exists!'
    441                         call charout , 'Do you want to replace this file? (y/N) '
    442                         if translate(SysGetKey()) \= 'Y' then
    443                                 do
    444                                         say;say;
    445                                         say HobbesTxtFilename 'update aborted.'
    446                                         return
    447                            end
    448                         call SysFileDelete HobbesTxtFilename
    449                 end
    450         /* Prompt for user input (name, email, permission to email, previous version) here? */
    451         default_name                            = 'Gregg Young'
    452         default_email                           = 'ygk@qwest.net'
    453         default_OKtoListEmail   = 'yes'
    454         entry = ''
    455         do until (entry = 'Y' | entry = '0d'x)
    456         say;say
    457         say 'You will now be prompted for potentially variable fields within' HobbesTxtFilename
    458         say
    459         say 'A default value will be given for most fields.'
    460         say 'To accept the default just press the Enter key.'
    461         say
    462         call charout , 'Name of the relaser (default:' default_name '): '
    463         entry = strip(linein())
    464         if entry = '' then
    465                 name = default_name
    466         else
    467                 name = entry
    468         say;say
    469         call charout , 'Email address of the relaser (default:' default_email '): '
    470         entry = strip(linein())
    471         if entry = '' then
    472                 email = default_email
    473         else
    474                 email = entry
    475         say;say
    476         call charout , 'OK to list email address of the relaser (default:' default_OKtoListEmail '): '
    477         entry = strip(linein())
    478         if entry = '' then
    479                 OKtoListEmail = default_OKtoListEmail
    480         else
    481                 if translate(left(entry, 1)) = translate(left(default_OKtoListEmail, 1)) then
    482                         OKtoListEmail = default_OKtoListEmail
    483                 else
    484                         if left(default_OKtoListEmail, 1) = 'y' then
    485                                 OKtoListEmail = 'no'
    486                         else
    487                                 OKtoListEmail = 'yes'
    488         say;say
    489         replaced_ver = WPI_Ver(GetVer('version to be replaced'))
    490         replaced_ver_wpi = 'fm2-' || replaced_ver || '.wpi'
    491         say;say
    492         say 'Data entered:'
    493         say '  Name of releaser  :' name
    494         say '  Email of releaser :' email
    495         say '  OK to list email  :' OKtoListEmail
    496         say '  WPI to be replaced:' replaced_ver_wpi
    497         say;say
    498         call charout , 'OK to proceed with file write? (Y/n) '
    499         entry = translate(SysGetKey())
    500         say;say 'Hex(key):' c2x(entry)
    501         end
    502        
    503         rm1 = 73
    504         rm2 = 25
     434   parse arg ver
     435   wpi_version = WPI_ver(ver)
     436   HobbesTxtFilename = 'FM2-' || wpi_version || '.txt'
     437   if stream(HobbesTxtFilename, 'c', 'query exists') \= '' then
     438      do
     439         say;say;say
     440         say HobbesTxtFilename 'already exists!'
     441         call charout , 'Do you want to replace this file? (y/N) '
     442         if translate(SysGetKey()) \= 'Y' then
     443            do
     444               say;say;
     445               say HobbesTxtFilename 'update aborted.'
     446               return
     447            end
     448         call SysFileDelete HobbesTxtFilename
     449      end
     450   /* Prompt for user input (name, email, permission to email, previous version) here? */
     451   default_name            = 'Gregg Young'
     452   default_email           = 'ygk@qwest.net'
     453   default_OKtoListEmail   = 'yes'
     454   entry = ''
     455   do until (entry = 'Y' | entry = '0d'x)
     456      say;say
     457      say 'You will now be prompted for potentially variable fields within' HobbesTxtFilename
     458      say
     459      say 'A default value will be given for most fields.'
     460      say 'To accept the default just press the Enter key.'
     461      say
     462      call charout , 'Name of the relaser (default:' default_name '): '
     463      entry = strip(linein())
     464      if entry = '' then
     465         name = default_name
     466      else
     467         name = entry
     468      say;say
     469      call charout , 'Email address of the relaser (default:' default_email '): '
     470      entry = strip(linein())
     471      if entry = '' then
     472         email = default_email
     473      else
     474         email = entry
     475      say;say
     476      call charout , 'OK to list email address of the relaser (default:' default_OKtoListEmail '): '
     477      entry = strip(linein())
     478      if entry = '' then
     479         OKtoListEmail = default_OKtoListEmail
     480      else
     481         if translate(left(entry, 1)) = translate(left(default_OKtoListEmail, 1)) then
     482            OKtoListEmail = default_OKtoListEmail
     483         else
     484            if left(default_OKtoListEmail, 1) = 'y' then
     485               OKtoListEmail = 'no'
     486            else
     487               OKtoListEmail = 'yes'
     488      say;say
     489      replaced_ver = WPI_Ver(GetVer('version to be replaced'))
     490      replaced_ver_wpi = 'fm2-' || replaced_ver || '.wpi'
     491      say;say
     492      say 'Data entered:'
     493      say '  Name of releaser  :' name
     494      say '  Email of releaser :' email
     495      say '  OK to list email  :' OKtoListEmail
     496      say '  WPI to be replaced:' replaced_ver_wpi
     497      say;say
     498      call charout , 'OK to proceed with file write? (Y/n) '
     499      entry = translate(SysGetKey())
     500      say;say 'Hex(key):' c2x(entry)
     501   end
     502
     503   rm1 = 73
     504   rm2 = 25
    505505   call lineout HobbesTxtFilename, right('Upload Information Template for Hobbes.nmsu.edu', rm1)
    506506   call lineout HobbesTxtFilename, right(copies('=', length('Upload Information Template for Hobbes.nmsu.edu')), rm1)
     
    562562
    563563CommitIfOK: procedure
    564         parse arg filelist
     564   parse arg filelist
    565565   svn_cmd = 'svn commit'
    566566   say;say;say
  • trunk/dll/copyright.c

    r1287 r1289  
    66 * Change Log:
    77 *    21 Nov 08 JBS Initial addition to SVN repository
     8 *    21 Nov 08 JBS Added use of copyright.h
    89 *
    910 */
    10 static char szCopyRight[] = "Copyright (c) 1993, 1998 M. Kimes, " \
    11                      "Copyright (c) 2001, 2008 Steven Levine and Associates, Inc." \
    12                      "All rights reserved";
    1311
     12#include "copyright.h"
     13static char szCopyRight[] = COPYRIGHT_STRING;
     14
  • trunk/dll/fm3res.dlg

    r1140 r1289  
    3737  31 Jul 08 JBS Added a missing mnemonic and replaced "Mommy make it stop!" with useful text.
    3838  01 Sep 08 GKY Change User-defined BMP text to better match what it actually does.
     39  21 Nov 08 JBS Ticket 297: Added use of COPYRIGHT_YEAR in About dialog
    3940
    4041***********************************************************************/
     
    4243DLGINCLUDE 1 fm3dlg.h
    4344DLGINCLUDE 2 fm3dll2.h
     45DLGINCLUDE 3 copyright.h
    4446
    4547DLGTEMPLATE MSK_FRAME LOADONCALL MOVEABLE DISCARDABLE
     
    10431045        CTEXT           "All rights reserved", -1, 10, 88, 164, 8,
    10441046                        DT_VCENTER | NOT WS_GROUP
    1045         CTEXT           "Copyright ž 1998, 2007", -1, 10, 80, 164, 8,
     1047        CTEXT           "Copyright ž 1998, " COPYRIGHT_YEAR, -1, 10, 80, 164, 8,
    10461048                        DT_VCENTER | NOT WS_GROUP
    10471049        CTEXT           "Steven Levine and Associates, Inc.", -1, 10, 72,
  • trunk/dll/fm3res.rc

    r1287 r1289  
    3838  20 Jul 08 GKY Add save/append filename to clipboard.
    3939                Change menu wording to make these easier to find
     40  21 Nov 08 JBS Ticket 297: Added STRINGTABLE with COPYRIGHT_STRING
    4041
    4142***********************************************************************/
     
    4546#include "fm3dll2.h"
    4647#include "fm3dlg.h"
    47 
    48 #define IDS_COPYRIGHT 1
     48#include "copyright.h"
    4949
    5050ICON        MAIN_FRAME          ..\icons\FM3.ICO
     
    23402340STRINGTABLE
    23412341  BEGIN
    2342     IDS_COPYRIGHT, "Copyright (c) 1993, 1998 M. Kimes, " \
    2343                      "Copyright (c) 2001, 2008 Steven Levine and Associates, Inc." \
    2344                      "All rights reserved";
     2342    IDS_COPYRIGHT, COPYRIGHT_STRING;
    23452343  END
    23462344
  • trunk/dll/makefile

    r1288 r1289  
    4444# 18 Nov 08 JBS Ticket 297: Various build improvements/corrections
    4545# 19 Nov 08 JBS Ticket 297: Removed bldlevel calls
     46# 21 Nov 08 JBS Ticket 297: Added support for copyright.c and copyright.h
    4647
    4748# Environment:
     
    224225  @%append $^@ library os2386.lib
    225226
    226 copyright.obj: copyright.c
     227copyright.obj: copyright.c copyright.h
    227228  $(CC) $(COPYRIGHT_CFLAGS) copyright.c
    228229
     
    260261  $(CC) $(CFLAGSR) $(BASERES).c
    261262
    262 $(BASERES).res: *.rc *.dlg fm3dll2.h fm3dlg.h $(ICONS)
     263$(BASERES).res: *.rc *.dlg fm3dll2.h fm3dlg.h copyright.h $(ICONS)
    263264  @echo.
    264265  @echo Compiling resource: $*
Note: See TracChangeset for help on using the changeset viewer.