| 1 |
$! File: stage_gawk_install.com |
| 2 |
$! |
| 3 |
$! Stages the build products to new_gnu:[...] for testing and for building |
| 4 |
$! a kit. |
| 5 |
$! |
| 6 |
$! If p1 starts with "R" then remove instead of install. |
| 7 |
$! |
| 8 |
$! The file PCSI_GAWK_FILE_LIST.TXT is read in to get the files other |
| 9 |
$! than the release notes file and the source backup file. |
| 10 |
$! |
| 11 |
$! The PCSI system can really only handle ODS-2 format filenames and |
| 12 |
$! assumes that there is only one source directory. It also assumes that |
| 13 |
$! all destination files with the same name come from the same source file. |
| 14 |
$! |
| 15 |
$! |
| 16 |
$! 29-Sep-2013 J. Malmberg |
| 17 |
$! |
| 18 |
$!=========================================================================== |
| 19 |
$! |
| 20 |
$ arch_type = f$getsyi("ARCH_NAME") |
| 21 |
$ arch_code = f$extract(0, 1, arch_type) |
| 22 |
$! |
| 23 |
$ mode = "install" |
| 24 |
$ code = f$extract(0, 1, p1) |
| 25 |
$ if code .eqs. "R" .or. code .eqs. "r" then mode = "remove" |
| 26 |
$! |
| 27 |
$! First create the directories |
| 28 |
$!-------------------------------- |
| 29 |
$ if mode .eqs. "install" |
| 30 |
$ then |
| 31 |
$ create/dir new_gnu:[bin]/prot=o:rwed |
| 32 |
$ create/dir new_gnu:[vms_bin]/prot=o:rwed |
| 33 |
$ create/dir new_gnu:[vms_help]/prot=o:rwed |
| 34 |
$ create/dir new_gnu:[lib]/prot=o:rwed |
| 35 |
$ create/dir new_gnu:[usr.bin]/prot=o:rwed |
| 36 |
$ create/dir new_gnu:[usr.include]/prot=o:rwed |
| 37 |
$ create/dir new_gnu:[usr.lib.gawk]/prot=o:rwed |
| 38 |
$ create/dir new_gnu:[usr.share.awk]/prot=o:rwed |
| 39 |
$ create/dir new_gnu:[usr.share.doc.gawk]/prot=o:rwed |
| 40 |
$ create/dir new_gnu:[usr.share.info]/prot=o:rwed |
| 41 |
$ create/dir new_gnu:[usr.src.gawk.extension.vms]/prot=o:rwed |
| 42 |
$ create/dir new_gnu:[usr.share.man.man1]/prot=o:rwed |
| 43 |
$ endif |
| 44 |
$! |
| 45 |
$ if mode .eqs. "install" |
| 46 |
$ then |
| 47 |
$ copy [.vms]gnv_gawk_startup.com - |
| 48 |
new_gnu:[vms_bin]gnv$gawk_startup.com |
| 49 |
$ else |
| 50 |
$ file = "new_gnu:[vms_bin]gnv$gawk_startup.com" |
| 51 |
$ if f$search(file) .nes. "" then delete 'file';* |
| 52 |
$ endif |
| 53 |
$! |
| 54 |
$! |
| 55 |
$! Read through the file list to set up aliases and rename commands. |
| 56 |
$!--------------------------------------------------------------------- |
| 57 |
$ open/read flst [.vms]pcsi_gawk_file_list.txt |
| 58 |
$! |
| 59 |
$inst_alias_loop: |
| 60 |
$ ! Skip the aliases |
| 61 |
$ read/end=inst_file_loop_end flst line_in |
| 62 |
$ line_in = f$edit(line_in,"compress,trim,uncomment") |
| 63 |
$ if line_in .eqs. "" then goto inst_alias_loop |
| 64 |
$ pathname = f$element(0, " ", line_in) |
| 65 |
$ linkflag = f$element(1, " ", line_in) |
| 66 |
$ if linkflag .nes. "->" then goto inst_alias_done |
| 67 |
$ goto inst_alias_loop |
| 68 |
$! |
| 69 |
$inst_file_loop: |
| 70 |
$! |
| 71 |
$ read/end=inst_file_loop_end flst line_in |
| 72 |
$ line_in = f$edit(line_in,"compress,trim,uncomment") |
| 73 |
$ if line_in .eqs. "" then goto inst_file_loop |
| 74 |
$! |
| 75 |
$inst_alias_done: |
| 76 |
$! |
| 77 |
$! |
| 78 |
$! Skip the directories as we did them above. |
| 79 |
$! Just process the files. |
| 80 |
$ tdir = f$parse(line_in,,,"DIRECTORY") |
| 81 |
$ tdir_len = f$length(tdir) |
| 82 |
$ tname = f$parse(line_in,,,"NAME") |
| 83 |
$ lctname = f$edit(tname, "LOWERCASE") |
| 84 |
$ ttype = f$parse(line_in,,,"TYPE") |
| 85 |
$ if arch_code .eqs. "V" |
| 86 |
$ then |
| 87 |
$ tname = lctname |
| 88 |
$ ttype = f$edit(ttype, "LOWERCASE") |
| 89 |
$ tdir = f$edit(tdir, "LOWERCASE") |
| 90 |
$ endif |
| 91 |
$ if tname .eqs. "" then goto inst_file_loop |
| 92 |
$ if ttype .eqs. ".dir" then goto inst_file_loop |
| 93 |
$! |
| 94 |
$! if p1 starts with "R" then remove instead of install. |
| 95 |
$! |
| 96 |
$! If gnv$xxx.exe, then: |
| 97 |
$! Source is []gnv$gawk.exe |
| 98 |
$! Destination1 is new_gnu:[bin]gnv$gawk.exe |
| 99 |
$! Destination2 is new_gnu:[bin]xxx. (alias) |
| 100 |
$! Destination2 is new_gnu:[bin]xxx.exe (alias) |
| 101 |
$! We put all in new_gnu:[bin] instead of some in [usr.bin] because |
| 102 |
$! older GNV kits incorrectly put some images in [bin] and [bin] |
| 103 |
$! comes first in the search list. |
| 104 |
$ if f$locate("gnv$", tname) .eq. 0 |
| 105 |
$ then |
| 106 |
$ myfile_len = f$length(tname) |
| 107 |
$ myfile = f$extract(4, myfile_len, tname) |
| 108 |
$ source = "[]''myfile'''ttype'" |
| 109 |
$ dest1 = "new_gnu:[bin]''tname'''ttype'" |
| 110 |
$ dest2 = "new_gnu:[bin]''myfile'." |
| 111 |
$ dest3 = "new_gnu:[bin]''myfile'.exe" |
| 112 |
$ if mode .eqs. "install" |
| 113 |
$ then |
| 114 |
$ if f$search(dest1) .eqs. "" then copy 'source' 'dest1' |
| 115 |
$ if f$search(dest2) .eqs. "" then set file/enter='dest2' 'dest1' |
| 116 |
$ if f$search(dest3) .eqs. "" then set file/enter='dest3' 'dest1' |
| 117 |
$ else |
| 118 |
$ if f$search(dest2) .nes. "" then set file/remove 'dest2';* |
| 119 |
$ if f$search(dest3) .nes. "" then set file/remove 'dest3';* |
| 120 |
$ if f$search(dest1) .nes. "" then delete 'dest1';* |
| 121 |
$ endif |
| 122 |
$ goto inst_file_loop |
| 123 |
$ endif |
| 124 |
$! |
| 125 |
$! If lib.gawk] then |
| 126 |
$! source is sys$disk:[] |
| 127 |
$! dest is new_gnu:[usr.lib.gawk] |
| 128 |
$ if f$locate("lib.gawk]", tdir) .lt. tdir_len |
| 129 |
$ then |
| 130 |
$! ! Not yet available on VAX/VMS |
| 131 |
$ if arch_code .eqs. "V" then goto inst_file_loop |
| 132 |
$! |
| 133 |
$ source = "[]''tname'''ttype'" |
| 134 |
$ dest = "new_gnu:[usr.lib.gawk]''tname'''ttype'" |
| 135 |
$ if mode .eqs. "install" |
| 136 |
$ then |
| 137 |
$ if f$search(dest) .eqs. "" then copy 'source' 'dest' |
| 138 |
$ else |
| 139 |
$ if f$search(dest) .nes. "" then delete 'dest';* |
| 140 |
$ endif |
| 141 |
$ goto inst_file_loop |
| 142 |
$ endif |
| 143 |
$! |
| 144 |
$! If .vms_bin] then |
| 145 |
$! source is sys$disk:[] |
| 146 |
$! dest is [vms_bin] |
| 147 |
$ if (f$locate("vms_bin]", tdir) .lt. tdir_len) |
| 148 |
$ then |
| 149 |
$ if (ttype .eqs. ".cld") |
| 150 |
$ then |
| 151 |
$ source = "sys$disk:[]''tname'''ttype'" |
| 152 |
$ else |
| 153 |
$ source = "sys$disk:[.vms]''tname'''ttype'" |
| 154 |
$ endif |
| 155 |
$ dest = "new_gnu:[vms_bin]''tname'''ttype'" |
| 156 |
$ if mode .eqs. "install" |
| 157 |
$ then |
| 158 |
$ if f$search(dest) .eqs. "" then copy 'source' 'dest' |
| 159 |
$ else |
| 160 |
$ if f$search(dest) .nes. "" then delete 'dest';* |
| 161 |
$ endif |
| 162 |
$ goto inst_file_loop |
| 163 |
$ endif |
| 164 |
$! |
| 165 |
$! If .vms_hlp] then |
| 166 |
$! source is sys$disk:[.vms] |
| 167 |
$! dest is [vms_help] |
| 168 |
$ if (f$locate("vms_help]", tdir) .lt. tdir_len) .and. (ttype .eqs. ".hlp") |
| 169 |
$ then |
| 170 |
$ source = "sys$disk:[.vms]''tname'''ttype'" |
| 171 |
$ dest = "new_gnu:[vms_help]''tname'''ttype'" |
| 172 |
$ if mode .eqs. "install" |
| 173 |
$ then |
| 174 |
$ if f$search(dest) .eqs. "" then copy 'source' 'dest' |
| 175 |
$ else |
| 176 |
$ if f$search(dest) .nes. "" then delete 'dest';* |
| 177 |
$ endif |
| 178 |
$ goto inst_file_loop |
| 179 |
$ endif |
| 180 |
$! |
| 181 |
$! If doc.gawk] then |
| 182 |
$! source is sys$disk:[] or [.readme_d] |
| 183 |
$! dest is [usr.share.doc.gawk] |
| 184 |
$ if f$locate(".doc.gawk]", tdir) .lt. tdir_len |
| 185 |
$ then |
| 186 |
$ if lctname .eqs. "readme" .and. ttype .nes. "." |
| 187 |
$ then |
| 188 |
$ source = "sys$disk:[.README_D]''tname'''ttype'" |
| 189 |
$ if f$search(source) .eqs. "" |
| 190 |
$ then |
| 191 |
$! ! This may be an NFS mangled name on VAX. |
| 192 |
$ stype = ttype - "." |
| 193 |
$ if stype .nes. "vms" then stype = "$" + stype |
| 194 |
$ source = "sys$disk:[.$README_$D]$README.''stype'" |
| 195 |
$ endif |
| 196 |
$ else |
| 197 |
$ source = "sys$disk:[]''tname'''ttype'" |
| 198 |
$ if f$search(source) .eqs. "" |
| 199 |
$ then |
| 200 |
$ source = "sys$disk:[]$''tname'''ttype'" |
| 201 |
$ endif |
| 202 |
$ endif |
| 203 |
$ dest = "new_gnu:[usr.share.doc.gawk]''tname'''ttype'" |
| 204 |
$ if mode .eqs. "install" |
| 205 |
$ then |
| 206 |
$ if f$search(dest) .eqs. "" then copy 'source' 'dest' |
| 207 |
$ else |
| 208 |
$ if f$search(dest) .nes. "" then delete 'dest';* |
| 209 |
$ endif |
| 210 |
$ goto inst_file_loop |
| 211 |
$ endif |
| 212 |
$! |
| 213 |
$! If .awk] then |
| 214 |
$! source is sys$disk:[.awklib.eg.lib] |
| 215 |
$! dest is new_gnu:[usr.share.awk] |
| 216 |
$ if f$locate(".awk]", tdir) .lt. tdir_len |
| 217 |
$ then |
| 218 |
$ source = "[.awklib.eg.lib]''tname'''ttype'" |
| 219 |
$ dest = "new_gnu:[usr.share.awk]''tname'''ttype'" |
| 220 |
$ if mode .eqs. "install" |
| 221 |
$ then |
| 222 |
$ if f$search(dest) .eqs. "" then copy 'source' 'dest' |
| 223 |
$ else |
| 224 |
$ if f$search(dest) .nes. "" then delete 'dest';* |
| 225 |
$ endif |
| 226 |
$ goto inst_file_loop |
| 227 |
$ endif |
| 228 |
$! |
| 229 |
$! If *.info then |
| 230 |
$! source is [.doc]gawk.info |
| 231 |
$! dest is [.usr.share.info] |
| 232 |
$ if ttype .eqs. ".info" |
| 233 |
$ then |
| 234 |
$ source = "[.doc]''tname'''ttype'" |
| 235 |
$ dest = "new_gnu:[usr.share.info]''tname'''ttype'" |
| 236 |
$ if mode .eqs. "install" |
| 237 |
$ then |
| 238 |
$ if f$search(dest) .eqs. "" then copy 'source' 'dest' |
| 239 |
$ else |
| 240 |
$ if f$search(dest) .nes. "" then delete 'dest';* |
| 241 |
$ endif |
| 242 |
$ goto inst_file_loop |
| 243 |
$ endif |
| 244 |
$! |
| 245 |
$! If *.h then |
| 246 |
$! source is []*.h |
| 247 |
$! dest is [.usr.include] |
| 248 |
$ if ttype .eqs. ".h" |
| 249 |
$ then |
| 250 |
$ source = "[]''tname'''ttype'" |
| 251 |
$ dest = "new_gnu:[usr.include]''tname'''ttype'" |
| 252 |
$ if mode .eqs. "install" |
| 253 |
$ then |
| 254 |
$ if f$search(dest) .eqs. "" then copy 'source' 'dest' |
| 255 |
$ else |
| 256 |
$ if f$search(dest) .nes. "" then delete 'dest';* |
| 257 |
$ endif |
| 258 |
$ goto inst_file_loop |
| 259 |
$ endif |
| 260 |
$! |
| 261 |
$! If *.opt then |
| 262 |
$! source is [.vms]gawk_plugin.opt |
| 263 |
$! dest is [.usr.src.gawk.extension.vms] |
| 264 |
$ if ttype .eqs. ".opt" |
| 265 |
$ then |
| 266 |
$ source = "[.vms]''tname'''ttype'" |
| 267 |
$ dest = "new_gnu:[usr.src.gawk.extension.vms]''tname'''ttype'" |
| 268 |
$ if mode .eqs. "install" |
| 269 |
$ then |
| 270 |
$ if f$search(dest) .eqs. "" then copy 'source' 'dest' |
| 271 |
$ else |
| 272 |
$ if f$search(dest) .nes. "" then delete 'dest';* |
| 273 |
$ endif |
| 274 |
$ goto inst_file_loop |
| 275 |
$ endif |
| 276 |
$! |
| 277 |
$! If xxx.1 then |
| 278 |
$! source is [.doc]xxx.1 |
| 279 |
$! dest is [usr.share.man.man1] |
| 280 |
$ if ttype .eqs. ".1" |
| 281 |
$ then |
| 282 |
$ source = "[.doc]''tname'''ttype'" |
| 283 |
$ dest = "new_gnu:[usr.share.man.man1]''tname'''ttype'" |
| 284 |
$ if mode .eqs. "install" |
| 285 |
$ then |
| 286 |
$ if f$search(dest) .eqs. "" then copy 'source' 'dest' |
| 287 |
$ else |
| 288 |
$ if f$search(dest) .nes. "" then delete 'dest';* |
| 289 |
$ endif |
| 290 |
$ goto inst_file_loop |
| 291 |
$ endif |
| 292 |
$! |
| 293 |
$ goto inst_file_loop |
| 294 |
$! |
| 295 |
$inst_file_loop_end: |
| 296 |
$! |
| 297 |
$close flst |
| 298 |
$! |
| 299 |
$all_exit: |
| 300 |
$ exit |