backup_gnv_curl_src.com 4.1 KB

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