diff options
-rw-r--r-- | vms/ChangeLog | 36 | ||||
-rw-r--r-- | vms/backup_gawk_src.com | 113 | ||||
-rw-r--r-- | vms/build_gawk_pcsi_desc.com | 428 | ||||
-rw-r--r-- | vms/build_gawk_pcsi_text.com | 179 | ||||
-rw-r--r-- | vms/build_gawk_release_notes.com | 67 | ||||
-rw-r--r-- | vms/compare_gawk_source.com | 367 | ||||
-rw-r--r-- | vms/config_h.com | 35 | ||||
-rw-r--r-- | vms/descrip.mms | 17 | ||||
-rw-r--r-- | vms/gawk_alias_setup.com | 110 | ||||
-rw-r--r-- | vms/gawk_build_steps.txt | 220 | ||||
-rw-r--r-- | vms/gawk_release_note_start.txt | 189 | ||||
-rw-r--r-- | vms/gawk_verb.com | 26 | ||||
-rw-r--r-- | vms/gawkmisc.vms | 3 | ||||
-rw-r--r-- | vms/gnv_gawk_startup.com | 75 | ||||
-rw-r--r-- | vms/make_pcsi_gawk_kit_name.com | 189 | ||||
-rw-r--r-- | vms/pcsi_gawk_file_list.txt | 120 | ||||
-rw-r--r-- | vms/pcsi_product_gawk.com | 187 | ||||
-rw-r--r-- | vms/remove_old_gawk.com | 113 | ||||
-rw-r--r-- | vms/stage_gawk_install.com | 300 | ||||
-rw-r--r-- | vms/vms_args.c | 2 | ||||
-rw-r--r-- | vms/vms_cli.c | 2 | ||||
-rw-r--r-- | vms/vms_fwrite.c | 2 | ||||
-rw-r--r-- | vms/vms_gawk.c | 3 | ||||
-rw-r--r-- | vms/vms_misc.c | 2 | ||||
-rw-r--r-- | vms/vms_popen.c | 3 | ||||
-rw-r--r-- | vms/vmstest.com | 27 |
26 files changed, 2787 insertions, 28 deletions
diff --git a/vms/ChangeLog b/vms/ChangeLog index ba017d64..0db7efd2 100644 --- a/vms/ChangeLog +++ b/vms/ChangeLog @@ -1,3 +1,39 @@ +2014-01-03 John E. Malmberg <wb8tyw@qsl.net> + + * config_h.com, generate_config_vms_h_gawk.com, + vms_args.c, vms_cli.c, vms_fwrite.c, vms_gawk.c, vms_misc.c, + vms_popen.c: Update copyright to 2014. + * descrip.mms: Improve spotless cleanup. + * vmstest.com: Improve test cleanup. + * backup_gawk_src.com: New file. Create backup savesets for gawk source. + * build_gawk_pcsi_desc.com: New file. Create a pcsi$desc manifest + file for building a gawk package. + * build_gawk_pcsi_text.com: New file. Create a pcsi$text file for + building a gawk package. + * build_gawk_release_notes.com: New file. Create a VMS release notes + file based on the gawk README and COPYING files and the release note + start and build instruction files. + * compare_gawk_source.com: New file. Helper file to compare and + optionally update two gawk source directories. Used to copy + source from an NFS volume to a VMS native volume for backup. + * gawk_alias_setup.com: New file. Used at installation time to + create hard links for for some files instead of copies. + * gawk_build_steps.txt: New file. Document how to build a PCSI kit. + * gawk_release_note_start.txt: New file. Start of release notes. + * gawk_verb.com: New file. Converts the gawk.cld file into a + gawk_verb.cld file for setting up GAWK as a DCL command. + * gnv_gawk_startup.com: New file. Makes sure that the GNV$GNU logical + name need to easily find the gawk image is defined. + * make_pcsi_gawk_kit_name.com: New File. Create the PCSI kit name + based on the GAWK version. + * pcsi_gawk_file_list.txt: New File. Input file for creating the + pcsi$desc manifest file. + * pcsi_product_gawk.com: New file. File to create the PCSI kit. + * remove_old_gawk.com: New file. File to remove obsolete GNV gawk + files replaced by the new PCSI kit. + * stage_gawk_install.com: New file. Stages an install for the + pcsi kit building. + 2013-12-29 John E. Malmberg <wb8tyw@qsl.net> * gawk_plugin.opt: New file. Needed to build plugins on IA64 diff --git a/vms/backup_gawk_src.com b/vms/backup_gawk_src.com new file mode 100644 index 00000000..d1e47fbe --- /dev/null +++ b/vms/backup_gawk_src.com @@ -0,0 +1,113 @@ +$! File: Backup_gawk_src.com +$! +$! Procedure to create backup save sets for installing in a PCSI kit. +$! +$! To comply with most Open Source licenses, the source used for building +$! a kit will be packaged with the distribution kit for the binary. +$! +$! Backup save sets are the only storage format that I can expect a +$! VMS system to be able to extract ODS-5 filenames and directories. +$! +$! The make_pcsi_kit_name.com needs to be run before this procedure to +$! properly name the files that will be created. +$! +$! This file is created from a template file for the purpose of making it +$! easier to port Unix code, particularly open source code to VMS. +$! Therefore permission is freely granted for any use. +$! +$! 13-Jun-2009 J. Malmberg +$! +$!=========================================================================== +$! +$! Save default +$ default_dir = f$environment("DEFAULT") +$! +$ arch_type = f$getsyi("ARCH_NAME") +$ arch_code = f$extract(0, 1, arch_type) +$! +$ if arch_code .nes. "V" +$ then +$ set proc/parse=extended +$ endif +$! +$ ss_abort = 44 +$ status = ss_abort +$! +$ kit_name = f$trnlnm("GNV_PCSI_KITNAME") +$ if kit_name .eqs. "" +$ then +$ write sys$output "@MAKE_PCSI_GAWK_KIT_NAME.COM has not been run." +$ goto all_exit +$ endif +$ producer = f$trnlnm("GNV_PCSI_PRODUCER") +$ if producer .eqs. "" +$ then +$ write sys$output "@MAKE_PCSI_GAWK_KIT_NAME.COM has not been run." +$ goto all_exit +$ endif +$ filename_base = f$trnlnm("GNV_PCSI_FILENAME_BASE") +$ if filename_base .eqs. "" +$ then +$ write sys$output "@MAKE_PCSI_GAWK_KIT_NAME.COM has not been run." +$ goto all_exit +$ endif +$! +$ node_swvers = f$getsyi("NODE_SWVERS") +$ node_swvers_type = f$extract(0, 1, node_swvers) +$ node_swvers_vers = f$extract(1, f$length(node_swvers), node_swvers) +$ swvers_maj = f$element(0, ".", node_swvers_vers) +$ node_swvers_min_update = f$element(1, ".", node_swvers_vers) +$ swvers_min = f$element(0, "-", node_swvers_min_update) +$ swvers_update = f$element(1, "-", node_swvers_min_update) +$! +$ if swvers_update .eqs. "-" then swvers_update = "" +$! +$ vms_vers = f$fao("!2ZB!2ZB!AS", 'swvers_maj', 'swvers_min', swvers_update) +$! +$! +$! +$! If available make an interchange save set +$!------------------------------------------- +$ interchange = "" +$ if arch_code .eqs. "V" +$ then +$ interchange = "/interchange" +$ endif +$ if (swvers_maj .ges. "8") .and. (swvers_min .ges. 4) +$ then +$ interchange = "/interchange/noconvert" +$ endif +$! +$! +$! Put things back on error. +$ on warning then goto all_exit +$! +$ current_default = f$environment("DEFAULT") +$ my_dir = f$parse(current_default,,,"DIRECTORY") - "[" - "<" - ">" - "]" +$! +$ src_root = "src_root:" +$ if f$trnlnm("src_root1") .nes. "" then src_root = "src_root1:" +$ backup'interchange' 'src_root'[gawk...]*.*;0 - + 'filename_base'_original_src.bck/sav +$ status = $status +$! +$! There may be a VMS specific source kit +$!----------------------------------------- +$ vms_root = "vms_root:" +$ if f$trnlnm("vms_root1") .nes. "" then vms_root = "vms_root1:" +$ files_found = 0 +$ define/user sys$error nl: +$ define/user sys$output nl: +$ directory 'vms_root'[...]*.*;*/exc=*.dir +$ if '$severity' .eq. 1 then files_found = 1 +$! +$ if files_found .eq. 1 +$ then +$ backup'interchange' 'vms_root'[gawk...]*.*;0 - + 'filename_base'_vms_src.bck/sav +$ status = $status +$ endif +$! +$all_exit: +$ set def 'default_dir' +$ exit diff --git a/vms/build_gawk_pcsi_desc.com b/vms/build_gawk_pcsi_desc.com new file mode 100644 index 00000000..63d149e6 --- /dev/null +++ b/vms/build_gawk_pcsi_desc.com @@ -0,0 +1,428 @@ +$! File: Build_GAWK_PCSI_DESC.COM +$! +$! Build the *.pcsi$text file in the following sections: +$! Required software dependencies. +$! install/upgrade/postinstall steps. +$! 1. Duplicate filenames need an alias procedure. +$! 2. ODS-5 filenames need an alias procedure. +$! 3. Special alias links for executables (cp. -> gnv$cp.exe) +$! if a lot, then an alias procedure is needed. +$! 4. Rename the files to lowercase. +$! Move Release Notes to destination +$! Source kit option +$! Create directory lines +$! Add file lines for gawk. +$! Add Link alias procedure file (used for gawk) +$! Add [.SYS$STARTUP]gawk_startup file +$! Add Release notes file. +$! +$! The file PCSI_GAWK_FILE_LIST.TXT is read in to get the files other +$! than the release notes file and the source backup file. +$! +$! The PCSI system can really only handle ODS-2 format filenames and +$! assumes that there is only one source directory. It also assumes that +$! all destination files with the same name come from the same source file. +$! Fortunately GAWK does not trip most of these issues, so those steps +$! above are marked N/A. +$! +$! A rename action section is needed to make sure that the files are +$! created in the GNV$GNU: in the correct case, and to create the alias +$! link [usr.bin]gawk. for [usr.bin]gawk.exe. +$! +$! 02-Jan-2014 J. Malmberg - Gawk version +$! +$!=========================================================================== +$! +$ kit_name = f$trnlnm("GNV_PCSI_KITNAME") +$ if kit_name .eqs. "" +$ then +$ write sys$output "@[.vms]MAKE_PCSI_GAWK_KIT_NAME.COM has not been run." +$ goto all_exit +$ endif +$ producer = f$trnlnm("GNV_PCSI_PRODUCER") +$ if producer .eqs. "" +$ then +$ write sys$output "@[.vms]MAKE_PCSI_GAWK_KIT_NAME.COM has not been run." +$ goto all_exit +$ endif +$ filename_base = f$trnlnm("GNV_PCSI_FILENAME_BASE") +$ if filename_base .eqs. "" +$ then +$ write sys$output "@[.vms]MAKE_PCSI_GAWK_KIT_NAME.COM has not been run." +$ goto all_exit +$ endif +$! +$! +$! Parse the kit name into components. +$!--------------------------------------- +$ producer = f$element(0, "-", kit_name) +$ base = f$element(1, "-", kit_name) +$ product = f$element(2, "-", kit_name) +$ mmversion = f$element(3, "-", kit_name) +$ majorver = f$extract(0, 3, mmversion) +$ minorver = f$extract(3, 2, mmversion) +$ updatepatch = f$element(4, "-", kit_name) +$ if updatepatch .eqs. "-" then updatepatch = "" +$! +$! kit type of "D" means a daily build +$ kit_type = f$edit(f$extract(0, 1, majorver), "upcase") +$! +$! +$ product_line = "product ''producer' ''base' ''product'" +$ if updatepatch .eqs. "" +$ then +$ product_name = " ''majorver'.''minorver'" +$ else +$ product_name = " ''majorver'.''minorver'-''updatepatch'" +$ endif +$ product_line = product_line + " ''product_name' full;" +$!write sys$output product_line +$! +$! +$! +$! Create the file as a VMS text file. +$!---------------------------------------- +$ base_file = kit_name +$ create 'base_file'.pcsi$desc +$! +$! +$! Start building file. +$!---------------------- +$ open/append pdsc 'base_file'.pcsi$desc +$! +$ write pdsc product_line +$! +$! Required product dependencies. +$!---------------------------------- +$ vmsprd = "DEC" +$ if base .eqs. "I64VMS" then vmsprd = "HP" +$! +$ write pdsc " software ''vmsprd' ''base' VMS ;" +$ arch_type = f$getsyi("ARCH_NAME") +$ node_swvers = f$getsyi("node_swvers") +$ vernum = f$extract(1, f$length(node_swvers), node_swvers) +$ majver = f$element(0, ".", vernum) +$ minverdash = f$element(1, ".", vernum) +$ minver = f$element(0, "-", minverdash) +$ dashver = f$element(1, "-", minverdash) +$ if dashver .eqs. "-" then dashver = "" +$ vmstag = majver + minver + dashver +$ code = f$extract(0, 1, arch_type) +$ arch_code = f$extract(0, 1, arch_type) +$ write pdsc - + " if (not <software ''vmsprd' ''base' VMS version minimum ''node_swvers'>) ;" +$ write pdsc " error NEED_VMS''vmstag';" +$ write pdsc " end if;" +$! +$! +$! +$! install/upgrade/postinstall steps. +$!----------------------------------- +$! 1. Duplicate filenames need an alias procedure. +$! 2. ODS-5 filenames need an alias procedure. +$! 3. Special alias links for executables (gawk. -> gnv$gawk.exe) +$! if a lot, then an alias procedure is needed. +$! 4. Rename the files to lowercase. +$! +$! +$! Alias links needed. +$!------------------------- +$ add_alias_lines = "" +$ rem_alias_lines = "" +$ line_out = "" +$! +$! Read through the file list to set up aliases and rename commands. +$!--------------------------------------------------------------------- +$ open/read flst [.vms]pcsi_gawk_file_list.txt +$! +$inst_alias_loop: +$ read/end=inst_alias_loop_end flst line_in +$ line_in = f$edit(line_in,"compress,trim,uncomment") +$ if line_in .eqs. "" then goto inst_alias_loop +$ pathname = f$element(0, " ", line_in) +$ linkflag = f$element(1, " ", line_in) + +$ if linkflag .nes. "->" then goto inst_alias_write +$! +$ linktarget = f$element(2, " ", line_in) +$ nlink = "pcsi$destination:" + pathname +$ ntarg = "pcsi$destination:" + linktarget +$ new_add_alias_line = - + """if f$search(""""''nlink'"""") .eqs. """""""" then" + - + " set file/enter=''nlink' ''ntarg'""" +$ if add_alias_lines .nes. "" +$ then +$ add_alias_lines = add_alias_lines + "," + new_add_alias_line +$ else +$ add_alias_lines = new_add_alias_line +$ endif +$! +$ new_rem_alias_line = - + """if f$search(""""''nlink'"""") .nes. """""""" then" + - + " set file/remove ''nlink';""" +$ if rem_alias_lines .nes. "" +$ then +$ rem_alias_lines = rem_alias_lines + "," + new_rem_alias_line +$ else +$ rem_alias_lines = new_rem_alias_line +$ endif +$! +$ goto inst_alias_loop +$! +$inst_alias_write: +$! +$! execute install / remove +$ write pdsc " execute install (" +$! add aliases +$ i = 0 +$ex_ins_loop: +$ line = f$element(i, ",", add_alias_lines) +$ i = i + 1 +$ if line .eqs. "" then goto ex_ins_loop +$ if line .eqs. "," then goto ex_ins_loop_end +$ if line_out .nes. "" then write pdsc line_out,"," +$ line_out = line +$ goto ex_ins_loop +$ex_ins_loop_end: +$ if line_out .eqs. "" then line_out = " ""continue""" +$ write pdsc line_out +$ line_out = "" +$ write pdsc " )" +$ write pdsc " remove (" +$! remove aliases +$ line_out = - + " ""@pcsi$destination:[gnv.vms_bin]gawk_alias_setup.com remove""" +$ i = 0 +$ex_rem_loop: +$ line = f$element(i, ",", rem_alias_lines) +$ i = i + 1 +$ if line .eqs. "" then goto ex_rem_loop +$ if line .eqs. "," then goto ex_rem_loop_end +$ if line_out .nes. "" then write pdsc line_out,"," +$ line_out = line +$ goto ex_rem_loop +$ex_rem_loop_end: +$ if line_out .eqs. "" then line_out = " ""continue""" +$ write pdsc line_out +$ line_out = "" +$ write pdsc " ) ;" +$! +$! execute upgrade +$ write pdsc " execute upgrade (" +$ line_out = - + " ""@pcsi$destination:[gnv.vms_bin]gawk_alias_setup.com remove""" +$ i = 0 +$ex_upg_loop: +$ line = f$element(i, ",", rem_alias_lines) +$ i = i + 1 +$ if line .eqs. "" then goto ex_upg_loop +$ if line .eqs. "," then goto ex_upg_loop_end +$ if line_out .nes. "" then write pdsc line_out,"," +$ line_out = line +$ goto ex_upg_loop +$ex_upg_loop_end: +$ if line_out .eqs. "" then line_out = " ""continue""" +$ write pdsc line_out +$ line_out = "" +$! remove aliases +$ write pdsc " ) ;" +$! +$! execute postinstall +$ write pdsc " execute postinstall (" +$ if arch_code .nes. "V" +$ then +$ line_out = " ""set process/parse=extended""," +$ write pdsc line_out +$ endif +$ line_out = " ""@pcsi$destination:[gnv.vms_bin]remove_old_gawk.com""," +$ write pdsc line_out +$ line_out = " ""@pcsi$destination:[gnv.vms_bin]gawk_alias_setup.com""" +$ i = 0 +$ex_pins_loop: +$ line = f$element(i, ",", add_alias_lines) +$ i = i + 1 +$ if line .eqs. "" then goto ex_pins_loop +$ if line .eqs. "," then goto ex_pins_loop_end +$ if line_out .nes. "" then write pdsc line_out,"," +$ line_out = line +$ goto ex_pins_loop +$ex_pins_loop_end: +$ if line_out .eqs. "" then line_out = " ""continue""" +$! write pdsc line_out +$! line_out = "" +$! add aliases and follow with renames. +$! +$goto inst_dir +$! +$inst_dir_loop: +$ read/end=inst_alias_loop_end flst line_in +$ line_in = f$edit(line_in,"compress,trim,uncomment") +$ if line_in .eqs. "" then goto inst_dir_loop +$inst_dir: +$ pathname = f$element(0, " ", line_in) +$! +$! Ignore the directory entries for now. +$!----------------------------------------- +$ filedir = f$parse(pathname,,,"DIRECTORY") +$ if pathname .eqs. filedir then goto inst_dir_loop +$! +$! process .dir extensions for rename +$! If this is not a directory then start processing files. +$!------------------------- +$ filetype = f$parse(pathname,,,"TYPE") +$ filetype_u = f$edit(filetype, "upcase") +$ filename = f$parse(pathname,,,"NAME") +$ if filetype_u .nes. ".DIR" then goto inst_file +$! +$! process directory lines for rename. +$!-------------------------------------- +$ if line_out .nes. "" +$ then +$ write pdsc line_out,"," +$ line_out = "" +$ endif +$ if arch_code .nes. "V" +$ then +$ if line_out .nes. "" then write pdsc line_out,"," +$ line_out = " ""rename pcsi$destination:''pathname' ''filename'.DIR""" +$ else +$ if line_out .nes. "" then write pdsc line_out +$ line_out = "" +$ endif +$ goto inst_dir_loop +$! +$! +$! process file lines for rename +$!--------------------------------- +$inst_file_loop: +$ read/end=inst_alias_loop_end flst line_in +$ line_in = f$edit(line_in,"compress,trim,uncomment") +$ if line_in .eqs. "" then goto inst_dir_loop +$ pathname = f$element(0, " ", line_in) +$! +$! Filenames with $ in them are VMS special and do not need to be lowercased. +$! -------------------------------------------------------------------------- +$ if f$locate("$", pathname) .lt. f$length(pathname) then goto inst_file_loop +$! +$ filetype = f$parse(pathname,,,"TYPE") +$ filename = f$parse(pathname,,,"NAME") + filetype +$inst_file: +$ if arch_code .nes. "V" +$ then +$ if line_out .nes. "" then write pdsc line_out,"," +$ filetype = f$parse(pathname,,,"TYPE") +$ filename = f$parse(pathname,,,"NAME") + filetype +$ line_out = " ""rename pcsi$destination:''pathname' ''filename'""" +$ else +$ if line_out .nes. "" then write pdsc line_out +$ line_out = "" +$ endif +$ goto inst_file_loop +$! +$inst_alias_loop_end: +$! +$write pdsc line_out +$write pdsc " ) ;" +$close flst +$! +$! Move Release Notes to destination +$!------------------------------------- +$write pdsc " information RELEASE_NOTES phase after ;" +$! +$! Source kit option +$!--------------------- +$write pdsc " option SOURCE default 0;" +$write pdsc " directory ""[gnv.common_src]"" PROTECTION PUBLIC ;" +$write pdsc - + " file ""[gnv.common_src]''filename_base'_original_src.bck""" +$write pdsc - + " source [common_src]''filename_base'_original_src.bck ;" +$if f$search("sys$disk:''filename_base'_vms_src.bck") .nes. "" +$then +$ write pdsc " directory ""[gnv.vms_src]"" PROTECTION PUBLIC ;" +$ write pdsc " file ""[gnv.vms_src]''filename_base'_vms_src.bck""" +$ write pdsc " source [vms_src]''filename_base'_vms_src.bck ;" +$endif +$write pdsc " end option;" +$! +$! +$! Read through the file list again. +$!---------------------------------- +$open/read flst [.vms]pcsi_gawk_file_list.txt +$! +$! +$! Create directory lines +$!------------------------- +$flst_dir_loop: +$ read/end=flst_loop_end flst line_in +$ line_in = f$edit(line_in,"compress,trim,uncomment") +$ if line_in .eqs. "" then goto flst_dir_loop +$! +$ filename = f$element(0, " ", line_in) +$ linkflag = f$element(1, " ", line_in) +$ if linkflag .eqs. "->" then goto flst_dir_loop +$! +$! Ignore .dir extensions +$!------------------------- +$ filetype = f$edit(f$parse(filename,,,"TYPE"), "upcase") +$ if filetype .eqs. ".DIR" then goto flst_dir_loop +$! +$ destname = filename +$! +$! It should be just a directory then. +$!------------------------------------- +$ filedir = f$edit(f$parse(filename,,,"DIRECTORY"), "lowercase") +$! If this is not a directory then start processing files. +$!--------------------------------------------------------- +$ if filename .nes. filedir then goto flst_file +$! +$ write pdsc " directory ""''destname'"" PROTECTION PUBLIC ;" +$ goto flst_dir_loop +$! +$! +$! Add file lines for gawk. +$!--------------------------- +$flst_file_loop: +$ read/end=flst_loop_end flst line_in +$ line_in = f$edit(line_in,"compress,trim,uncomment") +$ if line_in .eqs. "" then goto flst_file_loop +$ filename = f$element(0, " ", line_in) +$ destname = filename +$flst_file: +$ if arch_code .eqs. "V" +$ then +$! ! These files not available on VAX. +$ src_dir = f$parse(destname,,,"DIRECTORY") +$ if src_dir .eqs. "[GNV.USR.LIB.GAWK]" then goto flst_file_loop +$ endif +$ srcfile = filename - "gnv." +$ write pdsc " file ""''destname'"" " +$ write pdsc " source ""''srcfile'"" ;" +$ goto flst_file_loop +$! +$flst_loop_end: +$ close flst +$! +$! Add Link alias procedure file (N/A for gawk) +$!----------------------------------------------------- +$ write pdsc " file ""[vms_bin]gawk_alias_setup.com""" +$ write pdsc " source [vms_bin]gawk_alias_setup.com ;" +$! +$! Add [.SYS$STARTUP]gawk_startup file +$!--------------------------------------- +$ write pdsc " file ""[sys$startup]gnv$gawk_startup.com""" +$ write pdsc " source [vms_bin]gnv$gawk_startup.com ;" +$! +$! Add Release notes file. +$!------------------------------ +$ write pdsc - + " file ""[SYSHLP]''filename_base'.release_notes"" release notes ;" +$! +$! Close the product file +$!------------------------ +$ write pdsc "end product;" +$! +$close pdsc +$! +$all_exit: +$ exit diff --git a/vms/build_gawk_pcsi_text.com b/vms/build_gawk_pcsi_text.com new file mode 100644 index 00000000..a1053cf6 --- /dev/null +++ b/vms/build_gawk_pcsi_text.com @@ -0,0 +1,179 @@ +$! File: build_gawk_pcsi_text.com +$! +$! Build the *.pcsi$text file from the four components: +$! 1. Generated =product header section +$! 2. readme. file from the Gawk distribution, modified to fit +$! a pcsi$text file format. +$! 3. copying file from the Gawk distribution, modified to fit +$! a pcsi$text file format. +$! 4. Generated Producer section. +$! +$! Set the name of the release notes from the GNV_PCSI_FILENAME_BASE +$! +$! +$! 02-Jan-2014 J. Malmberg - Gawk version +$! +$!=========================================================================== +$! +$ kit_name = f$trnlnm("GNV_PCSI_KITNAME") +$ if kit_name .eqs. "" +$ then +$ write sys$output "@MAKE_PCSI_GAWK_KIT_NAME.COM has not been run." +$ goto all_exit +$ endif +$ producer = f$trnlnm("GNV_PCSI_PRODUCER") +$ if producer .eqs. "" +$ then +$ write sys$output "@MAKE_PCSI_GAWK_KIT_NAME.COM has not been run." +$ goto all_exit +$ endif +$ producer_full_name = f$trnlnm("GNV_PCSI_PRODUCER_FULL_NAME") +$ if producer_full_name .eqs. "" +$ then +$ write sys$output "@MAKE_PCSI_GAWK_KIT_NAME.COM has not been run." +$ goto all_exit +$ endif +$! +$! +$! Parse the kit name into components. +$!--------------------------------------- +$ producer = f$element(0, "-", kit_name) +$ base = f$element(1, "-", kit_name) +$ product = f$element(2, "-", kit_name) +$ mmversion = f$element(3, "-", kit_name) +$ majorver = f$extract(0, 3, mmversion) +$ minorver = f$extract(3, 2, mmversion) +$ updatepatch = f$element(4, "-", kit_name) +$ if updatepatch .eqs. "-" then updatepatch = "" +$! +$! +$ product_line = "=product ''producer' ''base' ''product'" +$ if updatepatch .eqs. "" +$ then +$ product_name = " ''majorver'.''minorver'" +$ else +$ product_name = " ''majorver'.''minorver'-''updatepatch'" +$ endif +$ product_line = product_line + " ''product_name' full" +$! +$! +$! If this is VAX and the file is on NFS, the names may be mangled. +$!----------------------------------------------------------------- +$ readme_file = "" +$ if f$search("readme.") .nes. "" +$ then +$ readme_file = "readme." +$ else +$ if f$search("$README.") .nes. "" +$ then +$ readme_file = "$README." +$ else +$ write sys$output "Can not find readme file." +$ goto all_exit +$ endif +$ endif +$ copying_file = "" +$ if f$search("copying.") .nes. "" +$ then +$ copying_file = "copying." +$ else +$ if f$search("$COPYING.") .nes. "" +$ then +$ copying_file = "$COPYING." +$ else +$ write sys$output "Can not find copying file." +$ goto all_exit +$ endif +$ endif +$! +$! Create the file as a VMS text file. +$!---------------------------------------- +$ base_file = kit_name +$ create 'base_file'.pcsi$text +$! +$! +$! Start building file. +$!---------------------- +$ open/append ptxt 'base_file'.pcsi$text +$ write ptxt product_line +$! +$! +$! First insert the Readme file. +$! +$ open/read rf 'readme_file' +$! +$ write ptxt "1 'PRODUCT" +$ write ptxt "=prompt ''producter' ''product' for OpenVMS" +$! +$rf_loop: +$ read/end=rf_loop_end rf line_in +$ if line_in .nes. "" +$ then +$! PCSI files use the first character in for their purposes. +$!-------------------------------------------------------------- +$ first_char = f$extract(0, 1, line_in) +$ if first_char .nes. " " then line_in = " " + line_in +$ endif +$ write ptxt line_in +$ goto rf_loop +$rf_loop_end: +$ close rf +$! +$! +$! Now add in the copying file +$!-------------------------------- +$ write ptxt "" +$ write ptxt "1 'NOTICE" +$ write ptxt "" +$! +$ open/read cf 'copying_file' +$! +$cf_loop: +$ read/end=cf_loop_end cf line_in +$ if line_in .nes. "" +$ then +$! PCSI files use the first character in for their purposes. +$!-------------------------------------------------------------- +$ first_char = f$extract(0, 1, line_in) +$ if first_char .nes. " " then line_in = " " + line_in +$ endif +$ write ptxt line_in +$ goto cf_loop +$cf_loop_end: +$ close cf +$! +$! Now we need the rest of the boiler plate. +$!-------------------------------------------- +$ write ptxt "" +$ write ptxt "1 'PRODUCER" +$ write ptxt "=prompt ''producer_full_name'" +$ write ptxt - + "This software product is provided by ''producer_full_name' with no warranty." +$! +$ arch_type = f$getsyi("ARCH_NAME") +$ node_swvers = f$getsyi("node_swvers") +$ vernum = f$extract(1, f$length(node_swvers), node_swvers) +$ majver = f$element(0, ".", vernum) +$ minverdash = f$element(1, ".", vernum) +$ minver = f$element(0, "-", minverdash) +$ dashver = f$element(1, "-", minverdash) +$ if dashver .eqs. "-" then dashver = "" +$ vmstag = majver + minver + dashver +$ code = f$extract(0, 1, arch_type) +$! +$ write ptxt "1 NEED_VMS''vmstag'" +$ write ptxt - + "=prompt OpenVMS ''vernum' or later is not installed on your system." +$ write ptxt "This product requires OpenVMS ''vernum' or later to function." +$ write ptxt "1 SOURCE" +$ write ptxt "=prompt Source modules for ''product'" +$ write ptxt "The Source modules for ''product' will be installed." +$ write ptxt "1 RELEASE_NOTES" +$ write ptxt "=prompt Release notes are available in the [SYSHLP] directory." +$! +$ close ptxt +$! +$! +$! +$all_exit: +$ exit diff --git a/vms/build_gawk_release_notes.com b/vms/build_gawk_release_notes.com new file mode 100644 index 00000000..c088ff8c --- /dev/null +++ b/vms/build_gawk_release_notes.com @@ -0,0 +1,67 @@ +$! File: Build_gawk_release_notes.com +$! +$! Build the release note file from the three components: +$! 1. The gawk_release_note_start.txt +$! 2. readme. file from the Gawk distribution. +$! 3. The gawk_build_steps.txt. +$! +$! Set the name of the release notes from the GNV_PCSI_FILENAME_BASE +$! logical name. +$! +$! +$! 31-Dec-2013 J. Malmberg +$! +$!=========================================================================== +$! +$ base_file = f$trnlnm("GNV_PCSI_FILENAME_BASE") +$ if base_file .eqs. "" +$ then +$ write sys$output "@MAKE_PCSI_GAWK_KIT_NAME.COM has not been run." +$ goto all_exit +$ endif +$! +$ gawk_vms_readme = f$search("sys$disk:[.readme_d]readme.vms") +$ if gawk_vms_readme .eqs. "" +$ then +$ gawk_vms_readme = f$search("sys$disk:[.$README_$D]$README.VMS") +$ endif +$ if gawk_vms_readme .eqs. "" +$ then +$ write sys$output "Can not find gawk README.VMS file." +$ goto all_exit +$ endif +$! +$ gawk_readme = f$search("sys$disk:[]readme.") +$ if gawk_readme .eqs. "" +$ then +$ gawk_readme = f$search("sys$disk:[]$README.") +$ endif +$ if gawk_readme .eqs. "" +$ then +$ write sys$output "Can not find gawk readme file." +$ goto all_exit +$ endif +$! +$ gawk_copying = f$search("sys$disk:[]copying.") +$ if gawk_copying .eqs. "" +$ then +$ gawk_copying = f$search("sys$disk:[]$COPYING.") +$ endif +$ if gawk_copying .eqs. "" +$ then +$ write sys$output "Can not find gawk copying file." +$ goto all_exit +$ endif +$! +$ type/noheader sys$disk:[.vms]gawk_release_note_start.txt,- + 'gawk_readme',- + 'gawk_vms_readme',- + 'gawk_copying', - + sys$disk:[.vms]gawk_build_steps.txt - + /out='base_file'.release_notes +$! +$ purge 'base_file'.release_notes +$ rename 'base_file.release_notes ;1 +$! +$all_exit: +$ exit diff --git a/vms/compare_gawk_source.com b/vms/compare_gawk_source.com new file mode 100644 index 00000000..260ec4eb --- /dev/null +++ b/vms/compare_gawk_source.com @@ -0,0 +1,367 @@ +$! Compare_gawk_source.com +$! +$! This procedure compares the files in two directories and reports the +$! differences. +$! +$! It needs to be customized to the local site directories. +$! +$! This is used by me for these purposes: +$! 1. Compare the original source of a project with an existing +$! VMS port. +$! 2. Compare the checked out repository of a project with the +$! the local working copy to make sure they are in sync. +$! 3. Keep a copy directory up to date. The third is needed by +$! me because VMS Backup can create a saveset of files from a +$! NFS mounted volume. +$! +$! First the files in the original source directory which is assumed to be +$! under source codde control are compared with the copy directory. +$! +$! Then the files are are only in the copy directory are listed. +$! +$! The result will five diagnostics about of files: +$! 1. Files that are not generation 1. +$! 2. Files missing in the copy directory. +$! 3. Files in the copy directory not in the source directory. +$! 4. Files different from the source directory. +$! 5. Files that VMS DIFF can not process. +$! +$! This needs to be run on an ODS-5 volume. +$! +$! If UPDATE is given as a second parameter, files missing or different in the +$! copy directory will be updated. +$! +$! By default: +$! The source directory is source_root:[gawk.reference.gawk], +$! the logical used on my system for the GNV Mecurial repository checkout. +$! If source_root: is not defined, then src_root:[gawk] will be +$! translated to something like DISK:[dir.gawk.reference.gawk] +$! and then DISK:[dir.gawk.vms_source.gawk] will be used. +$! +$! The copy directory is vms_root:[gawk] +$! The UPDATE parameter is ignored. +$! +$! This setting is used to make sure that the working vms directory +$! and the VMS specific repository checkout directory have the same +$! contents if they are different. +$! +$! If P1 is "SRCBCK" then this +$! The source directory tree is: src_root:[gawk] +$! The copy directory is src_root1:[gawk] +$! +$! src_root1:[gawk] is used by me to work around that VMS backup will +$! not use NFS as a source directory so I need to make a copy. +$! +$! This is to make sure that the backup save set for the unmodified +$! source is up to date. +$! +$! If your repository checkout is not on an NFS mounted volume, you do not +$! need to use this option or have the logical name src_root1 defined. +$! +$! If P1 is "VMSBCK" then this changes the two directories: +$! The source directory is vms_root:[gawk] +$! The copy directory is vms_root1:[gawk] +$! +$! vms_root: +$! src_root1:[gawk] is used by me to work around that VMS backup will +$! not use NFS as a source directory so I need to make a copy. +$! +$! This is to make sure that the backup save set for the unmodified +$! source is up to date. +$! +$! If your repository checkout is not on an NFS mounted volume, you do not +$! need to use this option or have the logical name src_root1 defined. +$! +$! 02-Jan-2014 J. Malmberg +$!========================================================================== +$! +$! Update missing/changed files. +$update_file = 0 +$if (p2 .eqs. "UPDATE") +$then +$ update_file = 1 +$endif +$! +$myproc = f$environment("PROCEDURE") +$myprocdir = f$parse(myproc,,,"DIRECTORY") - "[" - "]" - "<" - ">" +$myprocdir = f$edit(myprocdir, "LOWERCASE") +$mydefault = f$environment("DEFAULT") +$mydir = f$parse(mydefault,,,"DIRECTORY") +$mydir = f$edit(mydir, "LOWERCASE") +$odelim = f$extract(0, 1, mydir) +$mydir = mydir - "[" - "]" - "<" - ">" +$mydev = f$parse(mydefault,,,"DEVICE") +$! +$ref = "" +$if P1 .eqs. "" +$then +$ ref_base_dir = myprocdir - ".vms" +$ wrk_base_dir = mydir +$ update_file = 0 +$ resultd = f$parse("src_root:",,,,"NO_CONCEAL") +$ resultd = f$edit(resultd, "LOWERCASE") +$ resultd = resultd - "][" - "><" - ".;" - ".." +$ resultd_len = f$length(resultd) - 1 +$ delim = f$extract(resultd_len, 1, resultd) +$ ref_root_base = mydir + delim +$ if f$locate(".reference.", resultd) .lt. resultd_len +$ then +$ resultd = resultd - ref_root_base - "reference." + "vms_source." +$ else +$ resultd = resultd - ref_root_base - "gnu." + "gnu_vms." +$ endif +$ ref = resultd + ref_base_dir +$ wrk = "VMS_ROOT:" + odelim + wrk_base_dir +$ resultd_len = f$length(resultd) - 1 +$ resultd = f$extract(0, resultd_len, resultd) + delim +$ ref_root_dir = f$parse(resultd,,,"DIRECTORY") +$ ref_root_dir = f$edit(ref_root_dir, "LOWERCASE") +$ ref_root_dir = ref_root_dir - "[" - "]" +$ ref_base_dir = ref_root_dir + "." + ref_base_dir +$endif +$! +$if p1 .eqs. "SRCBCK" +$then +$ ref_base_dir = "gawk" +$ wrk_base_dir = "gawk" +$ ref = "src_root:[" + ref_base_dir +$ wrk = "src_root1:[" + wrk_base_dir +$ if update_file +$ then +$ if f$search("src_root1:[000000]gawk.dir") .eqs. "" +$ then +$ create/dir/prot=o:rwed src_root1:[gawk] +$ endif +$ endif +$endif +$! +$! +$if p1 .eqs. "VMSBCK" +$then +$ ref_base_dir = "gawk" +$ wrk_base_dir = "gawk" +$ ref = "vms_root:[" + ref_base_dir +$ wrk = "vms_root1:[" + wrk_base_dir +$ if update_file +$ then +$ if f$search("vms_root1:[000000]gawk.dir") .eqs. "" +$ then +$ create/dir/prot=o:rwed vms_root1:[gawk] +$ endif +$ endif +$endif +$! +$! +$if ref .eqs. "" +$then +$ write sys$output "Unknown compare type specified!" +$ exit 44 +$endif +$! +$! +$! +$! Future - check the device types involved for the +$! the syntax to check. +$ODS2_SYNTAX = 0 +$NFS_MANGLE = 0 +$PWRK_MANGLE = 0 +$! +$vax = f$getsyi("HW_MODEL") .lt. 1024 +$if vax +$then +$ ODS2_SYNTAX = 1 +$endif +$! +$report_missing = 1 +$! +$if .not. ODS2_SYNTAX +$then +$ set proc/parse=extended +$endif +$! +$loop: +$ ref_spec = f$search("''ref'...]*.*;",1) +$ if ref_spec .eqs. "" then goto loop_end +$! +$ ref_dev = f$parse(ref_spec,,,"DEVICE") +$ ref_dir = f$parse(ref_spec,,,"DIRECTORY") +$ ref_dir = f$edit(ref_dir, "LOWERCASE") +$ ref_name = f$parse(ref_spec,,,"NAME") +$ ref_type = f$parse(ref_spec,,,"TYPE") +$! +$! +$ if f$locate(".CVS]", ref_dir) .lt. f$length(ref_dir) then goto loop +$ if f$locate(".cvs]", ref_dir) .lt. f$length(ref_dir) then goto loop +$ if f$locate(".$cvs]", ref_dir) .lt. f$length(ref_dir) then goto loop +$ if f$locate(".^.git", ref_dir) .lt. f$length(ref_dir) then goto loop +$ if f$locate(".$5ngit", ref_dir) .lt. f$length(ref_dir) then goto loop +$! +$ rel_path = ref_dir - "[" - ref_base_dir +$! rel_path_len = f$length(rel_path) - 1 +$! delim = f$extract(rel_path_len, 1, rel_path) +$! rel_path = rel_path - ".]" - ".>" - "]" - ">" +$! rel_path = rel_path + delim +$! +$ if ODS2_SYNTAX +$ then +$ endif +$! +$ wrk_path = wrk + rel_path +$! +$ ref_name_type = ref_name + ref_type +$! +$ if ref_name_type .eqs. "CVS.DIR" then goto loop +$ if ref_name_type .eqs. "cvs.dir" then goto loop +$ if ref_name_type .eqs. "$CVS.DIR" then goto loop +$ if ref_name_type .eqs. "^.git.DIR" then goto loop +$ if ref_name_type .eqs. "$5ngit.DIR" then goto loop +$ if ref_name_type .eqs. "$5NGIT.DIR" then goto loop +$ if ODS2_SYNTAX +$ then +$! +$ endif +$! +$ wrk_spec = wrk_path + ref_name_type +$! +$! +$ wrk_chk = f$search(wrk_spec, 0) +$ if wrk_chk .eqs. "" +$ then +$ if report_missing +$ then +$ write sys$output "''wrk_spec' is missing" +$ endif +$ if update_file +$ then +$ copy/log 'ref_spec' 'wrk_spec' +$ endif +$ goto loop +$ endif +$! +$ wrk_name = f$parse(wrk_spec,,,"NAME") +$ wrk_type = f$parse(wrk_spec,,,"TYPE") +$ wrk_fname = wrk_name + wrk_type" +$ ref_fname = ref_name + ref_type +$! +$ if ref_fname .nes. wrk_fname +$ then +$ write sys$output "''wrk_spc' wrong name, should be ""''ref_fname'""" +$ endif +$! +$ ref_type = f$edit(ref_type, "UPCASE") +$ if ref_type .eqs. ".DIR" then goto loop +$! +$ if ODS2_SYNTAX +$ then +$ ref_fname = f$edit(ref_fname, "LOWERCASE") +$ endif +$! +$! These files have records to long to diff, and we don't change them anyway. +$ ref_skip = 0 +$ if ref_type .eqs. ".GMO" then ref_skip = 1 +$ if ref_type .eqs. ".PDF" then ref_skip = 1 +$ if ref_type .eqs. ".PNG" then ref_skip = 1 +$ if ref_type .eqs. ".JPG" then ref_skip = 1 +$ if ref_fname .eqs. "inftest.ok" then ref_skip = 1 +$ if ref_fname .eqs. "longsub.in" then ref_skip = 1 +$ if ref_fname .eqs. "longsub.ok" then ref_skip = 1 +$ if ref_fname .eqs. "nasty2.ok" then ref_skip = 1 +$ if ref_fname .eqs. "profile5.awk" then ref_skip = 1 +$ if ref_fname .eqs. "profile5.ok" then ref_skip = 1 +$ if ref_fname .eqs. "po.m4" then ref_skip = 1 +$! +$! +$ if ref_skip .ne. 0 +$ then +$ if report_missing +$ then +$ write sys$output "Skipping diff of ''ref_fname'" +$ endif +$ goto loop +$ endif +$! +$! +$ wrk_ver = f$parse(wrk_chk,,,"VERSION") +$ if wrk_ver .nes. ";1" +$ then +$ write sys$output "Version for ''wrk_spec' is not 1" +$ endif +$ set noon +$ diff/out=nl: 'wrk_spec' 'ref_spec' +$ if $severity .nes. "1" +$ then +$ write sys$output "''wrk_spec' is different from ''ref_spec'" +$ if update_file +$ then +$ delete 'wrk_spec';* +$ copy/log 'ref_spec' 'wrk_spec' +$ endif +$ endif +$ set on +$ +$! +$ goto loop +$loop_end: +$! +$! +$missing_loop: +$! For missing loop, check the latest generation. +$ ref_spec = f$search("''wrk'...]*.*;") +$ if ref_spec .eqs. "" then goto missing_loop_end +$! +$ ref_dev = f$parse(ref_spec,,,"DEVICE") +$ ref_dir = f$parse(ref_spec,,,"DIRECTORY") +$ ref_dir = f$edit(ref_dir, "LOWERCASE") +$ ref_name = f$parse(ref_spec,,,"NAME") +$ ref_type = f$parse(ref_spec,,,"TYPE") +$! +$ rel_path = ref_dir - "[" - wrk_base_dir +$! +$! +$ wrk_path = ref + rel_path +$ wrk_spec = wrk_path + ref_name + ref_type +$ wrk_name = f$parse(wrk_spec,,,"NAME") +$ wrk_type = f$parse(wrk_spec,,,"TYPE") +$! +$ wrk_fname = wrk_name + wrk_type" +$ ref_fname = ref_name + ref_type +$! +$ wrk_skip = 0 +$ ref_utype = f$edit(ref_type,"UPCASE") +$ ref_ufname = f$edit(ref_fname,"UPCASE") +$! +$! +$ if wrk_skip .eq. 0 +$ then +$ wrk_chk = f$search(wrk_spec, 0) +$ if wrk_chk .eqs. "" +$ then +$ if report_missing +$ then +$ write sys$output "''wrk_spec' is missing" +$ endif +$ goto missing_loop +$ endif +$ else +$ goto missing_loop +$ endif +$! +$ if ref_fname .nes. wrk_fname +$ then +$ write sys$output "''wrk_spc' wrong name, should be ""''ref_fname'""" +$ endif +$! +$ if ref_utype .eqs. ".DIR" then goto missing_loop +$! +$ wrk_ver = f$parse(wrk_chk,,,"VERSION") +$ if wrk_ver .nes. ";1" +$ then +$ write sys$output "Version for ''wrk_spec' is not 1" +$ endif +$! +$ goto missing_loop +$! +$! +$missing_loop_end: +$! +$exit diff --git a/vms/config_h.com b/vms/config_h.com index 406e1266..c1d3becf 100644 --- a/vms/config_h.com +++ b/vms/config_h.com @@ -29,19 +29,28 @@ $! $! This procedure may not guess the options correctly for all architectures, $! and is a work in progress. $! -$! Copyright 2011, John Malmberg -$! -$! Permission to use, copy, modify, and/or distribute this software for any -$! purpose with or without fee is hereby granted, provided that the above -$! copyright notice and this permission notice appear in all copies. -$! -$! THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -$! WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -$! MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -$! ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -$! WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -$! ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT -$! OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +$! Copyright (C) 2014 the Free Software Foundation, Inc. +$! +$! This file is part of GAWK, the GNU implementation of the +$! AWK Progamming Language. +$! +$! GAWK is free software; you can redistribute it and/or modify +$! it under the terms of the GNU General Public License as published by +$! the Free Software Foundation; either version 3 of the License, or +$! (at your option) any later version. +$! +$! GAWK is distributed in the hope that it will be useful, +$! but WITHOUT ANY WARRANTY; without even the implied warranty of +$! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +$! GNU General Public License for more details. +$! +$! You should have received a copy of the GNU General Public License +$! along with this program; if not, write to the Free Software +$! Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +$! USA +$! +$! Per assignment agreement with FSF, similar procedures may be present +$! in other packages under other licensing agreements and copyrights $! $! 15-Jan-2001 J. Malmberg Original $! 29-Apr-2001 J. Malmberg Also look for config.*in* in a [.include] diff --git a/vms/descrip.mms b/vms/descrip.mms index f53db272..1f24f8f1 100644 --- a/vms/descrip.mms +++ b/vms/descrip.mms @@ -345,6 +345,23 @@ spotless : clean tidy - if f$search("config.h").nes."" then delete config.h;* - if f$search("config_vms.h").nes."" then delete config_vms.h;* - if f$search("gawk.exe").nes."" then delete gawk.exe;* + - if f$search("*.dsf").nes."" then delete *.dsf;* + - if f$search("*.map").nes."" then delete *.map;* + - if f$search("*.pcsi$desc").nes."" then delete *.pcsi$desc;* + - if f$search("*.pcsi$text").nes."" then delete *.pcsi$text;* + - if f$search("gawk*_src.bck").nes."" then delete gawk*_src.bck;* + - if f$search("*.release_notes").nes."" then delete *.release_notes;* + - if f$search("filefuncs.exe").nes."" then delete filefuncs.exe;* + - if f$search("fnmatch.exe").nes."" then delete fnmatch.exe;* + - if f$search("inplace.exe").nes."" then delete inplace.exe;* + - if f$search("ordchr.exe").nes."" then delete ordchr.exe;* + - if f$search("readdir.exe").nes."" then delete readdir.exe;* + - if f$search("revoutput.exe").nes."" then delete revoutput.exe;* + - if f$search("revtwoway.exe").nes."" then delete revtwoway.exe;* + - if f$search("rwarray.exe").nes."" then delete rwarray.exe;* + - if f$search("testext.exe").nes."" then delete testext.exe;* + - if f$search("time.exe").nes."" then delete time.exe;* + - if f$search("gawk_verb.cld").nes."" then delete gawk_verb.cld;* - if f$search("gawk.dvi").nes."" then delete gawk.dvi;* - if f$search("[.doc]texindex.exe").nes."" then \ delete [.doc]texindex.exe;* diff --git a/vms/gawk_alias_setup.com b/vms/gawk_alias_setup.com new file mode 100644 index 00000000..73f70d15 --- /dev/null +++ b/vms/gawk_alias_setup.com @@ -0,0 +1,110 @@ +$! File: gawk_alias_setup.com +$! +$! The PCSI procedure needs a helper script to set up and remove aliases. +$! +$! If p1 starts with "R" then remove instead of install. +$! +$! +$! 02-Jan-2014 J. Malmberg - Gawk Version +$! +$!=========================================================================== +$! +$ mode = "install" +$ code = f$extract(0, 1, p1) +$ if code .eqs. "R" .or. code .eqs. "r" then mode = "remove" +$! +$ arch_type = f$getsyi("ARCH_NAME") +$ arch_code = f$extract(0, 1, arch_type) +$! +$ if arch_code .nes. "V" +$ then +$ set proc/parse=extended +$ endif +$! +$! +$ call do_alias "gawk" "[bin]" +$ call do_alias "gawk" "[bin]" "awk" +$ call do_alias "gawk" "[bin]" "gawk" "[usr.bin]" +$ call do_alias "gawk" "[bin]" "awk" "[usr.bin]" +$ call do_alias "gawk.1" "[usr.share.man.man1]" "awk.1" +$! +$ exit +$!! +$! +$do_alias: subroutine +$ if mode .eqs. "install" +$ then +$ call add_alias "''p1'" "''p2'" "''p3'" "''p4'" +$ else +$ call remove_alias "''p1'" "''p2'" "''p3'" "''p4'" +$ endif +$ exit +$ENDSUBROUTINE ! do_alias +$! +$! +$! P1 is the filename, p2 is the directory prefix, +$! p3 is the alias name if different than p1 +$! p4 is the alias directory if different than p2 +$add_alias: subroutine +$ if p3 .eqs. "" then p3 = p1 +$ if p4 .eqs. "" then p4 = p2 +$ ftype = f$element(1, ".", p1) +$ if ftype .eqs. "." +$ then +$ file = "gnv$gnu:''p2'gnv$''p1'.EXE" +$ alias = "gnv$gnu:''p4'''p3'." +$ else +$ file = "gnv$gnu:''p2'''p1'" +$ alias = "gnv$gnu:''p4'''p3'" +$ endif +$ if f$search(file) .nes. "" +$ then +$ if f$search(alias) .eqs. "" +$ then +$ set file/enter='alias' 'file' +$ endif +$ alias1 = alias + "exe" +$ if (ftype .eqs. ".") .and. (f$search(alias1) .eqs. "") +$ then +$ set file/enter='alias1' 'file' +$ endif +$ endif +$ exit +$ENDSUBROUTINE ! add_alias +$! +$remove_alias: subroutine +$ if p3 .eqs. "" then p3 = p1 +$ if p4 .eqs. "" then p4 = p2 +$ ftype = f$element(1, ".", p1) +$ if ftype .eqs. "." +$ then +$ file = "gnv$gnu:''p2'''p1'.EXE" +$ alias = "gnv$gnu:''p4'''p3'." +$ else +$ file = "gnv$gnu:''p2'''p1'" +$ alias = "gnv$gnu:''p4'''p3'" +$ endif +$ file_fid = "No_file_fid" +$ if f$search(file) .nes. "" +$ then +$ fid = f$file_attributes(file, "FID") +$ if f$search(alias) .nes. "" +$ then +$ afid = f$file_attributes(alias, "FID") +$ if (afid .eqs. fid) +$ then +$ set file/remove 'alias'; +$ endif +$ endif +$ alias1 = alias + "exe" +$ if (ftype .eqs. ".") .and. (f$search(alias1) .nes. "") +$ then +$ afid = f$file_attributes(alias1, "FID") +$ if (afid .eqs. fid) +$ then +$ set file/remove 'alias1'; +$ endif +$ endif +$ endif +$ exit +$ENDSUBROUTINE ! remove_alias diff --git a/vms/gawk_build_steps.txt b/vms/gawk_build_steps.txt new file mode 100644 index 00000000..b3bb281b --- /dev/null +++ b/vms/gawk_build_steps.txt @@ -0,0 +1,220 @@ +From File: gawk_build_steps.txt + +Building GAWK on OpenVMS for use with GNV requires a current HP C compiler +and MMK. + +The HP C 7.x compilers were used for building on Alpha and Itanium. +The Compaq C 6.4 compiler is being used on VAX. + +MMK was obtained from https://github.com/endlesssoftware/mmk + +Several special things were done in this port of Gawk to VMS to make it +easier to keep it up to date with the Unix version. + +Note the GNV$ prefix is registered for the GNV project to prevent name +collisions with other products and packages. This is a VMS convention. + +The files are stored with GNV_ instead of GNV$ most open source source +code maintainers do not want to files with $ in their source repositories. + +The build procedure will copy the files to have the GNV$ names as needed. + +1. The original GNU Gawk source files are in their own directory tree which +is never written to by the build process. This directory is kept up to date +with the current official patches. See below about the how this is done +with logical names. + +2. A file vms_eco_level.h is used to set the ECO of the package. The +vms_eco_level.h needs to be set back to zero if the version or patch level +of the GNU Unix source is changed. This file is currently only used +by the kit building procedure. + +The source kits are provided in backup savesets inside of the PCSI install kit. + +Backup save sets are currently the only distribution medium that I can be +sure is installed on a target VMS system that will correctly unpack files +with extended character sets in them. You may need to adjust the ownership +of the restored files for kits on Alpha/Itanium VMS versions 8.1 and earlier. + +On VAX, the filenames will be as seen on the VAX system, typically with non +ODS-2 characters and case changes prefixed with $ characters. + +[gnv.common_src]gawk_*_original_src.bck is the original source of the +gawk kit as provided by the GNV project. +[gnv.vms_src]gawk-*_vms_src.bck, if present, has the changed files that +are used for building that are not yet in the gawk source kits +distributed by the GNU gawk project. + +These backup savesets should be restored to different directory trees on +an ODS-5 volume(s) which are referenced by concealed rooted logical names, +unless on VAX, where either an NFS or ODS-2 volume can be used. + +SRC_ROOT: is for the source files common to all platforms. This can be a + read only copy of the files from a change control repository. + + In my build environment, the TRUNK_ROOT:[gawk] is the + same directory as src_root:[gawk]. TRUNK_ROOT:[gawk] is a + checkout of the gawk repository used for the build. + +VMS_ROOT: is for the files that were changed from the repository copy of + SRC_ROOT: + + Note, you should create the VMS_ROOT: directory tree even if it is + initially empty. This is where you should put edits if you are + making changes. + + In my build environment, the source_root:[gnu_vms.gawk] is a + directory with the checked out code and vms_root:[gawk] is + a copy with any local modifications. + + The command procedure compare_gawk_source.com will report any + differences in the source_root:[gnu_vms.gawk] directory and the + vms_root:[gawk] directory. If the source_root: logical is not + defined, it will translate the logical name src_root to do the + effective of src_root:[gawk.-.-.gnu_vms.gawk] to find the + VMS specific code CVS checkout based on where the checkout for + the GNU source is expected to be. + +LCL_ROOT: is manually created to have the same base and sub-directories as + SRC_ROOT: and VMS_ROOT: This is for the architecture specific + binaries and other files created during the build. + +The logical name REF_ROOT: is optionally defined to be a logical name that +is a search list for VMS_ROOT:,SRC_ROOT: + +The logical name PRJ_ROOT: is defined to be a logical name that is a search +list for LCL_ROOT:,REF_ROOT: + +The VMS_ROOT and LCL_ROOT directory trees can be created with commands +similar to: + + $ create/dir lcl_root:[gawk]/prot=w:re + $ copy src_root:[gawk...]*.dir - + lcl_root:[gawk...]/prot=(o:rwed,w:re) + $ create/dir vms_root:[gawk]/prot=w:re + $ copy src_root:[gawk...]*.dir - + vms_root:[gawk...]/prot=(o:rwed,w:re) + +One of the ways with to protect the source from being modified is to have +the directories under src_root: owned by a user or resource where the build +username only has read access to it. + +Edit the file gawk_release_note_start.txt or other text files to reflect +any changes. + +Edit the file PCSI_GAWK_FILE_LIST.TXT if there are new files added to the +kit. These files should all be ODS-2 legal filenames and directories. + +Note that if src_root: or vms_root: are NFS mounted disks, the +step of backing up the source files will probably hang or fail. + +You need to copy the source files to VMS mounted disks and create +logical names SRC_ROOT1 and VMS_ROOT1 to work around this to to +reference local disks. Make sure src_root1:[000000] and +vms_root1:[000000] exist and can be written to. + +The command procedure compare_gawk_source can be used to check +those directories and keep them up to date. + + @[.vms]compare_gawk_source.com SRCBCK UPDATE + + This compares the reference GNU source with the backup + staging directory for it and updates with any changes. + + @[.vms]compare_gawk_source.com VMSBCK UPDATE + + This compares the VMS specific source with the backup + staging directory for it and updates with any changes. + + Leave off "UPDATE" to just check without doing any changes. + + If you are not using NFS mounted disks and do not want to have a + separate directory for staging the sources for backup make sure + that src_root1: and vms_root1: do not exist. + +The kits will be built in the directory STAGE_ROOT:[KIT], which must be +writable to the build procedure. + +Define the logical name GNV_PCSI_PRODUCER to indicate who is making the +distribution. + +Define the logical name GNV_PCSI_PRODUCER_FULL_NAME to be your full name +or full name of your company. + +These two GNV_PCSI_* logical names need to be manually defined to indicate +the "branding" to differentiate the source of the kit. + +A limitation of the PCSI kitting procedure is that when selecting files, it +tends to ignore the directory structure and assumes that all files with the +same name are the same file, so every file placed in the kit must have a +unique ODS-2 legal name. Then a procedure needs to be added to the kit to +create an alias link on install and remove the link on remove. + +While newer versions of PCSI can support ODS-5 filenames, not all verions +of PCSI on systems that have ODS-5 filenames do. So as a post install step, +the PCSI kit built by these steps does a rename to the correct case. + +With these search lists set up and the logical names described, Gawk can +be built and kitted by setting your default to PRJ_ROOT:[gawk] +and then issuing the command: + + $ @[.vms]pcsi_product_gawk.com + +First it will build the binaries by using MMK utility. The case of the +parameter may be significant on ODS-5. + + $ mmk/descrip=[.vms]descrip.mms gawk + +Then for Alpha and Itanium, it will build the dynamic extensions. + + $ mmk/descrip=[.vms]descrip.mms extensions + +To clean up after a build to start over, run mmk with the target spotless. + + $ mmk/descrip=[.vms]descrip.mms spotless + +The files are installed into a NEW_GNU directory for staging by running the +procedure stage_gawk_install.com. This copies the binaries and creates +alias links to them. + + $ @[.vms]stage_gawk_install.com remove + $ @[.vms]stage_gawk_install.com + +On the VAX platform, the staged files are needed for building the PCSI +kit, as the VAX source was staged on an NFS volume, which encodes the +filenames that have any upper case or special symbols in them. + +To remove the staged files, the procedure is run again with the parameter +"REMOVE". This makes sure that the alias links are removed. + +The names and contents of the PCSI files requires that the version of +gawk be encoded in a special format. This is done by: + + @[.vms]make_pcsi_gawk_kit_name.com + +The release notes are built from the release note start, readme files and +this file: + + @[.release]build_gawk_release_notes.com + +Then the backup the source kits. + +Building a PCSI kit for an architecture takes the following steps after +making sure that you have a working build environment. + +On VAX, the product command always prompts to the terminal for a confirmation. + +If there is another kit for this same version of gawk, but for a different +base platform or operating system version, the product command will prompt +to the terminal to select which one to compress. + + The following message is normal: + %PCSI-I-CANNOTVAL, cannot validate + EAGLE$DQA0:[stage_root.][kit]GNV-AXPVMS-GAWK-V--1.PCSI;1 + -PCSI-I-NOTSIGNED, product kit is not signed and therefore has + no manifest file + +This will result in both compressed and uncompressed kits for the target +platform. + +Good Luck. diff --git a/vms/gawk_release_note_start.txt b/vms/gawk_release_note_start.txt new file mode 100644 index 00000000..44fceaf5 --- /dev/null +++ b/vms/gawk_release_note_start.txt @@ -0,0 +1,189 @@ +From file: gawk_release_note_start.com + +This is GNU gawk packaged for VMS. + +The original readme files for GAWK for standalone building on VMS are +supplied here along with a procedure for building GAWK for the making +a PCSI kit. + +Note: I am a hobbyist and am not providing any support or any commitment +to supply bug fixes or future releases. This code is as-is with no +warrantees. + +The testing of this port of Gawk involved running some self tests that +were provided with the source. + +This version of gawk supports dynamically loaded extensions on Alpha and +Itanium versions of VMS. The pre-built dynamically loaded extensions +are in gnv$gnu:[usr.lib.gawk]. + +The linker option file used to build a dynamically loaded extension is +located in gnv$gnu:[usr.src.gawk.extension.vms], and the gawkapi.h file +is in gnv$gnu:[usr.include]. + +Special installation notes: + +* Please see https://sourceforge.net/p/gnv/wiki/InstallingGNVPackages/ + for the latest information on installing GNV related PCSI kits. + +* We are updating and replacing GNV one kit at a time and transitioning + GNV to be a set of kits that the GNV package will install. During + this transition some extra issues will need to be handled during + installs and upgrades. + +* Due to the way that PCSI identifies packages, if you install a package + from one producer and then want to upgrade it from another producer, + you will probably need to uninstall the previous package first. + + Some of these packages were previously created with different producer + prefixes. We are standardizing on VMSPORTS and GNV as the branding + prefixes. GNV will be for packages that are part of the GNV product + suite, and VMSPORTS will be for most other packages. + + This uninstall can cause warning messages about dependencies. If you + are transitioning to an upwardly compatible package, you can ignore + those warnings. + +* This package should be installed to the same volume as GNV is installed. + + If you uninstall or upgrade GNV or install a GNV from before the + transition is complete, you will need to reinstall all other packages + that install to the same GNV directory tree. + + This is because at least some of the existing GNV installation procedures + have bugs in them were instead of just deleting the files that were + installed, they delete all files in the GNV directory tree. + +* Because this is a transition, this package is replacing files from the + old GNV packages. This is a necessary issue to allow incremental + improvement as we can not replace the GNV package until we get all + the component packages done. + +* The GNV 2.x through at least the 3.0.1 kits make an unusual change + to the disk directory structure where they are installed where + they use the [vms$common.gnv] as a mount point and mount the posix + root on it. This is a bug because it causes many problems and does + not offer any advantages. One of the problems is that it causes + problems with other PCSI installs and uninstalls to that directory. + + This bug can be manually repaired such as has been done on + on encompasserve.org as documented in PORTING_TO_VMS notes conference. + + At this time, we do not have a scripted repair to this bug, and it + may not be possible to fully script a repair because this bug can + cause the POSIX root and [vms$common.gnv] to have different contents + when they should be the same directory, and it will take a manual + inspection to select which files go where. + +* Because of the directory change bug, the gnv$startup.com in the GNV + kit must be run when the system boots up or the [vms$common.gnv] + directory will appear to be empty. + + If a PCSI kit like this one is installed when the GNV startup has not + been run, it will create a new directory tree under [vms$common.gnv] + that will not be visible to the posix root. If you uninstall this + PCSI kit before running the gnv$startup.com procedure then you can + install it after running the gnv$startup.com procedure. If you have + run the gnv$startup.com procedure after the install, then you have + a mess, and you will need to use the GNV umnt to un-mount the + [vms$common.gnv] directory before the uninstall of this kit will + work. + +An analyze/disk/repair step on the installation disk should be done after +installation to collect files left over from incomplete deletions into the +SYSLOST directory. This step should be done on a "quiet" system per HP +recomendations. + +Bugs can be logged at the tracker with https://sourceforge.net/projects/gnv/. +There is no guarantee that bugs will be fixed for a hobbyist build. + +VMS specific port information: + +The logical name GNV$GNU is used to find the simulated posix root and defines +the logical name SYS$POSIX_ROOT in the process table in user mode for child +processes if needed. This is to comply with VMS logical name conventions. +The logical name BIN is also set in the process table in user mode to be +GNV$GNU:[BIN] if it is not already set. + +The following DECC$Feature settings are in in effect for Gawk by default: + +DECC$ACL_ACCESS_CHECK enabled. +DECC$ALLOW_REMOVE_OPEN_FILES enabled. +DECC$ARGV_PARSE_STYLE enabled. +DECC$EFS_CASE_PRESERVE enabled. +DECC$EFS_CHARSET enabled. +DECC$EFS_FILE_TIMESTAMPS enabled. +DECC$ENABLE_GETENV_CACHE enabled. +DECC$EXEC_FILEATTR_INHERITANCE set to 2. +DECC$FILE_PERMISSION_UNIX enabled. +DECC$FILE_SHARING enabled. +DECC$FILE_OWNER_UNIX enabled. +DECC$FILENAME_REPORT_UNIX enabled. +DECC$FILENAME_UNIX_NO_VERSION enabled. +DECC$GLOB_UNIX_STYLE enabled. +DECC$POSIX_SEEK_STREAM_FILE enabled. +DECC$READDIR_DROPDOTNOTYPE enabled. +DECC$RENAME_NO_INHERIT enabled. +DECC$STDIO_CTX_EOL enabled. +DECC$STRTOL_ERANGE enabled. +DECC$UNIX_PATH_BEFORE_LOGNAME enabled. + +While more strict UNIX compatibility feature settings can be applied by users +by setting feature logical names, these settings are all the Bash and most +ported programs need. + +This port of Gawk uses the VMS CRTL to handle the Unix format pathnames +and as such is dependent on them. It is a known issue that directories with +a Unix name "file.dir/" and some symbolic links are not handled correctly. +This is a combination of problems with RMS and CRTL. The RMS portion is +fixed with the VMS84?_RMS-V0300 ECO kit. I am not aware of a CRTL kit that +fixes the issues. + +This kit is designed to be used with the GNV Bash 4.2.45 or later kit. + +Fixes and enhancements: + +* No logical names required for proper Gawk operations other than GNV$GNU + for locating the simulated "/". + +* GNV$GNU is used to find the posix root and locally sets SYS$POSIX_ROOT + for child processes if needed. This is to comply with VMS logical + name conventions. The logical name BIN is also set locally to be + GNV$GNU:[BIN] if it is not already set. + +* config.h now generated at part of the build from a template. + +The supplied GNV$GAWK_STARTUP.COM procedure is provided in +[VMS$COMMON.SYS$STARTUP] can be put in your VMS startup procedure to install +selected images as known because they need privileges. It is recommended +that the GNV$STARTUP.COM procedure be run first, followed by the +GNV$BASH_STARTUP.COM procedure before the GNV$GAWK_STARTUP.COM is +executed. + +The names of the gawk image have been prefixed with GNV$ to prevent +possible naming conflicts with other programs that are on the system. The +GNV$ prefix has been registered with HP for this purpose. + +OpenVMS specific building and kitting instructions are after the standard +bash readme file below. + +The source kits contains files for building Gawk using MMK. +MMK 4.0 was used for this build on Alpha and Itanium Itanium. + +Currently, the focus of the OpenVMS GNV porting team is to address bugs in +the OpenVMS port of GNV components that pose immediate barriers to running +configure and make scripts for Open Source Software packages targeting +OpenVMS environments. + +The GNV development team is involved in an ongoing effort to identify and +document the underlying technical causes for these current limitations and (if +available) workarounds as well as developing code fixes to eliminate them. The +VMS-Ports Source Forge project at https://sourceforge.net/p/vms-ports/tickets/ +currently documents OpenVMS CRTL bugs and limitations with respect to porting +Open Source Software using OpenVMS. The VMS-Ports Source Forge Project also +contains examples of ported packages provided by volunteer contributors as well +as documentation with recommendations on how to setup, modify and use the +OpenVMS GNV environment for the purpose of porting Open Source software +packages to OpenVMS. Browse to https://sourceforge.net/p/vms-ports/wiki/Home/ +for more information. + diff --git a/vms/gawk_verb.com b/vms/gawk_verb.com new file mode 100644 index 00000000..b74c49ed --- /dev/null +++ b/vms/gawk_verb.com @@ -0,0 +1,26 @@ +$! gawk_verb.com - build the gawk_verb.cld from the gawk.cld. +$! +$! The CLD file needed to modify a DCL command table is different +$! from the CLD file needed to build the product by specifying an image. +$! +$! So read in the [.vms]gawk.cld and generate a gawk_verb.cld. +$! +$! 23-Dec-2012 - J. Malmberg +$! +$outfile = "sys$disk:[]gawk_verb.cld" +$infile = "[.vms]gawk.cld" +$open/read cld 'infile' +$create 'outfile' +$open/append cldv 'outfile' +$loop: +$read cld/end=loop_end line_in +$if f$locate("image gawk", line_in) .lt. f$length(line_in) +$then +$ write cldv " image gnv$gnu:[bin]gnv$gawk" +$ goto loop +$endif +$write cldv line_in +$goto loop +$loop_end: +$close cldv +$close cld diff --git a/vms/gawkmisc.vms b/vms/gawkmisc.vms index 749c6036..725cf669 100644 --- a/vms/gawkmisc.vms +++ b/vms/gawkmisc.vms @@ -3,7 +3,8 @@ */ /* - * Copyright (C) 1986, 1988, 1989, 1991-1996, 2003, 2011 the Free Software Foundation, Inc. + * Copyright (C) 1986, 1988, 1989, 1991-1996, 2003, 2011, 2014 + * the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Progamming Language. diff --git a/vms/gnv_gawk_startup.com b/vms/gnv_gawk_startup.com new file mode 100644 index 00000000..e691965e --- /dev/null +++ b/vms/gnv_gawk_startup.com @@ -0,0 +1,75 @@ +$! File: gnv$gawk_Startup.com / gnv_gawk_startup.com +$! +$! Procedure to setup the GAWK images for use by programs from the +$! VMS SYSTARTUP*.COM procedure. +$! +$! 14-Mar-2011 J. Malmberg +$! 04-May-2011 J. Malmberg Use GNV_PCSI_DESTINATION to find the +$! value to assing GNV$GNU per suggestion +$! by Martin Vorlander. +$! 02-Jan-2014 J. Malmberg Gawk Version +$!======================================================================== +$! +$! +$! GNV$GNU if needed. +$ if f$trnlnm("GNV$GNU") .eqs. "" +$ then +$ x = f$trnlnm("GNU","LNM$SYSTEM_TABLE") +$ if x .nes. "" +$ then +$ write sys$output - + "Notice: logical name GNU: was found in the system table instead of GNV$GNU:" +$ write sys$output - + "This is a known bug in the GNV 2.1.3 and earlier kits." +$ define/system/exec/trans=conc GNV$GNU 'x' +$ else +$! +$! File name per VMS standards +$! --------------------------- +$ file1 = "sys$startup:gnv$destination_''f$getsyi("ARCH_NAME")'.com" +$! +$! File name in GNV 2.1.3 +$! ---------------------- +$ file2 = "sys$startup:gnv_destination_''f$getsyi("ARCH_NAME")'.com" +$! +$! File name before GNV 2.1.3 +$! --------------------------- +$ file3 = "sys$startup:gnv_destination''f$getsyi("ARCH_NAME")'.com" +$ arch_file = "" +$ if f$search(file1) .nes. "" +$ then +$ arch_file = file1 +$ else +$ if f$search(file2) .nes. "" +$ then +$ arch_file = file2 +$ else +$ if f$search("file3") .nes. "" then arch_file = file3 +$ endif +$ endif +$ if (arch_file) .nes. "" then @'arch_file' +$! +$! Logical name per VMS standards +$! ------------------------------- +$ destination = f$trnlnm("GNV$PCSI_DESTINATION") +$! +$! Logical name in GNV 2.1.3 +$! -------------------------- +$ if destination .eqs. "" +$ then +$ destination = f$trnlnm("GNV_PCSI_DESTINATION") +$ endif +$ if destination .eqs. "" +$ then +$ !Assume this procedure is on the same volume as the GNV install. +$ my_proc = f$environment("PROCEDURE") +$ my_dev = f$parse(my_proc,,,"DEVICE","NO_CONCEAL") +$ destination = "''my_dev'[vms$common.gnv.]" +$ endif +$ define/system/exec/trans=conc gnv$gnu 'destination' +$ endif +$ endif +$! +$! +$all_exit: +$ exit diff --git a/vms/make_pcsi_gawk_kit_name.com b/vms/make_pcsi_gawk_kit_name.com new file mode 100644 index 00000000..daaa37a4 --- /dev/null +++ b/vms/make_pcsi_gawk_kit_name.com @@ -0,0 +1,189 @@ +$! File: MAKE_PCSI_GAWK_KIT_NAME.COM +$! +$! Calculates the PCSI kit name for use in building an installation kit. +$! PCSI is HP's PolyCenter Software Installation Utility. +$! +$! The results are stored in as logical names so that other procedures +$! can use them. +$! +$! 92-Jan-2014 J. Malmberg Gawk version +$!======================================================================== +$! +$! Save default +$default_dir = f$environment("DEFAULT") +$! +$! Put things back on error. +$on warning then goto all_exit +$! +$! The producer is the name or common abbreviation for the entity that is +$! making the kit. It must be set as a logical name before running this +$! procedure. +$! +$! HP documents the producer as the legal owner of the software, but for +$! open source work, it should document who is creating the package for +$! distribution. +$! +$producer = f$trnlnm("GNV_PCSI_PRODUCER") +$if producer .eqs. "" +$then +$ write sys$output "The logical name GNV_PCSI_PRODUCER needs to be defined." +$ write sys$output "This should be set to the common abbreviation or name of" +$ write sys$output "the entity creating this kit. If you are an individual" +$ write sys$output "then use your initials as long as they do not match" +$ write sys$output "a different well known producer prefix." +$ goto all_exit +$endif +$producer_full_name = f$trnlnm("GNV_PCSI_PRODUCER_FULL_NAME") +$if producer_full_name .eqs. "" +$then +$ write sys$output "The logical name GNV_PCSI_PRODUCER_FULL_NAME needs to" +$ write sys$output "be defined. This should be set to the full name of" +$ write sys$output "the entity creating this kit. If you are an individual" +$ write sys$output "then use your name." +$ write sys$output "EX: DEFINE GNV_PCSI_PRODUCER_FULL_NAME ""First M. Last""" +$ goto all_exit +$endif +$! +$write sys$output "*****" +$write sys$output "***** Producer = ''producer'" +$write sys$output "*****" +$! +$! +$! Base is one of 'VMS', 'AXPVMS', 'I64VMS', 'VAXVMS' and indicates what +$! binaries are in the kit. A kit with just 'VMS' can be installed on all +$! architectures. +$! +$base = "VMS" +$arch_type = f$getsyi("ARCH_NAME") +$code = f$extract(0, 1, arch_type) +$if (code .eqs. "I") then base = "I64VMS" +$if (code .eqs. "V") then base = "VAXVMS" +$if (code .eqs. "A") then base = "AXPVMS" +$! +$! +$product = "gawk" +$! +$! +$! We need to get the version from config.h. It will have a lines like +$! #define PACKAGE_VERSION "4.1.0a" +$! +$! +$open/read/error=version_loop_end verf config.h +$version_loop: +$ read/end=version_loop_end verf line_in +$ if line_in .eqs. "" then goto version_loop +$ if f$locate("#define PACKAGE_VERSION", line_in) .ne. 0 +$ then +$ goto version_loop +$ endif +$ tag = f$element(1, " ", line_in) +$ value = f$element(2, " ", line_in) - """" - """" +$ if tag .eqs. "PACKAGE_VERSION" +$ then +$ distversion = value +$ goto version_loop_end +$ endif +$ goto version_loop +$version_loop_end: +$close verf +$! +$! +$! Optional ECO file. +$ECO_LEVEL = "" +$vms_eco_file = "[.vms]vms_eco_level.h" +$if f$search(vms_eco_file) .nes. "" +$then +$ open/read ef 'vms_eco_file' +$ecolevel_loop: +$ read/end=ecolevel_loop_end ef line_in +$ prefix = f$element(0, " ", line_in) +$ if prefix .nes. "#define" then goto ecolevel_loop +$ key = f$element(1, " ", line_in) +$ value = f$element(2, " ", line_in) - """" - """" +$ if key .eqs. "VMS_ECO_LEVEL" +$ then +$ ECO_LEVEL = value +$ if ECO_LEVEL .eq. 0 +$ then +$ ECO_LEVEL = "" +$ else +$ ECO_LEVEL = "E" + ECO_LEVEL +$ endif +$ goto ecolevel_loop_end +$ endif +$ goto ecolevel_loop +$ecolevel_loop_end: +$ close ef +$endif +$! +$raw_version = distversion +$! +$! +$! This translates to V0114-08 or D0115-01 +$! We can not encode the snapshot date into the version due to the way that +$! the Polycenter Software Installation Utility evaluates the name. +$! +$! version_type = 'V' for a production release, and 'D' for a build from a +$! daily repository snapshot, and a code for a build from a pre-release branch +$majorver = f$element(0, ".", raw_version) +$minorver = f$element(1, ".", raw_version) +$update = f$element(2,".", raw_version) +$if update .eqs. "." then update = "" +$vtype = "V" +$if update .nes. "" +$then +$ update_len = f$length(update) +$ code = f$extract(update_len - 1, 1, update) +$ code = f$edit(code, "UPCASE") +$ if (code .ges. "A") .and. (code .les. "Z") +$ then +$ update = f$extract(0, update_len - 1, update) +$ vtype = code +$ endif +$endif +$if update .eqs. "0" then update = "" +$! +$! +$version_fao = "!2ZB!2ZB" +$mmversion = f$fao(version_fao, 'majorver', 'minorver') +$version = vtype + "''mmversion'" +$if update .nes. "" .or. ECO_LEVEL .nes. "" +$then +$! The presence of an ECO implies an update +$ if update .eqs. "" .and. ECO_LEVEL .nes. "" then update = "0" +$ version = version + "-" + update + ECO_LEVEL +$ fversion = version +$else +$ fversion = version +$ version = version + "-" +$endif +$! +$! Kit type 1 is complete kit, the only type that this procedure will make. +$Kittype = 1 +$! +$! Write out a logical name for the resulting base kit name. +$name = "''producer'-''base'-''product'-''version'-''kittype'" +$define GNV_PCSI_KITNAME "''name'" +$fname = "''product'-''fversion'" +$! +$! No ECO or Patch level +$fname_len = f$length(fname) +$if f$extract(fname_len - 1, 1, fname) .eqs. "-" +$then +$ fname = f$extract(0, fname_len - 1, fname) +$ fname_len = fname_len - 1 +$endif +$if f$extract(fname_len - 1, 1, fname) .eqs. "-" +$then +$ fname = f$extract(0, fname_len - 1, fname) +$ fname_len = fname_len - 1 +$endif +$define GNV_PCSI_FILENAME_BASE 'fname' +$write sys$output "*****" +$write sys$output "***** GNV_PCSI_KITNAME = ''name'." +$write sys$output "***** GNV_PCSI_FILENAME_BASE = ''fname'." +$write sys$output "*****" +$! +$all_exit: +$set def 'default_dir' +$exit '$status' diff --git a/vms/pcsi_gawk_file_list.txt b/vms/pcsi_gawk_file_list.txt new file mode 100644 index 00000000..67d2d324 --- /dev/null +++ b/vms/pcsi_gawk_file_list.txt @@ -0,0 +1,120 @@ +! File: pcsi_gawk_file_list.txt +! +! File list for building a PCSI kit. +! Very simple format so that the parsing logic can be simple. +! links first, directory second, and files third. +! +! link -> file tells procedure to create/remove a link on install/uninstall +! If more than one link, consider using an alias file. +! +! [xxx.yyy]foo.dir is a directory file for the rename phase. +! [xxx.yyy.foo] is a directory file for the create phase. +! Each subdirectory needs to be on its own pair of lines. +! +! [xxx.yyy]file.ext is a file for the rename and add phases. +! +! 14-Mar-2011 J. Malmberg +! 08-Dec-2013 J. Malmberg This list is based on what was found on +! some Linux systems and what can be currently +! built on VMS. +! +!============================================================================ +![gnv.bin]awk. -> [gnv.bin]gnv$gawk.exe +![gnv.bin]awk.exe -> [gnv.bin]gnv$gawk.exe +![gnv.bin]gawk. -> [gnv.bin]gnv$gawk.exe +![gnv.bin]gawk.exe -> [gnv.bin]gnv$gawk.exe +![gnv.usr.bin]awk. -> [gnv.bin]gnv$gawk.exe +![gnv.usr.bin]awk.exe -> [gnv.bin]gnv$gawk.exe +![gnv.usr.bin]gawk. -> [gnv.bin]gnv$gawk.exe +![gnv.usr.bin]gawk.exe -> [gnv.bin]gnv$gawk.exe +![gnv.usr.share.man.man1]awk.1 -> [gnv.usr.share.man.man1]gawk.1 +[gnv] +[000000]gnv.dir +[gnv.bin] +[gnv]bin.dir +[gnv.vms_bin] +[gnv]vms_bin.dir +[gnv.vms_help] +[gnv]vms_help.dir +[gnv.lib] +[gnv]lib.dir +[gnv.usr] +[gnv]usr.dir +[gnv.usr.bin] +[gnv.usr]bin.dir +[gnv.usr.include] +[gnv.usr]include.dir +[gnv.usr.lib] +[gnv.usr]lib.dir +[gnv.usr.lib.gawk] +[gnv.usr.lib]gawk.dir +[gnv.usr.share] +[gnv.usr]share.dir +[gnv.usr.share.awk] +[gnv.usr.share]awk.dir +[gnv.usr.share.doc] +[gnv.usr.share]doc.dir +[gnv.usr.share.doc.gawk] +[gnv.usr.share.doc]gawk.dir +[gnv.usr.share.info] +[gnv.usr.share]info.dir +[gnv.usr.share.man] +[gnv.usr.share]man.dir +[gnv.usr.share.man.man1] +[gnv.usr.share.man]man1.dir +![gnv.usr.share.man.man7] +![gnv.usr.share.man]man7.dir +[gnv.usr]src.dir +[gnv.usr.src] +[gnv.usr.src]gawk.dir +[gnv.usr.src.gawk]extension.dir +[gnv.usr.src.gawk.extension] +[gnv.usr.src.gawk.extension]vms.dir +[gnv.usr.src.gawk.extension.vms] +[gnv.bin]gnv$gawk.exe +[gnv.bin]igawk. +[gnv.vms_bin]remove_old_gawk.com +[gnv.vms_bin]gawk_alias_setup.com +[gnv.vms_bin]gawk_verb.cld +[gnv.vms_help]gawk.hlp +[gnv.usr.include]gawkapi.h +[gnv.usr.lib.gawk]filefuncs.exe +[gnv.usr.lib.gawk]fnmatch.exe +[gnv.usr.lib.gawk]inplace.exe +[gnv.usr.lib.gawk]ordchr.exe +[gnv.usr.lib.gawk]readdir.exe +[gnv.usr.lib.gawk]revoutput.exe +[gnv.usr.lib.gawk]revtwoway.exe +[gnv.usr.lib.gawk]rwarray.exe +[gnv.usr.lib.gawk]time.exe +[gnv.usr.share.awk]assert.awk +[gnv.usr.share.awk]bits2str.awk +[gnv.usr.share.awk]cliff_rand.awk +[gnv.usr.share.awk]ctime.awk +[gnv.usr.share.awk]ftrans.awk +[gnv.usr.share.awk]getopt.awk +[gnv.usr.share.awk]gettime.awk +[gnv.usr.share.awk]join.awk +[gnv.usr.share.awk]libintl.awk +[gnv.usr.share.awk]noassign.awk +[gnv.usr.share.awk]ord.awk +[gnv.usr.share.awk]readable.awk +[gnv.usr.share.awk]readfile.awk +[gnv.usr.share.awk]rewind.awk +[gnv.usr.share.awk]round.awk +[gnv.usr.share.awk]strtonum.awk +[gnv.usr.share.awk]walkarray.awk +[gnv.usr.share.awk]zerofile.awk +[gnv.usr.share.doc.gawk]COPYING. +[gnv.usr.share.doc.gawk]NEWS. +[gnv.usr.share.doc.gawk]POSIX.STD +[gnv.usr.share.doc.gawk]README. +[gnv.usr.share.doc.gawk]README.vms +[gnv.usr.share.doc.gawk]README.multibyte +[gnv.usr.share.doc.gawk]README.tests +[gnv.usr.share.info]gawk.info +[gnv.usr.share.info]gawkinet.info +[gnv.usr.share.man.man1]gawk.1 +[gnv.usr.share.man.man1]igawk.1 +![gnv.usr.share.man.man7] +[gnv.usr.src.gawk.extension.vms]gawk_plugin.opt diff --git a/vms/pcsi_product_gawk.com b/vms/pcsi_product_gawk.com new file mode 100644 index 00000000..b0d9febd --- /dev/null +++ b/vms/pcsi_product_gawk.com @@ -0,0 +1,187 @@ +$! File: pcsi_product_gawk.com +$! +$! This command file packages up the product GAWK into a sequential +$! format kit +$! +$! 13-Dec-2013 J.Malmberg +$! +$!========================================================================= +$! +$! Save default +$ default_dir = f$environment("DEFAULT") +$! +$! Put things back on error. +$ on warning then goto all_exit +$! +$ arch_type = f$getsyi("ARCH_NAME") +$ arch_code = f$extract(0, 1, arch_type) +$! +$ can_build = 1 +$ producer = f$trnlnm("GNV_PCSI_PRODUCER") +$ if producer .eqs. "" +$ then +$ write sys$output "GNV_PCSI_PRODUCER logical name has not been set." +$ can_build = 0 +$ endif +$ producer_full_name = f$trnlnm("GNV_PCSI_PRODUCER_FULL_NAME") +$ if producer_full_name .eqs. "" +$ then +$ write sys$output - + "GNV_PCSI_PRODUCER_FULL_NAME logical name has not been set." +$ can_build = 0 +$ endif +$ stage_root_name = f$trnlnm("STAGE_ROOT") +$ if stage_root_name .eqs. "" +$ then +$ write sys$output "STAGE_ROOT logical name has not been set." +$ can_build = 0 +$ endif +$! +$ if (can_build .eq. 0) +$ then +$ write sys$output "Not able to build a kit." +$ goto all_exit +$ endif +$! +$! +$! Build the gawk image(s) +$!------------------------- +$ if f$search("gawk.exe") .eqs. "" +$ then +$ mmk/descrip=[.vms]descrip.mms gawk +$ endif +$ if arch_code .nes. "V" +$ then +$ if f$search("filefuncs.exe") .eqs. "" +$ then +$ mmk/descrip=[.vms]descrip.mms extensions +$ endif +$ endif +$! +$! Build the gawk_verb.cld +$!------------------------- +$ if f$search("gawk_verb.cld") .eqs. "" +$ then +$ @[.vms]gawk_verb.com +$ endif +$! +$! Stage the images for building the kit +$!-------------------------------------- +$ @[.vms]stage_gawk_install.com remove +$ @[.vms]stage_gawk_install.com +$! +$! +$! +$! Make sure that the kit name is up to date for this build +$!---------------------------------------------------------- +$ @[.vms]make_pcsi_gawk_kit_name.com +$! +$! Make sure that the release note file name is up to date +$!--------------------------------------------------------- +$ @[.vms]build_gawk_release_notes.com +$! +$! +$! Make sure that the source has been backed up. +$!---------------------------------------------- +$ @[.vms]backup_gawk_src.com +$! +$! Regenerate the PCSI description file. +$!-------------------------------------- +$ @[.vms]build_gawk_pcsi_desc.com +$! +$! Regenerate the PCSI Text file. +$!--------------------------------- +$ @[.vms]build_gawk_pcsi_text.com +$! +$! +$! Parse the kit name into components. +$!--------------------------------------- +$ kit_name = f$trnlnm("GNV_PCSI_KITNAME") +$ if kit_name .eqs. "" +$ then +$ write sys$output "@[.vms]make_pcsi_gawk_kit_name.com has not been run." +$ goto all_exit +$ endif +$ producer = f$element(0, "-", kit_name) +$ base = f$element(1, "-", kit_name) +$ product_name = f$element(2, "-", kit_name) +$ mmversion = f$element(3, "-", kit_name) +$ majorver = f$extract(0, 3, mmversion) +$ minorver = f$extract(3, 2, mmversion) +$ updatepatch = f$element(4, "-", kit_name) +$ if updatepatch .eqs. "" then updatepatch = "" +$! +$ version_fao = "!AS.!AS" +$ mmversion = f$fao(version_fao, "''majorver'", "''minorver'") +$ if updatepatch .nes. "" +$ then +$ version = "''mmversion'" + "-" + updatepatch +$ else +$ version = "''mmversion'" +$ endif +$! +$! +$! Move to the base directories +$ current_default = f$environment("DEFAULT") +$ my_dir = f$parse(current_default,,,"DIRECTORY") - "[" - "<" - ">" - "]" +$! +$! +$ source = "''default_dir'" +$ src1 = "new_gnu:[bin]," +$ src2 = "new_gnu:[usr.bin]," +$ src3 = "new_gnu:[vms_bin]," +$ src4 = "new_gnu:[vms_help]," +$ src5 = "new_gnu:[vms_src]," +$ src6 = "new_gnu:[common_src]," +$ src7 = "sys$disk:[''my_dir'],sys$disk:[''my_dir'.vms]," +$ src8 = "new_gnu:[usr.share.awk]," +$ src9 = "new_gnu:[usr.share.man.man1]," +$ src10 = "new_gnu:[usr.share.doc.gawk]," +$ src11 = "new_gnu:[usr.share.info]," +$ src12 = "sys$disk:[''m_dir'.pc.awklib]" +$ gnu_src = src1 + src2 + src3 + src4 + src5 + src6 + src7 + src8 + src9 +$ gnu_src = gnu_src + src10 + src11 + src12 +$! +$! +$ base = "" +$ arch_name = f$edit(f$getsyi("arch_name"),"UPCASE") +$ if arch_name .eqs. "ALPHA" then base = "AXPVMS" +$ if arch_name .eqs. "IA64" then base = "I64VMS" +$ if arch_name .eqs. "VAX" then base = "VAXVMS" +$! +$ if base .eqs. "" then exit 44 +$! +$ pcsi_option = "/option=noconfirm" +$ if arch_code .eqs. "V" +$ then +$ pcsi_option = "" +$ endif +$! +$! +$product package 'product_name' - + /base='base' - + /producer='producer' - + /source='source' - + /destination=STAGE_ROOT:[KIT] - + /material=('gnu_src','source') - + /format=sequential 'pcsi_option' +$! +$! +$! VAX can not do a compressed kit. +$! ZIP -9 "-V" does a better job, so no reason to normally build a compressed +$! kit. +$!---------------------------------- +$if p1 .eqs. "COMPRESSED" +$then +$ if arch_code .nes. "V" +$ then +$ product copy /options=(novalidate, noconfirm) /format=compressed - + 'product_name' - + /source=stage_root:[kit]/dest=stage_root:[kit] - + /version='version'/base='base' +$ endif +$endif +$! +$all_exit: +$ set def 'default_dir' +$ exit diff --git a/vms/remove_old_gawk.com b/vms/remove_old_gawk.com new file mode 100644 index 00000000..ed68fc45 --- /dev/null +++ b/vms/remove_old_gawk.com @@ -0,0 +1,113 @@ +$! File: remove_old_gawk.com +$! +$! This is a procedure to remove the old gawk images that were installed +$! by the GNV kits and replace them with links to the new image. +$! +$! 02-Jan-2014 J. Malmberg Gawk version +$! +$!========================================================================== +$! +$vax = f$getsyi("HW_MODEL") .lt. 1024 +$old_parse = "" +$if .not. VAX +$then +$ old_parse = f$getjpi("", "parse_style_perm") +$ set process/parse=extended +$endif +$! +$old_cutils = "gawk,awk," +$! +$! +$ i = 0 +$cutils_loop: +$ file = f$element(i, ",", old_cutils) +$ if file .eqs. "" then goto cutils_loop_end +$ if file .eqs. "," then goto cutils_loop_end +$ call update_old_image 'file' +$ i = i + 1 +$ goto cutils_loop +$cutils_loop_end: +$! +$! +$if .not. VAX +$then +$ file = "gnv$gnu:[usr.share.man.cat1]awk^.1.gz" +$ if f$search(file) .nes. "" then delete 'file';* +$ file = "gnv$gnu:[usr.share.man.cat1]gawk^.1.gz" +$ if f$search(file) .nes. "" then delete 'file';* +$ file = "gnv$gnu:[usr.share.man.cat1]iawk^.1.gz" +$ if f$search(file) .nes. "" then delete 'file';* +$endif +$! +$! +$if .not. VAX +$then +$ set process/parse='old_parse' +$endif +$! +$all_exit: +$ exit +$! +$! Remove old image or update it if needed. +$!------------------------------------------- +$update_old_image: subroutine +$! +$ file = p1 +$! First get the FID of the new gawk image. +$! Don't remove anything that matches it. +$ new_gawk = f$search("GNV$GNU:[BIN]GNV$''file'.EXE") +$! +$ new_gawk_fid = "No_new_gawk_fid" +$ if new_gawk .nes. "" +$ then +$ new_gawk_fid = f$file_attributes(new_gawk, "FID") +$ endif +$! +$! +$! +$! Now get check the "''file'." and "''file'.exe" +$! May be links or copies. +$! Ok to delete and replace. +$! +$! +$ old_gawk_fid = "No_old_gawk_fid" +$ old_gawk = f$search("gnv$gnu:[bin]''file'.") +$ old_gawk_exe_fid = "No_old_gawk_fid" +$ old_gawk_exe = f$search("gnv$gnu:[bin]''file'.exe") +$ if old_gawk_exe .nes. "" +$ then +$ old_gawk_exe_fid = f$file_attributes(old_gawk_exe, "FID") +$ endif +$! +$ if old_gawk .nes. "" +$ then +$ fid = f$file_attributes(old_gawk, "FID") +$ if fid .nes. new_gawk_fid +$ then +$ if fid .eqs. old_gawk_exe_fid +$ then +$ set file/remove 'old_gawk' +$ else +$ delete 'old_gawk' +$ endif +$ if new_gawk .nes. "" +$ then +$ set file/enter='old_gawk' 'new_gawk' +$ endif +$ endif +$ endif +$! +$ if old_gawk_exe .nes. "" +$ then +$ if old_gawk_fid .nes. new_gawk_fid +$ then +$ delete 'old_gawk_exe' +$ if new_gawk .nes. "" +$ then +$ set file/enter='old_gawk_exe' 'new_gawk' +$ endif +$ endif +$ endif +$! +$ exit +$ENDSUBROUTINE ! Update old image diff --git a/vms/stage_gawk_install.com b/vms/stage_gawk_install.com new file mode 100644 index 00000000..22daf7f5 --- /dev/null +++ b/vms/stage_gawk_install.com @@ -0,0 +1,300 @@ +$! File: stage_gawk_install.com +$! +$! Stages the build products to new_gnu:[...] for testing and for building +$! a kit. +$! +$! If p1 starts with "R" then remove instead of install. +$! +$! The file PCSI_GAWK_FILE_LIST.TXT is read in to get the files other +$! than the release notes file and the source backup file. +$! +$! The PCSI system can really only handle ODS-2 format filenames and +$! assumes that there is only one source directory. It also assumes that +$! all destination files with the same name come from the same source file. +$! +$! +$! 29-Sep-2013 J. Malmberg +$! +$!=========================================================================== +$! +$ arch_type = f$getsyi("ARCH_NAME") +$ arch_code = f$extract(0, 1, arch_type) +$! +$ mode = "install" +$ code = f$extract(0, 1, p1) +$ if code .eqs. "R" .or. code .eqs. "r" then mode = "remove" +$! +$! First create the directories +$!-------------------------------- +$ if mode .eqs. "install" +$ then +$ create/dir new_gnu:[bin]/prot=o:rwed +$ create/dir new_gnu:[vms_bin]/prot=o:rwed +$ create/dir new_gnu:[vms_help]/prot=o:rwed +$ create/dir new_gnu:[lib]/prot=o:rwed +$ create/dir new_gnu:[usr.bin]/prot=o:rwed +$ create/dir new_gnu:[usr.include]/prot=o:rwed +$ create/dir new_gnu:[usr.lib.gawk]/prot=o:rwed +$ create/dir new_gnu:[usr.share.awk]/prot=o:rwed +$ create/dir new_gnu:[usr.share.doc.gawk]/prot=o:rwed +$ create/dir new_gnu:[usr.share.info]/prot=o:rwed +$ create/dir new_gnu:[usr.src.gawk.extension.vms]/prot=o:rwed +$ create/dir new_gnu:[usr.share.doc.man.man1]/prot=o:rwed +$ endif +$! +$ if mode .eqs. "install" +$ then +$ copy [.vms]gnv_gawk_startup.com - + new_gnu:[vms_bin]gnv$gawk_startup.com +$ else +$ file = "new_gnu:[vms_bin]gnv$gawk_startup.com" +$ if f$search(file) .nes. "" then delete 'file';* +$ endif +$! +$! +$! Read through the file list to set up aliases and rename commands. +$!--------------------------------------------------------------------- +$ open/read flst [.vms]pcsi_gawk_file_list.txt +$! +$inst_alias_loop: +$ ! Skip the aliases +$ read/end=inst_file_loop_end flst line_in +$ line_in = f$edit(line_in,"compress,trim,uncomment") +$ if line_in .eqs. "" then goto inst_alias_loop +$ pathname = f$element(0, " ", line_in) +$ linkflag = f$element(1, " ", line_in) +$ if linkflag .nes. "->" then goto inst_alias_done +$ goto inst_alias_loop +$! +$inst_file_loop: +$! +$ read/end=inst_file_loop_end flst line_in +$ line_in = f$edit(line_in,"compress,trim,uncomment") +$ if line_in .eqs. "" then goto inst_file_loop +$! +$inst_alias_done: +$! +$! +$! Skip the directories as we did them above. +$! Just process the files. +$ tdir = f$parse(line_in,,,"DIRECTORY") +$ tdir_len = f$length(tdir) +$ tname = f$parse(line_in,,,"NAME") +$ lctname = f$edit(tname, "LOWERCASE") +$ ttype = f$parse(line_in,,,"TYPE") +$ if arch_code .eqs. "V" +$ then +$ tname = lctname +$ ttype = f$edit(ttype, "LOWERCASE") +$ tdir = f$edit(tdir, "LOWERCASE") +$ endif +$ if tname .eqs. "" then goto inst_file_loop +$ if ttype .eqs. ".dir" then goto inst_file_loop +$! +$! if p1 starts with "R" then remove instead of install. +$! +$! If gnv$xxx.exe, then: +$! Source is []gnv$gawk.exe +$! Destination1 is new_gnu:[bin]gnv$gawk.exe +$! Destination2 is new_gnu:[bin]xxx. (alias) +$! Destination2 is new_gnu:[bin]xxx.exe (alias) +$! We put all in new_gnu:[bin] instead of some in [usr.bin] because +$! older GNV kits incorrectly put some images in [bin] and [bin] +$! comes first in the search list. +$ if f$locate("gnv$", tname) .eq. 0 +$ then +$ myfile_len = f$length(tname) +$ myfile = f$extract(4, myfile_len, tname) +$ source = "[]''myfile'''ttype'" +$ dest1 = "new_gnu:[bin]''tname'''ttype'" +$ dest2 = "new_gnu:[bin]''myfile'." +$ dest3 = "new_gnu:[bin]''myfile'.exe" +$ if mode .eqs. "install" +$ then +$ if f$search(dest1) .eqs. "" then copy 'source' 'dest1' +$ if f$search(dest2) .eqs. "" then set file/enter='dest2' 'dest1' +$ if f$search(dest3) .eqs. "" then set file/enter='dest3' 'dest1' +$ else +$ if f$search(dest2) .nes. "" then set file/remove 'dest2';* +$ if f$search(dest3) .nes. "" then set file/remove 'dest3';* +$ if f$search(dest1) .nes. "" then delete 'dest1';* +$ endif +$ goto inst_file_loop +$ endif +$! +$! If lib.gawk] then +$! source is sys$disk:[] +$! dest is new_gnu:[usr.lib.gawk] +$ if f$locate("lib.gawk]", tdir) .lt. tdir_len +$ then +$! ! Not yet available on VAX/VMS +$ if arch_code .eqs. "V" then goto inst_file_loop +$! +$ source = "[]''tname'''ttype'" +$ dest = "new_gnu:[usr.lib.gawk]''tname'''ttype'" +$ if mode .eqs. "install" +$ then +$ if f$search(dest) .eqs. "" then copy 'source' 'dest' +$ else +$ if f$search(dest) .nes. "" then delete 'dest';* +$ endif +$ goto inst_file_loop +$ endif +$! +$! If .vms_bin] then +$! source is sys$disk:[] +$! dest is [vms_bin] +$ if (f$locate("vms_bin]", tdir) .lt. tdir_len) +$ then +$ if (ttype .eqs. ".cld") +$ then +$ source = "sys$disk:[]''tname'''ttype'" +$ else +$ source = "sys$disk:[.vms]''tname'''ttype'" +$ endif +$ dest = "new_gnu:[vms_bin]''tname'''ttype'" +$ if mode .eqs. "install" +$ then +$ if f$search(dest) .eqs. "" then copy 'source' 'dest' +$ else +$ if f$search(dest) .nes. "" then delete 'dest';* +$ endif +$ goto inst_file_loop +$ endif +$! +$! If .vms_hlp] then +$! source is sys$disk:[.vms] +$! dest is [vms_help] +$ if (f$locate("vms_help]", tdir) .lt. tdir_len) .and. (ttype .eqs. ".hlp") +$ then +$ source = "sys$disk:[.vms]''tname'''ttype'" +$ dest = "new_gnu:[vms_help]''tname'''ttype'" +$ if mode .eqs. "install" +$ then +$ if f$search(dest) .eqs. "" then copy 'source' 'dest' +$ else +$ if f$search(dest) .nes. "" then delete 'dest';* +$ endif +$ goto inst_file_loop +$ endif +$! +$! If doc.gawk] then +$! source is sys$disk:[] or [.readme_d] +$! dest is [usr.share.doc.gawk] +$ if f$locate(".doc.gawk]", tdir) .lt. tdir_len +$ then +$ if lctname .eqs. "readme" .and. ttype .nes. "." +$ then +$ source = "sys$disk:[.README_D]''tname'''ttype'" +$ if f$search(source) .eqs. "" +$ then +$! ! This may be an NFS mangled name on VAX. +$ stype = ttype - "." +$ if stype .nes. "vms" then stype = "$" + stype +$ source = "sys$disk:[.$README_$D]$README.''stype'" +$ endif +$ else +$ source = "sys$disk:[]''tname'''ttype'" +$ if f$search(source) .eqs. "" +$ then +$ source = "sys$disk:[]$''tname'''ttype'" +$ endif +$ endif +$ dest = "new_gnu:[usr.share.doc.gawk]''tname'''ttype'" +$ if mode .eqs. "install" +$ then +$ if f$search(dest) .eqs. "" then copy 'source' 'dest' +$ else +$ if f$search(dest) .nes. "" then delete 'dest';* +$ endif +$ goto inst_file_loop +$ endif +$! +$! If .awk] then +$! source is sys$disk:[.awklib.eg.lib] +$! dest is new_gnu:[usr.share.awk] +$ if f$locate(".awk]", tdir) .lt. tdir_len +$ then +$ source = "[.awklib.eg.lib]''tname'''ttype'" +$ dest = "new_gnu:[usr.share.awk]''tname'''ttype'" +$ if mode .eqs. "install" +$ then +$ if f$search(dest) .eqs. "" then copy 'source' 'dest' +$ else +$ if f$search(dest) .nes. "" then delete 'dest';* +$ endif +$ goto inst_file_loop +$ endif +$! +$! If *.info then +$! source is [.doc]gawk.info +$! dest is [.usr.share.info] +$ if ttype .eqs. ".info" +$ then +$ source = "[.doc]''tname'''ttype'" +$ dest = "new_gnu:[usr.share.info]''tname'''ttype'" +$ if mode .eqs. "install" +$ then +$ if f$search(dest) .eqs. "" then copy 'source' 'dest' +$ else +$ if f$search(dest) .nes. "" then delete 'dest';* +$ endif +$ goto inst_file_loop +$ endif +$! +$! If *.h then +$! source is []*.h +$! dest is [.usr.include] +$ if ttype .eqs. ".h" +$ then +$ source = "[]''tname'''ttype'" +$ dest = "new_gnu:[usr.include]''tname'''ttype'" +$ if mode .eqs. "install" +$ then +$ if f$search(dest) .eqs. "" then copy 'source' 'dest' +$ else +$ if f$search(dest) .nes. "" then delete 'dest';* +$ endif +$ goto inst_file_loop +$ endif +$! +$! If *.opt then +$! source is [.vms]gawk_plugin.opt +$! dest is [.usr.src.gawk.extension.vms] +$ if ttype .eqs. ".opt" +$ then +$ source = "[.vms]''tname'''ttype'" +$ dest = "new_gnu:[usr.src.gawk.extension.vms]''tname'''ttype'" +$ if mode .eqs. "install" +$ then +$ if f$search(dest) .eqs. "" then copy 'source' 'dest' +$ else +$ if f$search(dest) .nes. "" then delete 'dest';* +$ endif +$ goto inst_file_loop +$ endif +$! +$! If xxx.1 then +$! source is [.doc]xxx.1 +$! dest is [usr.share.man.man1] +$ if ttype .eqs. ".1" +$ then +$ source = "[.doc]''tname'''ttype'" +$ dest = "new_gnu:[usr.share.man.man1]''tname'''ttype'" +$ if mode .eqs. "install" +$ then +$ if f$search(dest) .eqs. "" then copy 'source' 'dest' +$ else +$ if f$search(dest) .nes. "" then delete 'dest';* +$ endif +$ goto inst_file_loop +$ endif +$! +$ goto inst_file_loop +$! +$inst_file_loop_end: +$! +$close flst +$! +$all_exit: +$ exit diff --git a/vms/vms_args.c b/vms/vms_args.c index 9788275d..12165131 100644 --- a/vms/vms_args.c +++ b/vms/vms_args.c @@ -1,7 +1,7 @@ /* vms_args.c -- command line parsing, to emulate shell i/o redirection. [ Escape sequence parsing now suppressed. ] - Copyright (C) 1991-1996, 1997, 2011 the Free Software Foundation, Inc. + Copyright (C) 1991-1996, 1997, 2011, 2014 the Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/vms/vms_cli.c b/vms/vms_cli.c index aa093441..08e2d142 100644 --- a/vms/vms_cli.c +++ b/vms/vms_cli.c @@ -1,6 +1,6 @@ /* vms_cli.c -- interface to CLI$xxx routines for fetching command line components - Copyright (C) 1991-1993, 2003, 2011 the Free Software Foundation, Inc. + Copyright (C) 1991-1993, 2003, 2011, 2014 the Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/vms/vms_fwrite.c b/vms/vms_fwrite.c index 435fead2..f29ec832 100644 --- a/vms/vms_fwrite.c +++ b/vms/vms_fwrite.c @@ -1,6 +1,6 @@ /* vms_fwrite.c - augmentation for the fwrite() function. - Copyright (C) 1991-1996, 2010, 2011 the Free Software Foundation, Inc. + Copyright (C) 1991-1996, 2010, 2011, 2014 the Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/vms/vms_gawk.c b/vms/vms_gawk.c index fce0fa85..4080e1db 100644 --- a/vms/vms_gawk.c +++ b/vms/vms_gawk.c @@ -1,6 +1,7 @@ /* vms_gawk.c -- parse GAWK command line using DCL syntax - Copyright (C) 1991-1993, 1996, 2003, 2005, 2011 the Free Software Foundation, Inc. + Copyright (C) 1991-1993, 1996, 2003, 2005, 2011, 2014 + the Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/vms/vms_misc.c b/vms/vms_misc.c index ed479539..82c2f8a8 100644 --- a/vms/vms_misc.c +++ b/vms/vms_misc.c @@ -1,6 +1,6 @@ /* vms_misc.c -- sustitute code for missing/different run-time library routines. - Copyright (C) 1991-1993, 1996-1997, 2001, 2003, 2009, 2010, 2011 + Copyright (C) 1991-1993, 1996-1997, 2001, 2003, 2009, 2010, 2011, 2014 the Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify diff --git a/vms/vms_popen.c b/vms/vms_popen.c index d9568119..23482df1 100644 --- a/vms/vms_popen.c +++ b/vms/vms_popen.c @@ -1,6 +1,7 @@ /* [.vms]vms_popen.c -- substitute routines for missing pipe calls. - Copyright (C) 1991-1993, 1996, 2010, 2011 the Free Software Foundation, Inc. + Copyright (C) 1991-1993, 1996, 2010, 2011, 2014 + the Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/vms/vmstest.com b/vms/vmstest.com index f5c815bc..6d46c4d7 100644 --- a/vms/vmstest.com +++ b/vms/vmstest.com @@ -949,7 +949,12 @@ $ gawk -f nasty.awk >_nasty.tmp $ call fixup_LRL nasty.ok $ call fixup_LRL _nasty.tmp "purge" $ cmp nasty.ok sys$disk:[]_nasty.tmp -$ if $status then rm _nasty.tmp; +$ if $status +$ then +$ rm _nasty.tmp; +$ file = "lcl_root:[]nasty.ok" +$ if f$search(file) .nes. "" then rm 'file';* +$ endif $ set On $ return $ @@ -959,7 +964,12 @@ $ gawk -f nasty2.awk >_nasty2.tmp $ call fixup_LRL nasty2.ok $ call fixup_LRL _nasty2.tmp "purge" $ cmp nasty2.ok sys$disk:[]_nasty2.tmp -$ if $status then rm _nasty2.tmp; +$ if $status +$ then +$ rm _nasty2.tmp; +$ file = "lcl_root:[]nasty2.ok" +$ if f$search(file) .nes. "" then rm 'file';* +$ endif $ set On $ return $ @@ -981,7 +991,6 @@ $ set noOn $ gawk -f 'test'.awk >_'test'.tmp 2>&1 $ if .not. $status then call exit_code '$status' _'test'.tmp $ set On -$ diff 'test'.ok sys$disk:[]_'test'.tmp/out='test'.diff $ cmp 'test'.ok sys$disk:[]_'test'.tmp $ if $status then rm _'test'.tmp; $ return @@ -1770,7 +1779,7 @@ World! $ endif $ gawk /Commands="BEGIN { print ""World!"" }" _NL: /Output=_vms_cmd.tmp $ cmp vms_cmd.ok sys$disk:[]_vms_cmd.tmp -$ if $status then rm _vms_cmd.tmp; +$ if $status then rm _vms_cmd.tmp;,vms_cmd.ok;* $ return $ $vms_io1: echo "vms_io1" @@ -1783,7 +1792,7 @@ $ gawk -f - >_vms_io1.tmp # prior to 3.0.4, gawk crashed doing any redirection after closing stdin BEGIN { print "Hello" >"/dev/stdout" } $ cmp vms_io1.ok sys$disk:[]_vms_io1.tmp -$ if $status then rm _vms_io1.tmp; +$ if $status then rm _vms_io1.tmp;,vms_io1.ok;* $ return $ $vms_io2: echo "vms_io2" @@ -1811,7 +1820,7 @@ $ set On $ cmp _NL: sys$disk:[]_vms_io2.tmp $ if $status then rm _vms_io2.tmp; $ cmp vms_io2.ok sys$disk:[]_vms_io2.vfc -$ if $status then rm _vms_io2.vfc;* +$ if $status then rm _vms_io2.vfc;*,vms_io2.ok;* $ return $! $! @@ -1859,7 +1868,7 @@ $ if .not. $status then call exit_code '$status' _'test'.tmp $ set On $ cmp 'test'.ok sys$disk:[]_'test'.tmp $ if $status then rm _'test'.tmp; -$ if f$search(filefunc_file) .nes. "" then rm 'filefunc_file'; +$ if f$search(filefunc_file) .nes. "" then rm 'filefunc_file';* $ return $! $rwarray: @@ -1877,7 +1886,7 @@ $ write tout "old and new are equal - GOOD" $ close tout $ endif $ cmp 'test'.ok sys$disk:[]_'test'.tmp -$ if $status then rm _'test'.tmp;,orig.out;,new.out; +$ if $status then rm _'test'.tmp;,orig.bin;,orig.out;,new.out; $ return $! $readdir: @@ -1890,6 +1899,8 @@ $ if .not. $status $ then $ call exit_code '$status' _'test'.tmp $ write sys$output _'test'.tmp +$ else +$ rm _'test'.tmp;*,_'test'.;* $ endif $ set On $ return |