1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 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
|