xref: /curl/packages/vms/backup_gnv_curl_src.com (revision 2bc1d775)
1$! File: Backup_gnv_curl_src.com
2$!
3$! Procedure to create backup save sets for installing in a PCSI kit.
4$!
5$! To comply with most Open Source licenses, the source used for building
6$! a kit will be packaged with the distribution kit for the binary.
7$!
8$! Backup save sets are the only storage format that I can expect a
9$! VMS system to be able to extract ODS-5 filenames and directories.
10$!
11$! The make_pcsi_kit_name.com needs to be run before this procedure to
12$! properly name the files that will be created.
13$!
14$! This file is created from a template file for the purpose of making it
15$! easier to port Unix code, particularly open source code to VMS.
16$! Therefore permission is freely granted for any use.
17$!
18$! Copyright (C) John Malmberg
19$!
20$! Permission to use, copy, modify, and/or distribute this software for any
21$! purpose with or without fee is hereby granted, provided that the above
22$! copyright notice and this permission notice appear in all copies.
23$!
24$! THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
25$! WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
26$! MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
27$! ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
28$! WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
29$! ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
30$! OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
31$!
32$! SPDX-License-Identifier: ISC
33$!
34$!===========================================================================
35$!
36$! Save default
37$ default_dir = f$environment("DEFAULT")
38$!
39$ arch_type = f$getsyi("ARCH_NAME")
40$ arch_code = f$extract(0, 1, arch_type)
41$!
42$ if arch_code .nes. "V"
43$ then
44$   set proc/parse=extended
45$ endif
46$!
47$ ss_abort = 44
48$ status = ss_abort
49$!
50$ kit_name = f$trnlnm("GNV_PCSI_KITNAME")
51$ if kit_name .eqs. ""
52$ then
53$   write sys$output "@MAKE_PCSI_CURL_KIT_NAME.COM has not been run."
54$   goto all_exit
55$ endif
56$ producer = f$trnlnm("GNV_PCSI_PRODUCER")
57$ if producer .eqs. ""
58$ then
59$   write sys$output "@MAKE_PCSI_CURL_KIT_NAME.COM has not been run."
60$   goto all_exit
61$ endif
62$ filename_base = f$trnlnm("GNV_PCSI_FILENAME_BASE")
63$ if filename_base .eqs. ""
64$ then
65$   write sys$output "@MAKE_PCSI_CURL_KIT_NAME.COM has not been run."
66$   goto all_exit
67$ endif
68$!
69$ node_swvers = f$getsyi("NODE_SWVERS")
70$ node_swvers_type = f$extract(0, 1, node_swvers)
71$ node_swvers_vers = f$extract(1, f$length(node_swvers), node_swvers)
72$ swvers_maj = f$element(0, ".", node_swvers_vers)
73$ node_swvers_min_update = f$element(1, ".", node_swvers_vers)
74$ swvers_min = f$element(0, "-", node_swvers_min_update)
75$ swvers_update = f$element(1, "-", node_swvers_min_update)
76$!
77$ if swvers_update .eqs. "-" then swvers_update = ""
78$!
79$ vms_vers = f$fao("!2ZB!2ZB!AS", 'swvers_maj', 'swvers_min', swvers_update)
80$!
81$!
82$!
83$! If available make an interchange save set
84$!-------------------------------------------
85$ interchange = ""
86$ if arch_code .eqs. "V"
87$ then
88$   interchange = "/interchange"
89$ endif
90$ if (swvers_maj .ges. "8") .and. (swvers_min .ges. 4)
91$ then
92$   interchange = "/interchange/noconvert"
93$ endif
94$!
95$!
96$! Move to the base directories
97$ set def [--]
98$!
99$! Put things back on error.
100$ on warning then goto all_exit
101$!
102$ current_default = f$environment("DEFAULT")
103$ my_dir = f$parse(current_default,,,"DIRECTORY") - "[" - "<" - ">" - "]"
104$!
105$ src_root = "src_root:"
106$ if f$trnlnm("src_root1") .nes. "" then src_root = "src_root1:"
107$ backup'interchange' 'src_root'[curl...]*.*;0 -
108           'filename_base'_original_src.bck/sav
109$ status = $status
110$!
111$! There may be a VMS specific source kit
112$!-----------------------------------------
113$ vms_root = "vms_root:"
114$ if f$trnlnm("vms_root1") .nes. "" then vms_root = "vms_root1:"
115$ files_found = 0
116$ define/user sys$error nl:
117$ define/user sys$output nl:
118$ directory 'vms_root'[...]*.*;*/exc=*.dir
119$ if '$severity' .eq. 1 then files_found = 1
120$!
121$ if files_found .eq. 1
122$ then
123$   backup'interchange' 'vms_root'[curl...]*.*;0 -
124            'filename_base'_vms_src.bck/sav
125$   status = $status
126$ endif
127$!
128$all_exit:
129$ set def 'default_dir'
130$ exit
131