1 $! File: Build_GNV_CURL_PCSI_DESC.COM
5 $! Build the *.pcsi$text file in the following sections:
6 $! Required software dependencies.
7 $! install/upgrade/postinstall steps.
8 $! 1. Duplicate filenames need an alias procedure. (N/A for curl)
9 $! 2. ODS-5 filenames need an alias procedure. (N/A for curl)
10 $! 3. Special alias links for executables (curl. -> curl.exe)
11 $! if a lot, then an alias procedure is needed.
12 $! 4. Rename the files to lowercase.
13 $! Move Release Notes to destination
15 $! Create directory lines
16 $! Add file lines for curl.
17 $! Add Link alias procedure file (N/A for curl)
18 $! Add [.SYS$STARTUP]curl_startup file
19 $! Add Release notes file.
21 $! The file PCSI_GNV_CURL_FILE_LIST.TXT is read in to get the files other
22 $! than the release notes file and the source backup file.
24 $! The PCSI system can really only handle ODS-2 format filenames and
25 $! assumes that there is only one source directory. It also assumes that
26 $! all destination files with the same name come from the same source file.
27 $! Fortunately CURL does not trip most of these issues, so those steps
28 $! above are marked N/A.
30 $! A rename action section is needed to make sure that the files are
31 $! created in the GNV$GNU: in the correct case, and to create the alias
32 $! link [usr.bin]curl. for [usr.bin]curl.exe.
34 $! Copyright 2009, John Malmberg
36 $! Permission to use, copy, modify, and/or distribute this software for any
37 $! purpose with or without fee is hereby granted, provided that the above
38 $! copyright notice and this permission notice appear in all copies.
40 $! THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
41 $! WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
42 $! MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
43 $! ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
44 $! WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
45 $! ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
46 $! OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
49 $! 15-Jun-2009 J. Malmberg
51 $!===========================================================================
53 $ kit_name = f$trnlnm("GNV_PCSI_KITNAME")
54 $ if kit_name .eqs. ""
56 $ write sys$output "@MAKE_PCSI_CURL_KIT_NAME.COM has not been run."
59 $ producer = f$trnlnm("GNV_PCSI_PRODUCER")
60 $ if producer .eqs. ""
62 $ write sys$output "@MAKE_PCSI_CURL_KIT_NAME.COM has not been run."
65 $ filename_base = f$trnlnm("GNV_PCSI_FILENAME_BASE")
66 $ if filename_base .eqs. ""
68 $ write sys$output "@MAKE_PCSI_CURL_KIT_NAME.COM has not been run."
73 $! Parse the kit name into components.
74 $!---------------------------------------
75 $ producer = f$element(0, "-", kit_name)
76 $ base = f$element(1, "-", kit_name)
77 $ product = f$element(2, "-", kit_name)
78 $ mmversion = f$element(3, "-", kit_name)
79 $ majorver = f$extract(0, 3, mmversion)
80 $ minorver = f$extract(3, 2, mmversion)
81 $ updatepatch = f$element(4, "-", kit_name)
82 $ if updatepatch .eqs. "-" then updatepatch = ""
84 $! kit type of "D" means a daily build
85 $ kit_type = f$edit(f$extract(0, 1, majorver), "upcase")
88 $ product_line = "product ''producer' ''base' ''product'"
89 $ if updatepatch .eqs. ""
91 $ product_name = " ''majorver'.''minorver'"
93 $ product_name = " ''majorver'.''minorver'-''updatepatch'"
95 $ product_line = product_line + " ''product_name' full;"
96 $!write sys$output product_line
100 $! Create the file as a VMS text file.
101 $!----------------------------------------
102 $ base_file = kit_name
103 $ create 'base_file'.pcsi$desc
106 $! Start building file.
107 $!----------------------
108 $ open/append pdsc 'base_file'.pcsi$desc
110 $ write pdsc product_line
112 $! Required product dependencies.
113 $!----------------------------------
115 $ if base .eqs. "I64VMS" then vmsprd = "HP"
117 $ write pdsc " software ''vmsprd' ''base' VMS ;"
118 $ arch_type = f$getsyi("ARCH_NAME")
119 $ node_swvers = f$getsyi("node_swvers")
120 $ vernum = f$extract(1, f$length(node_swvers), node_swvers)
121 $ majver = f$element(0, ".", vernum)
122 $ minverdash = f$element(1, ".", vernum)
123 $ minver = f$element(0, "-", minverdash)
124 $ dashver = f$element(1, "-", minverdash)
125 $ if dashver .eqs. "-" then dashver = ""
126 $ vmstag = majver + minver + dashver
127 $ code = f$extract(0, 1, arch_type)
128 $ arch_code = f$extract(0, 1, arch_type)
130 " if (not <software ''vmsprd' ''base' VMS version minimum ''node_swvers'>) ;"
131 $ write pdsc " error NEED_VMS''vmstag';"
132 $ write pdsc " end if;"
134 $write pdsc " software VMSPORTS ''base' ZLIB ;"
136 " if (not <software VMSPORTS ''base' ZLIB version minimum V1.2-8>) ;"
137 $write pdsc " error NEED_ZLIB;"
138 $write pdsc " end if;"
142 $! install/upgrade/postinstall steps.
143 $!-----------------------------------
144 $! 1. Duplicate filenames need an alias procedure. (N/A for curl)
145 $! 2. ODS-5 filenames need an alias procedure. (N/A for curl)
146 $! 3. Special alias links for executables (curl. -> curl.exe)
147 $! if a lot, then an alias procedure is needed.
148 $! 4. Rename the files to lowercase.
151 $! Alias links needed.
152 $!-------------------------
153 $ add_alias_lines = ""
154 $ rem_alias_lines = ""
157 $! Read through the file list to set up aliases and rename commands.
158 $!---------------------------------------------------------------------
159 $ open/read flst pcsi_gnv_curl_file_list.txt
162 $ read/end=inst_alias_loop_end flst line_in
163 $ line_in = f$edit(line_in,"compress,trim,uncomment")
164 $ if line_in .eqs. "" then goto inst_alias_loop
165 $ pathname = f$element(0, " ", line_in)
166 $ linkflag = f$element(1, " ", line_in)
168 $ if linkflag .nes. "->" then goto inst_alias_write
170 $ linktarget = f$element(2, " ", line_in)
171 $ if kit_type .eqs. "D"
173 $ old_start = f$locate("[gnv.usr", pathname)
174 $ if old_start .lt. f$length(pathname)
176 $ pathname = "[gnv.beta" + pathname - "[gnv.usr"
177 $ linktarget = "[gnv.beta" + linktarget - "[gnv.usr"
180 $ nlink = "pcsi$destination:" + pathname
181 $ ntarg = "pcsi$destination:" + linktarget
182 $ new_add_alias_line = -
183 """if f$search(""""''nlink'"""") .eqs. """""""" then" + -
184 " set file/enter=''nlink' ''ntarg'"""
185 $ if add_alias_lines .nes. ""
187 $ add_alias_lines = add_alias_lines + "," + new_add_alias_line
189 $ add_alias_lines = new_add_alias_line
192 $ new_rem_alias_line = -
193 """if f$search(""""''nlink'"""") .nes. """""""" then" + -
194 " set file/remove ''nlink';"""
195 $ if rem_alias_lines .nes. ""
197 $ rem_alias_lines = rem_alias_lines + "," + new_rem_alias_line
199 $ rem_alias_lines = new_rem_alias_line
202 $ goto inst_alias_loop
206 $! execute install / remove
207 $ write pdsc " execute install ("
211 $ line = f$element(i, ",", add_alias_lines)
213 $ if line .eqs. "" then goto ex_ins_loop
214 $ if line .eqs. "," then goto ex_ins_loop_end
215 $ if line_out .nes. "" then write pdsc line_out,","
219 $ write pdsc line_out
222 $ write pdsc " remove ("
226 $ line = f$element(i, ",", rem_alias_lines)
228 $ if line .eqs. "" then goto ex_rem_loop
229 $ if line .eqs. "," then goto ex_rem_loop_end
230 $ if line_out .nes. "" then write pdsc line_out,","
234 $ write pdsc line_out
239 $ write pdsc " execute upgrade ("
242 $ line = f$element(i, ",", rem_alias_lines)
244 $ if line .eqs. "" then goto ex_upg_loop
245 $ if line .eqs. "," then goto ex_upg_loop_end
246 $ if line_out .nes. "" then write pdsc line_out,","
250 $ write pdsc line_out
255 $! execute postinstall
256 $ write pdsc " execute postinstall ("
257 $ if arch_code .nes. "V"
259 $ line_out = " ""set process/parse=extended"""
263 $ line = f$element(i, ",", add_alias_lines)
265 $ if line .eqs. "" then goto ex_pins_loop
266 $ if line .eqs. "," then goto ex_pins_loop_end
267 $ if line_out .nes. "" then write pdsc line_out,","
271 $ if line_out .eqs. "" then line_out = " ""continue"""
272 $! write pdsc line_out
274 $! add aliases and follow with renames.
279 $ read/end=inst_alias_loop_end flst line_in
280 $ line_in = f$edit(line_in,"compress,trim,uncomment")
281 $ if line_in .eqs. "" then goto inst_dir_loop
283 $ pathname = f$element(0, " ", line_in)
284 $ if kit_type .eqs. "D"
286 $ if pathname .eqs. "[gnv]usr.dir"
288 $ pathname = "[gnv]beta.dir"
290 $ old_start = f$locate("[gnv.usr", pathname)
291 $ if old_start .lt. f$length(pathname)
293 $ pathname = "[gnv.beta" + pathname - "[gnv.usr"
298 $! Ignore the directory entries for now.
299 $!-----------------------------------------
300 $ filedir = f$parse(pathname,,,"DIRECTORY")
301 $ if pathname .eqs. filedir then goto inst_dir_loop
303 $! process .dir extensions for rename
304 $! If this is not a directory then start processing files.
305 $!-------------------------
306 $ filetype = f$parse(pathname,,,"TYPE")
307 $ filetype_u = f$edit(filetype, "upcase")
308 $ filename = f$parse(pathname,,,"NAME")
309 $ if filetype_u .nes. ".DIR" then goto inst_file
311 $! process directory lines for rename.
312 $!--------------------------------------
313 $ if line_out .nes. ""
315 $ write pdsc line_out,","
318 $ if arch_code .nes. "V"
320 $ if line_out .nes. "" then write pdsc line_out,","
321 $ line_out = " ""rename pcsi$destination:''pathname' ''filename'.DIR"""
323 $ if line_out .nes. "" then write pdsc line_out
329 $! process file lines for rename
330 $!---------------------------------
332 $ read/end=inst_alias_loop_end flst line_in
333 $ line_in = f$edit(line_in,"compress,trim,uncomment")
334 $ if line_in .eqs. "" then goto inst_dir_loop
335 $ pathname = f$element(0, " ", line_in)
336 $ if kit_type .eqs. "D"
338 $ if pathname .eqs. "[gnv]usr.dir"
340 $ pathname = "[gnv]beta.dir"
342 $ old_start = f$locate("[gnv.usr", pathname)
343 $ if old_start .lt. f$length(pathname)
345 $ pathname = "[gnv.beta" + pathname - "[gnv.usr"
350 $! Filenames with $ in them are VMS special and do not need to be lowercased.
351 $! --------------------------------------------------------------------------
352 $ if f$locate("$", pathname) .lt. f$length(pathname) then goto inst_file_loop
354 $ filetype = f$parse(pathname,,,"TYPE")
355 $ filename = f$parse(pathname,,,"NAME") + filetype
357 $ if arch_code .nes. "V"
359 $ if line_out .nes. "" then write pdsc line_out,","
360 $ filetype = f$parse(pathname,,,"TYPE")
361 $ filename = f$parse(pathname,,,"NAME") + filetype
362 $ line_out = " ""rename pcsi$destination:''pathname' ''filename'"""
364 $ if line_out .nes. "" then write pdsc line_out
367 $ goto inst_file_loop
369 $inst_alias_loop_end:
375 $! Move Release Notes to destination
376 $!-------------------------------------
377 $write pdsc " information RELEASE_NOTES phase after ;"
380 $!---------------------
381 $write pdsc " option SOURCE default 0;"
382 $write pdsc " directory ""[gnv.common_src]"" PROTECTION PUBLIC ;"
384 " file ""[gnv.common_src]''filename_base'_original_src.bck"""
386 " source [common_src]''filename_base'_original_src.bck ;"
387 $if f$search("gnv$gnu:[vms_src]''filename_base'_vms_src.bck") .nes. ""
389 $ write pdsc " directory ""[gnv.vms_src]"" PROTECTION PUBLIC ;"
390 $ write pdsc " file ""[gnv.vms_src]''filename_base'_vms_src.bck"""
391 $ write pdsc " source [vms_src]''filename_base'_vms_src.bck ;"
393 $write pdsc " end option;"
396 $! Read through the file list again.
397 $!----------------------------------
398 $open/read flst pcsi_gnv_curl_file_list.txt
401 $! Create directory lines
402 $!-------------------------
404 $ read/end=flst_loop_end flst line_in
405 $ line_in = f$edit(line_in,"compress,trim,uncomment")
406 $ if line_in .eqs. "" then goto flst_dir_loop
408 $ filename = f$element(0, " ", line_in)
409 $ linkflag = f$element(1, " ", line_in)
410 $ if linkflag .eqs. "->" then goto flst_dir_loop
412 $! Ignore .dir extensions
413 $!-------------------------
414 $ filetype = f$edit(f$parse(filename,,,"TYPE"), "upcase")
415 $ if filetype .eqs. ".DIR" then goto flst_dir_loop
417 $ destname = filename
418 $ if kit_type .eqs. "D"
420 $ old_start = f$locate("[gnv.usr", destname)
421 $ if old_start .lt. f$length(destname)
423 $ destname = "[gnv.beta" + destname - "[gnv.usr"
427 $! It should be just a directory then.
428 $!-------------------------------------
429 $ filedir = f$edit(f$parse(filename,,,"DIRECTORY"), "lowercase")
430 $! If this is not a directory then start processing files.
431 $!---------------------------------------------------------
432 $ if filename .nes. filedir then goto flst_file
434 $ write pdsc " directory ""''destname'"" PROTECTION PUBLIC ;"
438 $! Add file lines for curl.
439 $!---------------------------
441 $ read/end=flst_loop_end flst line_in
442 $ line_in = f$edit(line_in,"compress,trim,uncomment")
443 $ if line_in .eqs. "" then goto inst_file_loop
444 $ filename = f$element(0, " ", line_in)
445 $ destname = filename
446 $ if kit_type .eqs. "D"
448 $ old_start = f$locate("[gnv.usr", destname)
449 $ if old_start .lt. f$length(destname)
451 $ destname = "[gnv.beta" + destname - "[gnv.usr"
455 $ srcfile = filename - "gnv."
456 $ write pdsc " file ""''destname'"" "
457 $ write pdsc " source ""''srcfile'"" ;"
458 $ goto flst_file_loop
463 $! Add Link alias procedure file (N/A for curl)
464 $!------------------------------------------------
466 $! Add [.SYS$STARTUP]curl_startup file
467 $!---------------------------------------
468 $ if kit_type .eqs. "D"
470 $ write pdsc " file ""[sys$startup]curl_daily_startup.com"""
472 $ write pdsc " file ""[sys$startup]curl_startup.com"""
474 $ write pdsc " source [usr.lib]curl_startup.com ;"
476 $! Add Release notes file.
477 $!------------------------------
479 " file ""[SYSHLP]''filename_base'.release_notes"" release notes ;"
481 $! Close the product file
482 $!------------------------
483 $ write pdsc "end product;"