[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference rocks::dec_edi

Title:DEC/EDI
Notice:DEC/EDI V2.1 - see note 2002
Moderator:METSYS::BABER
Created:Wed Jun 06 1990
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:3150
Total number of notes:13466

2984.0. "DEC/EDI kits downloadable via Web browser - kit location" by METSYS::REID (David Reid, EDI engineering) Thu Jan 23 1997 11:03

T.RTitleUserPersonal
Name
DateLines
2984.1CSCEDI$ toolsCX3PST::MICK::M_BEACHMike, USCSCSat Jan 25 1997 00:02893
David...

> ...tells me you periodically scan these directories
> and create a VMSinstal save-set containing the latest patches.

yep...ediecokit.com attached...use/modify/share as desired...
kits are not VMSINSTALable...kits are VMS backup savesets which include:
(a) patches, aka EDIENG::USER2:[DECEDI_*_PATCHES]*.*;0, 
(b) DECEDI$INSTALL_PATCHES.TXT (attached), which are installation instructions 
    referencing DECEDI$INSTALL_PATCHES.COM (also attached), a quick-n-dirty 
    proc which could be better (next step: VMSINSTALable), and 
(c) a date-stamped DECEDI$*_PATCHES_yymmdd.RELEASE_NOTES (yymmdd = latest 
    EDIENG:: file creation date) created from EDIENG'S *README* files.

> Ideally, we would like to start making patches available via
> the Web, and also on the DEC/EDI Users Group Web site.
> Any comments on how we could best do this, to make yours and
> our life easier would be welcome.

Create (or modify attached) a command procedure that generates/distributes 
VMSINSTALable, decstd204-named savesets, for all versions and all platforms, 
automatically upon any detection of new file in the edieng patch directories.
Resubmits nightly.

Help yourself...G'luck...
...Mike

$ verify=f$verify(0)
$ debug = 0
$ if debug then set verify
$!============================================================================
$! EDIECOKIT.COM
$  software_version = "X1.4, 24-JAN-1997"
$! P1 = "?" = Help
$!============================================================================
$ on control_y then goto abort
$ on error then goto abort
$ gosub ini_initialization
$ gosub prc_process
$ gosub sub_submit
$ goto exit
$!========================================================================
$hlp_help:
$ on control_y then goto abort
$ on error then goto abort
$!
$ say "-I-HELP, ''proc' ''software_version'"
$ wrt ""
$ wrt "  @''proc' [qualifier] [qualifier] [...] "
$ wrt ""
$ wrt "  where ""qualifier"" = "
$ wrt ""
$ wrt "    [NO]UPDATE = submit batch patches update, if needed (def UPDATE)"
$ wrt "    [NO]KIT    = build kit, regardless of need          (def NOKIT)"
$ wrt "    [NO]LIST   = list new/modified filenames/dates      (def LIST)"
$ wrt ""
$!
$hlp_exit:
$ return
$!========================================================================
$ini_initialization:
$!
$! rel'n' = 
$! "label,srcfilspec,updfilspec,docfilspec,notfilspec,kitfilspec,relfilspec;..."
$! notfilspec = "*" = parsed latest file creation date yymmdd
$! kitfilspec = "*" = parsed system, e.g., AXP or VAX
$! src + tol + ins + ( ins + doc = not) -> upd -> bld -> kit -> rel
$!
$ rel1 = "v1.3A," + -
  "EDIENG::USER2:[DECEDI_V13A_PATCHES],CSCEDI$:[V13A.PATCHES]," + -
  "README.TXT,DECEDI$V13A_PATCHES_*.RELEASE_NOTES," + -
  "CSCEDI:DECEDI$V13A_PATCHES.BCK,GATEWY::DECEDI$PUBLIC:;"
$ rel2 = "v2.0," + -
  "EDIENG::USER2:[DECEDI_V20_PATCHES],CSCEDI$:[V20.PATCHES]," + -
  "README.TXT,DECEDI$V20_PATCHES_*.RELEASE_NOTES," + -
  "CSCEDI:DECEDI$V20_*_PATCHES.BCK,GATEWY::DECEDI$PUBLIC:;"
$ rel3 = "v2.1," + -
  "EDIENG::USER2:[DECEDI_V21_PATCHES],CSCEDI$:[V21.PATCHES]," + -
  "$$README_FIRST.TXT,DECEDI$V21_PATCHES_*.RELEASE_NOTES," + -
  "CSCEDI:DECEDI$V21_*_PATCHES.BCK,GATEWY::DECEDI$PUBLIC:;"
$ rel4 = "v2.1A," + -
  "EDIENG::USER2:[DECEDI_V21A_PATCHES],CSCEDI$:[V21A.PATCHES]," + -
  "$$README_FIRST.TXT,DECEDI$V21A_PATCHES_*.RELEASE_NOTES," + -
  "CSCEDI:DECEDI$V21A_*_PATCHES.BCK,GATEWY::DECEDI$PUBLIC:;"
$ rel5 = "v2.1B," + -
  "EDIENG::USER2:[DECEDI_V21B_PATCHES],CSCEDI$:[V21B.PATCHES]," + -
  "$$README_FIRST.TXT,DECEDI$V21B_PATCHES_*.RELEASE_NOTES," + -
  "CSCEDI:DECEDI$V21B_*_PATCHES.BCK,GATEWY::DECEDI$PUBLIC:;"
$ rel6 = "v2.1C," + -
  "EDIENG::USER2:[DECEDI_V21C_PATCHES],CSCEDI$:[V21C.PATCHES]," + -
  "$$README_FIRST.TXT,DECEDI$V21C_PATCHES_*.RELEASE_NOTES," + -
  "CSCEDI:DECEDI$V21C_*_PATCHES.BCK,GATEWY::DECEDI$PUBLIC:;"
$!
$ rels           = 99
$ rel_systems    = ""
$ rel_systems_v1 = "VAX"
$ rel_systems_v2 = "AXP,VAX"
$!
$ update_job_required  = 0
$ update_job_updated   = 0
$ update_job_built     = 0
$ update_job_submitted = 0
$!
$ submit_interval_days = 1
$ submit_time          = "19:00:00.00"
$!
$ def_prcnam = f$edit(f$getjpi("","prcnam"),"trim")
$ def_privs  = "''f$setprv("all")'"
$ def_prior  = f$getjpi("","prib")
$ def_ctrl   = f$env("control")
$ def_mess   = f$env("message")
$ def_def    = f$env("default")
$!
$ proc         = f$par(f$env("procedure"),,,"name")
$ exit_status  = 1
$ set control  = (t,y) 
$ on control_y then goto abort
$ on error then goto abort
$ set process/priority=7
$ set message/f/i/s/t
$!
$ mode_batch  = f$mode() .eqs. "BATCH"
$ say         = "write sys$output ""%''proc'"", "
$ wrt         = "write sys$output "
$ append      = "append/new/nolog/noconfirm "
$ copy        = "copy/nolog/noconfirm "
$ create      = "create/nolog "
$ delete      = "delete/nolog/noconfirm "
$ purge       = "purge/nolog/noconfirm "
$ rename      = "rename/nolog/noconfirm "
$!
$ rundt       = f$cvt(,"absolute")
$ rundate     = f$ext(2,2,f$cvtime(rundt,,"year")) + -
                f$cvtime(rundt,,"month") + f$cvtime(rundt,,"day") 
$ rundatetime = f$ext(2,2,f$cvtime(rundt,,"year")) + -
                f$cvtime(rundt,,"month") + f$cvtime(rundt,,"day") + -
                f$cvtime(rundt,,"hour") + f$cvtime(rundt,,"minute") + -
                f$cvtime(rundt,,"second") + f$cvtime(rundt,,"hundredth") 
$ job         = "''proc'_''rundatetime'"
$!
$ if (f$trnlnm("decedi$data") .eqs. "") .and. -
     (f$sea("sys$manager:decedi$logicals.com") .nes. "") then -
     @sys$manager:decedi$logicals.com
$!
$ tolfilspec = "CSCEDI$:[TOOLS]DECEDI$INSTALL_PATCHES.COM"
$ insfilspec = "CSCEDI$:[TOOLS]DECEDI$INSTALL_PATCHES.TXT"
$ subfilspec = f$elem(0,";",f$env("procedure"))
$ maifilspec = "CSCEDI$:[TOOLS]''proc'.DIS"
$!
$ tolfilfil = f$par(tolfilspec,,,"name") + f$par(tolfilspec,,,"type")
$ insfilfil = f$par(insfilspec,,,"name") + f$par(insfilspec,,,"type")
$!
$ bld_owner_uic  = "[1,4]"
$ bld_protection = "S:RWED,O:RWED,G:RE,W:RE"
$!
$ini_parm:
$ parm_help   = 0 !default
$ parm_update = 1 !default
$ parm_kit    = 0 !default
$ parm_list   = 1 !default
$!
$ parms = -
  "?,HELP,NOHELP,UPDATE,NOUPDATE,UPD,NOUPD,KIT,NOKIT,LIST,NOLIST,LIS,NOLIS"
$ parm  = f$edit("''p1'","collapse,upcase") 
$ gosub ini_parm_parse
$ parm  = f$edit("''p2'","collapse,upcase") 
$ gosub ini_parm_parse
$ parm  = f$edit("''p3'","collapse,upcase") 
$ gosub ini_parm_parse
$ parm  = f$edit("''p4'","collapse,upcase") 
$ gosub ini_parm_parse
$ parm  = f$edit("''p5'","collapse,upcase") 
$ gosub ini_parm_parse
$ parm  = f$edit("''p6'","collapse,upcase") 
$ gosub ini_parm_parse
$ parm  = f$edit("''p7'","collapse,upcase") 
$ gosub ini_parm_parse
$ parm  = f$edit("''p8'","collapse,upcase") 
$ gosub ini_parm_parse
$ goto  ini_parm_exit
$ini_parm_parse:
$ if parm .nes. ""
$ then if parm .eqs. "?"        then parm_help   = 1
$      if parm .eqs. "HELP"     then parm_help   = 1
$      if parm .eqs. "NOHELP"   then parm_help   = 0
$      if parm .eqs. "UPDATE"   then parm_update = 1
$      if parm .eqs. "UPD"      then parm_update = 1
$      if parm .eqs. "NOUPDATE" then parm_update = 0
$      if parm .eqs. "NOUPD"    then parm_update = 0
$      if parm .eqs. "KIT"      then parm_kit    = 1
$      if parm .eqs. "NOKIT"    then parm_kit    = 0
$      if parm .eqs. "LIST"     then parm_list   = 1
$      if parm .eqs. "LIS"      then parm_list   = 1
$      if parm .eqs. "NOLIST"   then parm_list   = 0
$      if parm .eqs. "NOLIS"    then parm_list   = 0
$      if f$loc(parm,parms) .ge. f$len(parms)
$      then say "-F-INVPAR, invalid parameter ''parm'"
$           gosub hlp_help
$           goto abort
$      endif
$ endif
$ return
$ini_parm_exit:
$!
$ if parm_help 
$ then gosub hlp_help
$      goto eoj
$ endif
$!
$ if (mode_batch) .and. ((parm_update) .or. (parm_kit))
$ then proc = f$edit(proc,"trim,upcase")
$      set noon
$      set process/name="''proc'"
$      set on
$      on error then goto abort
$      prcnam = f$edit(f$getjpi("","prcnam"),"trim,upcase")
$      if prcnam .nes. proc
$      then say "-E-DUP, duplicate ''proc' job already executing"
$           goto eoj
$      endif
$ endif
$!
$ini_exit:
$ return
$!========================================================================
$prc_process:
$ on control_y then goto abort
$ on error then goto abort
$!
$ lstctr = 0
$prc_next_list:
$ lstctr = lstctr + 1
$ if f$type(rel'lstctr') .eqs. "" 
$ then if lstctr .gt. rels then goto prc_exit
       goto prc_next_list
$ endif
$ lst = rel'lstctr'
$ if f$edit(lst,"collapse") .eqs. "" then goto prc_next_list
$!
$ rels = lst
$ relctr = -1
$prc_next_rel:
$ relctr = relctr + 1
$ rel = f$elem(relctr,";",rels)
$ if rel .eqs. ";" then goto prc_next_list
$ if f$edit(rel,"collapse") .eqs. "" then goto prc_next_rel
$!
$ rel_lab        = f$edit(f$elem(0,",",rel),"compress,trim")
$ rel_srcfilspec = f$edit(f$elem(1,",",rel),"compress,trim")
$ rel_updfilspec = f$edit(f$elem(2,",",rel),"compress,trim")
$ rel_docfilspec = f$edit(f$elem(3,",",rel),"compress,trim")
$ rel_notfilspec = f$edit(f$elem(4,",",rel),"compress,trim")
$ rel_kitfilspec = f$edit(f$elem(5,",",rel),"compress,trim")
$ rel_relfilspec = f$edit(f$elem(6,",",rel),"compress,trim")
$!
$ srcfilnod  = f$par(rel_srcfilspec,,,"node")
$ srcfildev  = f$par(rel_srcfilspec,,,"device")
$ srcfildir  = f$par(rel_srcfilspec,,,"directory")
$ srcfilnam  = f$par(rel_srcfilspec,"*.*",,"name")
$ srcfiltyp  = f$par(rel_srcfilspec,"*.*",,"type")
$ srcfilloc  = srcfilnod + srcfildev + srcfildir 
$ srcfilfil  = srcfilnam + srcfiltyp
$ srcfilspec = srcfilloc + srcfilfil
$!
$ updfilnod  = f$par(rel_updfilspec,,,"node")
$ updfildev  = f$par(rel_updfilspec,,,"device")
$ updfildir  = f$par(rel_updfilspec,,,"directory")
$ updfilnam  = f$par(rel_updfilspec,"*.*",,"name")
$ updfiltyp  = f$par(rel_updfilspec,"*.*",,"type")
$ updfilloc  = updfilnod + updfildev + updfildir 
$ updfilfil  = updfilnam + updfiltyp
$ updfilspec = updfilloc + updfilfil
$!
$ docfilnod  = f$par(rel_docfilspec,srcfilspec,,"node")
$ docfildev  = f$par(rel_docfilspec,srcfilspec,,"device")
$ docfildir  = f$par(rel_docfilspec,srcfilspec,,"directory")
$ docfilnam  = f$par(rel_docfilspec,,,"name")
$ docfiltyp  = f$par(rel_docfilspec,,,"type")
$ docfilloc  = docfilnod + docfildev + docfildir 
$ docfilfil  = docfilnam + docfiltyp
$ docfilspec = docfilloc + docfilfil
$!
$ notfilnod  = f$par(rel_notfilspec,updfilspec,,"node")
$ notfildev  = f$par(rel_notfilspec,updfilspec,,"device")
$ notfildir  = f$par(rel_notfilspec,updfilspec,,"directory")
$ notfilnam  = f$par(rel_notfilspec,,,"name")
$ notfiltyp  = f$par(rel_notfilspec,,,"type")
$ notfilloc  = notfilnod + notfildev + notfildir 
$ notfilfil  = notfilnam + notfiltyp
$ notfilspec = notfilloc + notfilfil
$!
$ kitfilnod  = f$par(rel_kitfilspec,updfilspec,,"node")
$ kitfildev  = f$par(rel_kitfilspec,updfilspec,,"device")
$ kitfildir  = f$par(rel_kitfilspec,updfilspec,,"directory")
$ kitfilnam  = f$par(rel_kitfilspec,,,"name")
$ kitfiltyp  = f$par(rel_kitfilspec,,,"type")
$ kitfilloc  = kitfilnod + kitfildev + kitfildir 
$ kitfilfil  = kitfilnam + kitfiltyp
$ kitfilspec = kitfilloc + kitfilfil
$!
$ relfilnod  = f$par(rel_relfilspec,,,"node")
$ relfildev  = f$par(rel_relfilspec,,,"device")
$ relfildir  = f$par(rel_relfilspec,,,"directory")
$ relfilnam  = f$par(rel_relfilspec,kitfilspec,,"name")
$ relfiltyp  = f$par(rel_relfilspec,kitfilspec,,"type")
$ relfilloc  = relfilnod + relfildev + relfildir 
$ relfilfil  = relfilnam + relfiltyp
$ relfilspec = relfilloc + relfilfil
$!
$ dttxt = ""
$ kitseaspec = f$sea(kitfilspec)
$ if kitseaspec .nes. "" 
$ then kitcdt = f$file(kitseaspec,"cdt")
$      dttxt = "(" + f$cvt(kitcdt,"absolute","date") + " " + -
               f$ext(0,5,f$cvt(kitcdt,"absolute","time")) + ")"
$ endif
$!
$ if parm_list then say "-I-REL, processing ''rel_lab' ''dttxt'..."
$!
$ update_rel_required = 0
$ update_rel_updated  = 0
$ update_rel_built    = 0
$!
$ gosub new_check_new_release
$ if new_release 
$ then update_rel_required = 1
$      if (mode_batch) .and. ((parm_update) .or. (parm_kit))
$      then gosub upd_update_patches
$           update_rel_updated = 1
$      else say "-W-OLD, patches require update ''rel_lab' "
$      endif
$ else say "-I-CUR, patches are current ''rel_lab' "
$ endif
$!
$ if (mode_batch) .and. ((update_rel_updated) .or. (parm_kit)) 
$ then gosub bld_build_kits
$      update_rel_built = 1
$ endif
$!
$ if update_rel_required then update_job_required = 1
$ if update_rel_updated  then update_job_updated  = 1
$ if update_rel_built    then update_job_built    = 1
$!
$ goto prc_next_rel
$!
$prc_exit:
$ return
$!========================================================================
$new_check_new_release:
$ on control_y then goto abort
$ on error then goto abort
$!
$ new_release       = 0
$ last_release_date = "''rundate'"
$ last_cdtcomp      = ""
$ last_cdt          = ""
$!
$ srcseaspec = f$par(srcfilspec,";0",,,"syntax_only")
$ wildcarded = f$loc("*",srcseaspec) .lt. f$len(srcseaspec) 
$ seastream  = f$int(f$cvt(,,"hour")) + f$int(f$cvt(,,"minute")) + -
               f$int(f$cvt(,,"second")) + f$int(f$cvt(,,"hundredth"))  
$new_next_file:
$ srcnexspec = f$sea(srcseaspec,seastream)
$ if srcnexspec .eqs. "" then goto new_exit
$ srcnexfil = f$par(srcnexspec,,,"name") + f$par(srcnexspec,,,"type")
$!
$ srccdt     = f$cvt(f$file(srcnexspec,"cdt"),"absolute")
$ srccdtcomp = f$cvt(srccdt,"comparison") 
$ srccdttxt  = "(''f$cvt(srccdt,"absolute","date")' " + -
               "''f$ext(0,5,f$cvt(srccdt,"absolute","time"))')"
$!
$ if srccdtcomp .gts. last_cdtcomp
$ then last_cdt          = srccdt
$      last_cdtcomp      = f$cvt(last_cdt,"comparison") 
$      last_release_date = f$ext(2,2,f$cvtime(last_cdt,,"year")) + -
                           f$cvtime(last_cdt,,"month") + -
                           f$cvtime(last_cdt,,"day") 
$ endif
$!
$ updseaspec = f$elem(0,";",f$par(updfilloc,srcnexfil,,,"syntax_only"))
$ updnexspec = f$sea(updseaspec)
$ if updnexspec .eqs. "" 
$ then if parm_list then say "-W-NEW, new file ''srcnexfil' ''srccdttxt' "
$      goto new_new_release
$ endif
$!
$ updcdt = f$cvt(f$file(updnexspec,"cdt"),"absolute")
$ if f$cvt(srccdt,"comparison") .gts. f$cvt(updcdt,"comparison") 
$ then if parm_list then say "-W-MOD, modified file ''srcnexfil' ''srccdttxt' "
$      goto new_new_release
$ endif
$!
$ goto new_next_file_done
$new_new_release:
$ new_release = 1
$ if (.not. mode_batch) .and. (.not. parm_list) then goto new_exit
$new_next_file_done:
$ if wildcarded then goto new_next_file
$new_exit:
$ return
$!========================================================================
$upd_update_patches:
$ on control_y then goto abort
$ on error then goto abort
$!
$ say "-W-UPD, updating ''rel_lab'..."
$!
$ updsubspec = f$ext(0,f$len(updfilloc)-1,updfilloc) + ".*...]*.*"
$ notdesspec = notfilspec
$ if f$loc("*",notfilnam) .lt. f$len(notfilnam) then notdesspec = notfilloc + -
  f$elem(0,"*",notfilnam) + "''last_release_date'" + -
  f$elem(1,"*",notfilnam) + notfiltyp
$!
$!!
$!
$ if f$sea(updsubspec) .nes. "" then delete 'updsubspec';*
$ if f$sea(updsubspec) .nes. "" then delete 'updsubspec';*
$ if f$sea("''updfilloc'*.*") .nes. "" then delete 'updfilloc'*.*;*
$!
$ copy 'srcfilspec';0 'updfilspec';0
$!
$ if f$sea(tolfilspec) .nes. "" then copy 'tolfilspec' 'updfilloc'
$ if f$sea(insfilspec) .nes. "" then copy 'insfilspec' 'updfilloc'
$!
$ if f$sea(docfilspec) .nes. "" 
$ then if f$sea(insfilspec) .nes. "" 
$      then append 'insfilspec','docfilspec' 'notdesspec'
$      else copy 'docfilspec' 'notdesspec'
$      endif
$ endif
$!
$ if f$sea("''updfilloc'*.*;-1") .nes. "" then purge  'updfilloc'*.*
$ if f$sea("''updfilloc'*.*")    .nes. "" then rename 'updfilloc'*.* *.*;1
$!
$ if f$sea("''updfilloc'*.*") .nes. "" then -
  set file/owner='bld_owner_uic'/prot=('bld_protection') 'updfilloc'*.*;*
$!
$upd_exit:
$ return
$!========================================================================
$bld_build_kits:
$ on control_y then goto abort
$ on error then goto abort
$!
$ release_nr = 0
$ byte = -1
$bld_parse:
$ byte = byte + 1
$ char = f$ext(byte,1,rel_lab)
$ if f$type(char) .nes. "INTEGER" then goto bld_parse
$ if char .nes. "" then release_nr = f$int(char)
$!
$ if release_nr .eq. 1 
$ then rel_systems = rel_systems_v1
$ else rel_systems = rel_systems_v2
$ endif
$!
$ sysctr = -1
$bld_next_sys:
$ sysctr = sysctr + 1
$ sys = f$elem(sysctr,",",rel_systems)
$ if sys .eqs. "," then goto bld_exit
$ if f$edit(sys,"collapse") .eqs. "" then goto bld_next_sys
$!
$ bldfilloc  = f$ext(0,f$len(updfilloc)-1,updfilloc) + ".''sys']"
$ bldfilspec = bldfilloc + "*.*"
$ bldparspec = updfilloc + sys + ".DIR"
$!
$ docbldspec = bldfilloc + docfilfil
$!
$ notbldspec = f$elem(0,";",f$par(bldfilloc,notfilfil,,,"syntax_only"))
$!
$ kitdesspec = kitfilspec
$ if f$loc("*",kitfilnam) .lt. f$len(kitfilnam) then kitdesspec = kitfilloc + -
  f$elem(0,"*",kitfilnam) + "''sys'" + f$elem(1,"*",kitfilnam) + kitfiltyp
$ kitdesfil = f$par(kitdesspec,,,"name") + f$par(kitdesspec,,,"type") 
$!
$ reldesspec = relfilspec
$ if f$loc("*",relfilnam) .lt. f$len(relfilnam) then -
  reldesspec = relfilloc + kitdesfil
$!
$ say "-W-KIT, generating ''kitdesfil'..."
$!
$ if f$sea(tolfilspec) .nes. "" then copy 'tolfilspec' 'updfilloc'
$ if f$sea(insfilspec) .nes. "" then copy 'insfilspec' 'updfilloc'
$ if f$sea("''updfilloc'*.*;-1") .nes. "" then purge 'updfilloc'*.*
$!
$ if f$sea(bldparspec) .eqs. "" then create /directory 'bldfilloc'
$ if f$sea("''bldfilspec';-1") .nes. "" then purge 'bldfilspec'
$ if f$sea(notbldspec) .nes. "" then delete 'notbldspec';*
$!
$ copy 'updfilspec';0 /exclude=*.dir 'bldfilspec';0
$!
$ if f$sea("''bldfilloc'*.exe_''sys'") .nes. "" then -
  rename 'bldfilloc'*.exe_'sys' *.exe
$ if f$sea("''bldfilloc'*.exe_*") .nes. "" then delete 'bldfilloc'*.exe_*;*
$!
$ if f$sea(docbldspec) .nes. "" then delete 'docbldspec';*
$!
$ gosub bck_backup_kit
$ gosub rel_release_kit
$!
$ if f$type(debug) .nes. ""
$ then if .not. debug
$      then if f$sea(bldfilspec) .nes. "" then delete 'bldfilspec';*
$           if f$sea(bldparspec) .nes. "" then delete 'bldparspec';*
$      endif
$ endif
$!
$ goto bld_next_sys
$!
$bld_exit:
$ return
$!========================================================================
$bck_backup_kit:
$ on control_y then goto abort
$ on error then goto abort
$!
$ if f$sea("''bldfilloc'*.*;-1") .nes. "" then purge  'bldfilloc'*.*
$ if f$sea("''bldfilloc'*.*")    .nes. "" then rename 'bldfilloc'*.* *.*;1
$ if f$sea("''kitdesspec';-1")   .nes. "" then purge  'kitdesspec'
$ if f$sea(kitdesspec)           .nes. "" then rename 'kitdesspec' *.*;1
$!
$ if f$sea("''bldfilloc'*.*") .nes. "" then -
  set file/owner='bld_owner_uic'/prot=('bld_protection') 'bldfilloc'*.*;*
$!
$ backup 'bldfilspec';0 'kitdesspec' /save
$!
$ if f$sea("''kitdesspec';-1") .nes. "" then purge  'kitdesspec'
$ if f$sea(kitdesspec)         .nes. "" then rename 'kitdesspec' *.*;1
$!
$bck_exit:
$ return
$!========================================================================
$rel_release_kit:
$ on control_y then goto abort
$ on error then goto abort
$!
$ if f$sea("''kitdesspec';-1") .nes. "" then purge  'kitdesspec'
$ if f$sea(kitdesspec)         .nes. "" then rename 'kitdesspec' *.*;1
$ if f$sea(reldesspec)         .nes. "" then delete 'reldesspec';*
$!
$ copy 'kitdesspec' 'reldesspec'
$!
$ if f$sea("''reldesspec';-1") .nes. "" then purge  'reldesspec'
$!
$rel_exit:
$ return
$!========================================================================
$sub_submit:
$ on control_y then goto abort
$ on error then goto abort
$!
$ if f$int("''exit_status'") .ne. 1 then goto sub_exit
$!
$ say "-I-SUB, submitting update job..."
$!
$ sub_quals = "/NOPRINT/KEEP"
  sub_later = "/AFTER=" + -
      f$cvt("today+''submit_interval_days'-00:00:00.00","absolute","date") + -
      ":''submit_time'"
$!
$ sub_parms  = """UPDATE"""
$ if .not. parm_update then sub_parms = """NOUPDATE"""
$!
$ if (parm_kit) .and. (.not. update_job_built) then -
  sub_parms = sub_parms + ",""KIT"""
$! 
$ if (parm_kit) .and. (.not. update_job_built) then goto sub_now
$ if ((update_job_updated) .and. (update_job_built)) .or. -
     ((.not. update_job_updated) .and. (.not. update_job_required)) then -
$    goto sub_later
$ goto sub_now
$sub_later:
$ sub_quals = sub_quals + sub_later
$sub_now:
$!
$ submit 'sub_quals' 'subfilspec' /parameter=('sub_parms')
$ update_job_submitted = 1
$!
$sub_exit:
$ return
$!========================================================================
$not_notify:
$ on control_y then goto abort
$ on error then goto abort
$!
$ if .not. mode_batch then goto not_exit
$!
$ recipient  = f$edit(f$getjpi("","username"),"collapse")
$ if (.not. debug) .and. (f$sea("''maifilspec'") .nes. "") then -
  recipient = recipient + ",@''maifilspec'"
$!
$ msg = "''proc'"
$ if f$int("''exit_status'") .eq. 1 
$ then if update_job_updated 
$      then msg = "''proc' updates performed...see log"
$      else if update_job_built
$           then msg = "''proc' kits built"
$           else if update_job_submitted
$                then msg = "''proc' updates submitted"
$                     goto not_exit
$                else if update_job_required
$                     then msg = "''proc' updates required"
$                     else msg = "''proc' all patches current"
$                          goto not_exit
$                     endif
$                endif
$           endif
$      endif
$ else msg = "''proc' failed; see log."
$ endif
$!
$ mail nl: "''recipient'" /subject="''msg'"
$!
$not_exit:
$ return
$!========================================================================
$abort:
$ set noon
$ exit_status = 44
$exit:
$ gosub not_notify
$eoj:
$ if (f$type(def_ctrl) .nes. "") .and. -
     (f$edit("''def_ctrl'","collapse") .nes. "") then set control=('def_ctrl')
$ if f$type(def_def)    .nes. "" then set default 'def_def'
$ if f$type(def_mess)   .nes. "" then set message 'def_mess'
$ if f$type(def_prior)  .nes. "" then set process /prior='def_prior'
$ if f$type(def_privs)  .nes. "" then curr_privs=f$setprv("''def_privs'")
$ if f$type(verify)     .nes. "" then verify=f$verify(verify)
$ exit 'exit_status'
$!

$! 
$! DECEDI$INSTALL_PATCHES 
$! 
$! To install the saveset of DEC/EDI patches, 
$! restore the saveset_file's contents to an empty default directory, and, 
$! with DEC/EDI shutdown (on all nodes, if clustered), 
$! execute the installation procedure, e.g.:
$! 
$!      $ SET DEFAULT SYS$LOGIN:
$!      $ CREATE /DIRECTORY [.decedi_patches]
$!      $ BACKUP saveset_file /SAVE_SET [.decedi_patches]
$!      $ SET DEFAULT [.decedi_patches]
$!      $ @DECEDI$INSTALL_PATCHES.COM
$! 
$! After installation, the release notes will be the latest dated version(s) 
$! of DIRECTORY/DATE SYS$HELP:DECEDI$*PATCHES*.RELEASE_NOTES.
$! 
$!
$ verify=f$verify(0)
$!============================================================================
$! DECEDI$INSTALL_PATCHES.COM
$  software_version = "v1.4, 09-DEC-1996"
$! P1 = "?" = Help
$!
$! To install the saveset of DEC/EDI patches, restore the saveset_file's 
$! contents to an empty default directory, and, with DEC/EDI shutdown, 
$! execute the installation procedure, e.g.,:
$! 
$!      $ SET DEFAULT SYS$LOGIN:
$!      $ CREATE /DIRECTORY [.decedi_patches]
$!      $ BACKUP saveset_file /SAVE_SET [.decedi_patches]
$!      $ SET DEFAULT [.decedi_patches]
$!      $ @DECEDI$INSTALL_PATCHES.COM
$! 
$! After installation, the release notes will be the latest dated version of 
$! SYS$HELP:DECEDI$*PATCHES*.RELEASE_NOTES.
$!
$! Installs DEC/EDI files ('SOURCES') located in the default directory 
$! ('SOURCE_LOCATION'), if DEC/EDI is shutdown, copying new files to existing 
$! files' locations ('TARGETS') using existing files' ownership and 
$! protection, while accounting for SYS$SPECIFIC vs. SYS$COMMON file 
$! locations.  Defaults defined in 'DEFAULT_TARGET', 'DEFAULT_OWNER', and 
$! 'DEFAULT_PROTECTION'.
$!
$!============================================================================
$! COPYRIGHT (C) DIGITAL EQUIPMENT CORPORATION, 1994,1996 ALL RIGHTS RESERVED. 
$! Unpublished rights reserved under the copyright laws of the United States. 
$! The software contained on this media is proprietary to and embodies the
$! confidential technology of Digital Equipment Corporation.  Possession, use,
$! duplication or dissemination of the software and media is authorized only
$! pursuant to a valid written license from Digital Equipment Corporation. 
$! Restricted Rights Legend:  Use, duplication, or disclosure by the U.S.
$! Government is subject to restrictions as set forth in Subparagraph 
$! (c)(1)(ii) of DFARS 252.227-7013, or in FAR 52.227-19, as applicable. 
$!============================================================================
$! EXAMPLE SOFTWARE DISCLAIMER:
$! This software is intended to be used as a guide for the customer in creating
$! software, and it may require modification for use on any system.  Digital 
$! Equipment Corporation assumes no responsibility and makes no representations
$! or guarantees regarding the use, performance, effectiveness, or reliability
$! of this example software, as is provided here.  The information in this 
$! software is subject to change without notice and should not be construed as
$! a commitment by Digital.  This software is provided as is, with all faults, 
$! and with no warranties either expressed or implied in law, including implied
$! warranties of merchantability and fitness for a particular purpose.  Digital
$! accepts no responsibility for any expenses, losses, or action incurred or 
$! undertaken by any party as a result of their use of this software.  In no 
$! event shall Digital have any liability whatsoever for incidental or 
$! consequential damages as a result of the performance, use, or operation of 
$! this software.  The customer shall have the sole responsibility for 
$! adequate protection and backup used in conjunction with this software. 
$!============================================================================
$ procedure = f$env("procedure")
$ proc      = f$par(procedure,,,"name")
$!
$ source_location = "[]"
$ sources = ""
$!sources=sources+ "source[,target][,purge]^..." !"*"=substitute curr yymmdd
$ sources=sources+ "DECEDI$*.RELEASE_NOTES,SYS$COMMON:[SYSHLP],Y^"
$ sources=sources+ "DECEDI$*.RELEASE_NOTES,SYS$COMMON:[SYSHLP],Y^"
$ sources=sources+ -
  "README.TXT,SYS$COMMON:[SYSHLP]DECEDI$PATCHES_*.RELEASE_NOTES,Y^"
$ sources=sources+ -
  "$$README_FIRST.TXT,SYS$COMMON:[SYSHLP]DECEDI$PATCHES_*.RELEASE_NOTES,Y^"
$ sources=sources+ "''procedure',DECEDI$TOOLS:,Y^"
$ sources=sources+ "''proc'.TXT,DECEDI$TOOLS:,Y^"
$ sources=sources+ "''proc'.DOC,DECEDI$TOOLS:,Y^"
$ sources=sources+ "DECEDI*.*;0,,N^"
$ sources=sources+ "FBR*.*;0,,N^"
$!
$ targets = ""
$ targets = targets + "DECEDI$EXE:^DECEDI$COM:^DECEDI$MSG:^"
$ targets = targets + "DECEDI$DATA:^DECEDI$TOOLS:^DECEDI$IMPDEF:^"
$ targets = targets + "DECEDI$AUDIT:^DECEDI$ARCH_DATA:^"
$ targets = targets + "DECEDI$MESSAGE_UPDATES:^DECEDI$BACKUP:^"
$ targets = targets + "DECEDI$ERROR:^DECEDI$VANREPORTS:^DECEDI$EXAMPLES:^"
$ targets = targets + "SYS$SYSTEM:^SYS$LIBRARY:^SYS$SHARE:^"
$ targets = targets + "SYS$LOADABLE_IMAGES:^SYS$MESSAGE:^SYS$STARTUP:^"
$ targets = targets + "SYS$MANAGER:^SYS$ERRORLOG:^SYS$TEST:^"
$ targets = targets + "SYS$HELP:^SYS$EXAMPLES:^SYS$INSTRUCTION:^"
$ targets = targets + "SYS$JOURNAL:^SYS$UPDATE:^SYS$MAINTENANCE:^"
$ targets = targets + "DECEDI$CVP:^DECEDI$SAFE_DIRECTORY:^DECEDI$TEMP:^"
$ targets = targets + "DECEDI$TOP:[000000]^FBR$HOME:^"
$!
$ default_target     = "DECEDI$EXE:"
$ default_owner      = "[1,4]"
$ default_protection = "(S:RWED,O:RWED,G:RE,W:RE)"
$!=============================================================================
$ exit_status = 1
$ on control_y then goto quit
$ procedure = f$env("procedure")
$ proc      = f$par(procedure,,,"name")
$ if (p1 .eqs. "?") .or. (f$edit(p1,"upcase") .eqs. "HELP") then goto help
$ curr_date = f$ext(2,2,f$cvtime(,,"year")) + f$cvtime(,,"month") + -
  f$cvtime(,,"day") 
$ curr_datetime = f$ext(2,2,f$cvtime(,,"year")) + f$cvtime(,,"month") + -
  f$cvtime(,,"day") + f$cvtime(,,"hour") + f$cvtime(,,"minute")
$!
$ediup:
$ pid_context = ""
$ediup_process:
$ pid = f$pid(pid_context)
$ if f$edit(pid,"collapse") .eqs. "" then goto ediup_shutdown
$ if f$ext(0,7,f$edit(f$getjpi(pid,"prcnam"),"trim,upcase")) .nes. -
  "DECEDI$" then goto ediup_process
$ write sys$output "%''proc'-F-NOTSHUTDOWN, DEC/EDI must be shutdown"
$ goto abort
$ediup_shutdown:
$!
$ if f$trnlnm("decedi$data") .eqs. "" then @sys$manager:decedi$logicals
$!
$install_files:
$ on control_y then goto aborted
$ set process/privileges=all
$ source_ctr = -1
$next_source:
$ source_ctr = source_ctr + 1
$ source_info = f$elem(source_ctr,"^",sources)
$ if f$edit(source_info,"collapse") .eqs. "" then goto next_source
$ if source_info .eqs. "^" then goto install_files_complete
$ source_search_spec = -
  f$par(f$elem(0,",",source_info),"''source_location'",";0")
$ if (f$par(source_search_spec,,,"name") .eqs. "") .or. -
     (f$par(source_search_spec,,,"type") .eqs. "") .or. -
     (f$par(source_search_spec,,,"type") .eqs. ".") .or. -
     (source_search_spec .eqs. "") then goto next_source
$!
$ source_dest = f$elem(1,",",source_info)
$ if source_dest .eqs. "," then source_dest = ""
$!
$ source_purge_selected = -
  f$edit(f$elem(2,",",source_info),"collapse,upcase") .eqs. "Y"
$!
$ source_search_stream = -
  f$int(f$cvtime(,,"hour"))   + f$int(f$cvtime(,,"minute")) + -
  f$int(f$cvtime(,,"second")) + f$int(f$cvtime(,,"hundredth"))
$ source_search_spec_wildcarded = -
  f$loc("*",source_search_spec) .lt. f$len(source_search_spec)
$find_source:
$ source_spec = f$search(source_search_spec,source_search_stream)
$ if source_spec .eqs. "" then goto next_source
$ source_file = f$par(source_spec,,,"name") + f$par(source_spec,,,"type")
$!
$ if source_dest .nes. "" then goto target_location_selected
$ target_ctr = -1
$next_target:
$ target_ctr = target_ctr + 1
$ target = f$elem(target_ctr,"^",targets)
$ if f$edit(target,"collapse") .eqs. "" then goto next_target
$ if target .eqs. "^" then goto target_location_default
$ goto target_location_found
$!
$target_location_found:
$ target_spec = f$search(f$par(target,source_file,"*.*;0"))
$ if target_spec .eqs. "" then goto next_target
$ target_own  = f$file_attributes(target_spec,"uic")
$ target_prot = "(" + f$file_attributes(target_spec,"pro") + ")"
$ goto copy_file
$target_location_default:
$ write sys$output " "
$ write sys$output -
  "%''proc'-W-FNF, pre-existing file not found ''source_file'"
$ write sys$output "_''proc'-I-DEFAULT, copying file to ''default_target'"
$ write sys$output " "
$ target_spec = f$par(default_target,source_file,"*.*;0")
$ target_own  = default_owner
$ target_prot = default_protection
$ goto copy_file
$target_location_selected:
$ target_spec = f$par(source_dest,source_spec,"*.*;0")
$ if f$loc("*",target_spec) .lt. f$len(target_spec) then target_spec = -
  f$elem(0,"*",target_spec) + curr_date + f$elem(1,"*",target_spec) 
$ target_own  = default_owner
$ target_prot = default_protection
$ goto copy_file
$!
$copy_file:
$ target_dev     = f$par(target_spec,,,"device")
$ target_dir     = f$par(target_spec,,,"directory")
$ target_file    = f$par(target_spec,,,"name") + f$par(target_spec,,,"type")
$!
$ if target_dev .eqs. "SYS$SYSROOT:"
$ then target_sysspec = "SYS$SPECIFIC:" + target_dir + target_file
$      target_syscomm = "SYS$COMMON:"   + target_dir + target_file
$      if f$search(target_sysspec) .nes. ""
$      then copy/nolog 'target_sysspec';0 'target_syscomm';0 
$           delete/nolog 'target_sysspec';*
$      endif
$      destination = target_syscomm
$ else
$      destination = target_dev + target_dir + target_file
$ endif
$!
$ copy/log 'source_spec' 'destination';0
$ set file/own='target_own'/prot='target_prot' 'destination';0
$ if source_purge_selected then purge/nolog/noconfirm 'destination'
$!
$next_install_file:
$ if source_search_spec_wildcarded then goto find_source
$ goto next_source
$install_files_complete:
$ goto exit
$!
$help:
$ write sys$output "%''proc'-I-HELP, ''proc' ''software_version'"
$ write sys$output ""
$ write sys$output -
  "To install the saveset of DEC/EDI patches, restore the saveset_file's"
$ write sys$output -
  "contents to an empty default directory, and, with DEC/EDI shutdown,"
$ write sys$output -
  "execute the installation procedure, e.g.,:"
$ write sys$output ""
$ write sys$output "     $ SET DEFAULT SYS$LOGIN:"
$ write sys$output "     $ CREATE /DIRECTORY [.decedi_patches]"
$ write sys$output "     $ BACKUP saveset_file /SAVE_SET [.decedi_patches]"
$ write sys$output "     $ SET DEFAULT [.decedi_patches]"
$ write sys$output "     $ @''proc'"
$ write sys$output ""
$ write sys$output -
  "After installation, the release notes will be the latest dated version of"
$ write sys$output -
  "SYS$HELP:DECEDI$*PATCHES*.RELEASE_NOTES."
$ write sys$output ""
$ goto exit
$quit:
$ write sys$output "%''proc'-I-QUIT, files not installed"
$ goto exit
$aborted:
$ write sys$output "%''proc'-W-CORRUPT, any partially copied files are corrupt"
$ goto abort
$abort:
$ write sys$output "%''proc'-F-ABORT, abort"
$ exit_status = 44
$ goto exit
$exit:
$ if "''verify'" .nes. "" then verify = f$verify(verify)
$ exit 'exit_status'